From dcb3c71d33b5f2aae30d8ed64575fcf1c751b939 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:25:56 -0700 Subject: [PATCH 001/156] Initial prefab integration Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 12 +- .../Asset/RuntimeAssetSystemComponent.cpp | 6 +- .../Code/Builder/ScriptCanvasBuilder.cpp | 372 ++++++++++++++++++ .../Code/Builder/ScriptCanvasBuilder.h | 82 ++++ .../Builder/ScriptCanvasBuilderComponent.cpp | 3 + .../Builder/ScriptCanvasBuilderWorker.cpp | 11 +- .../Code/Builder/ScriptCanvasBuilderWorker.h | 12 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 46 ++- .../EditorScriptCanvasComponent.cpp | 225 +++-------- .../Framework/ScriptCanvasGraphUtilities.h | 16 +- .../Framework/ScriptCanvasGraphUtilities.inl | 52 ++- .../Components/EditorScriptCanvasComponent.h | 32 +- .../LoggingPanel/LoggingDataAggregator.cpp | 8 +- .../ScriptCanvas/Asset/RuntimeAsset.cpp | 99 ++++- .../Include/ScriptCanvas/Asset/RuntimeAsset.h | 29 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 32 +- .../Code/Include/ScriptCanvas/Core/Core.h | 43 +- .../Code/Include/ScriptCanvas/Core/Datum.cpp | 363 +++++++++-------- .../Code/Include/ScriptCanvas/Core/Datum.h | 24 +- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 48 +-- .../ScriptCanvas/Debugger/Debugger.cpp | 3 +- .../Execution/ExecutionContext.cpp | 123 +++--- .../ScriptCanvas/Execution/ExecutionContext.h | 22 +- .../ScriptCanvas/Execution/ExecutionState.cpp | 30 +- .../ScriptCanvas/Execution/ExecutionState.h | 10 +- .../Interpreted/ExecutionInterpretedAPI.cpp | 50 ++- .../Interpreted/ExecutionStateInterpreted.cpp | 24 +- ...ExecutionStateInterpretedPerActivation.cpp | 17 +- .../ExecutionStateInterpretedPure.cpp | 10 +- .../Execution/RuntimeComponent.cpp | 66 ++-- .../ScriptCanvas/Execution/RuntimeComponent.h | 25 +- .../Grammar/AbstractCodeModel.cpp | 308 ++++++++------- .../ScriptCanvas/Grammar/AbstractCodeModel.h | 35 +- .../ScriptCanvas/Grammar/ParsingUtilities.cpp | 48 ++- .../ScriptCanvas/Grammar/ParsingUtilities.h | 13 +- .../ScriptCanvas/Grammar/Primitives.cpp | 39 +- .../Grammar/PrimitivesDeclarations.cpp | 8 +- .../Grammar/PrimitivesDeclarations.h | 22 +- .../ScriptUserDataSerializer.cpp | 104 +++++ .../Serialization/ScriptUserDataSerializer.h | 36 ++ .../ScriptCanvas/Translation/GraphToX.cpp | 16 +- .../ScriptCanvas/Translation/Translation.cpp | 86 ++-- .../ScriptCanvas/Translation/Translation.h | 13 +- .../Translation/TranslationResult.h | 18 +- .../Translation/TranslationUtilities.cpp | 2 +- .../Translation/TranslationUtilities.h | 2 +- .../ScriptCanvas/Variable/GraphVariable.cpp | 62 +-- .../Code/Source/SystemComponent.cpp | 26 +- .../Code/scriptcanvasgem_common_files.cmake | 4 +- ...scriptcanvasgem_editor_builder_files.cmake | 4 +- 50 files changed, 1747 insertions(+), 994 deletions(-) create mode 100644 Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp create mode 100644 Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 69c8032d1f..b59c02f0b6 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -19,7 +19,7 @@ #include #include -// Undo this + // Undo this AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include #include @@ -90,8 +90,8 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Deactivate() { ScriptCanvas::Translation::RequestBus::Handler::BusDisconnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); - + ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); + EditorAssetConversionBus::Handler::BusDisconnect(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusDisconnect(); m_editorAssetRegistry.Unregister(); @@ -119,8 +119,8 @@ namespace ScriptCanvasEditor AZ::Data::Asset EditorAssetSystemComponent::LoadAsset(AZStd::string_view graphPath) { - auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath); - + auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath, AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + if (outcome.IsSuccess()) { return outcome.GetValue(); diff --git a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp index e15a2ae955..128a2f1915 100644 --- a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp @@ -21,8 +21,10 @@ namespace ScriptCanvas void RuntimeAssetSystemComponent::Reflect(AZ::ReflectContext* context) { - ScriptCanvas::RuntimeData::Reflect(context); - ScriptCanvas::SubgraphInterfaceData::Reflect(context); + RuntimeData::Reflect(context); + RuntimeDataOverrides::Reflect(context); + SubgraphInterfaceData::Reflect(context); + if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp new file mode 100644 index 0000000000..ff0fdf6273 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -0,0 +1,372 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include + +namespace ScriptCanvasBuilderCpp +{ + void AppendTabs(AZStd::string& result, size_t depth) + { + for (size_t i = 0; i < depth; ++i) + { + result += "\t"; + } + } +} + +namespace ScriptCanvasBuilder +{ + void BuildVariableOverrides::Clear() + { + m_source.Reset(); + m_variables.clear(); + m_entityIds.clear(); + m_dependencies.clear(); + } + + void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) + { + for (auto& overriddenValue : m_overrides) + { + auto iter = AZStd::find_if(source.m_overrides.begin(), source.m_overrides.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); }); + + if (iter != source.m_overrides.end()) + { + overriddenValue.DeepCopy(*iter); + overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overriddenValue.SetAllowSignalOnChange(false); + // check that a name update is not necessary anymore + } + } + + ////////////////////////////////////////////////////////////////////////// + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + // the above will provide the data to handle the cases where only certain dependency nodes were removed + // until then we do a sanity check, if any part of the depenecies were altered, assume no overrides are valid. + if (m_dependencies.size() != source.m_dependencies.size()) + { + return; + } + else + { + for (size_t index = 0; index != m_dependencies.size(); ++index) + { + if (m_dependencies[index].m_source != source.m_dependencies[index].m_source) + { + return; + } + } + } + ////////////////////////////////////////////////////////////////////////// + + for (size_t index = 0; index != m_dependencies.size(); ++index) + { + m_dependencies[index].CopyPreviousOverriddenValues(source.m_dependencies[index]); + } + } + + bool BuildVariableOverrides::IsEmpty() const + { + return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); + } + + void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) + { + if (auto serializeContext = azrtti_cast(reflectContext)) + { + serializeContext->Class() + ->Version(0) + ->Field("source", &BuildVariableOverrides::m_source) + ->Field("variables", &BuildVariableOverrides::m_variables) + ->Field("entityId", &BuildVariableOverrides::m_entityIds) + ->Field("overrides", &BuildVariableOverrides::m_overrides) + ->Field("dependencies", &BuildVariableOverrides::m_dependencies) + ; + + if (auto editContext = serializeContext->GetEditContext()) + { + editContext->Class< BuildVariableOverrides>("Variables", "Variables exposed by the attached Script Canvas Graph") + ->ClassElement(AZ::Edit::ClassElements::Group, "Variable Fields") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_overrides, "Variables", "Array of Variables within Script Canvas Graph") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_dependencies, "Dependencies", "Variables in Dependencies of the Script Canvas Graph") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ; + } + } + } + + // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display + void BuildVariableOverrides::PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables) + { + for (auto& variable : inputs.m_variables) + { + auto graphVariable = variables.FindVariable(variable.first); + if (!graphVariable) + { + AZ_Error("ScriptCanvasBuilder", false, "Missing Variable from graph data that was just parsed"); + continue; + } + + m_variables.push_back(*graphVariable); + auto& buildVariable = m_variables.back(); + buildVariable.DeepCopy(*graphVariable); // in case of BCO, a new one needs to be created + + // copy to override list for editor display + m_overrides.push_back(*graphVariable); + auto& overrideValue = m_overrides.back(); + overrideValue.DeepCopy(*graphVariable); + overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overrideValue.SetAllowSignalOnChange(false); + } + + for (auto& entityId : inputs.m_entityIds) + { + m_entityIds.push_back(entityId); + + if (!ScriptCanvas::Grammar::IsParserGeneratedId(entityId.first)) + { + auto graphEntityId = variables.FindVariable(entityId.first); + if (!graphEntityId) + { + AZ_Error("ScriptCanvasBuilder", false, "Missing EntityId from graph data that was just parsed"); + continue; + } + + // copy to override list for editor display + if (graphEntityId->IsComponentProperty()) + { + m_overrides.push_back(*graphEntityId); + auto& overrideValue = m_overrides.back(); + overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); + overrideValue.SetAllowSignalOnChange(false); + } + } + } + } + + EditorAssetTree* EditorAssetTree::ModRoot() + { + if (!m_parent) + { + return this; + } + + return m_parent->ModRoot(); + } + + void EditorAssetTree::SetParent(EditorAssetTree& parent) + { + m_parent = &parent; + } + + AZStd::string EditorAssetTree::ToString(size_t depth) const + { + AZStd::string result; + ScriptCanvasBuilderCpp::AppendTabs(result, depth); + result += m_asset.GetId().ToString(); + result += m_asset.GetHint(); + depth += m_dependencies.empty() ? 0 : 1; + + for (const auto& dependency : m_dependencies) + { + result += "\n"; + ScriptCanvasBuilderCpp::AppendTabs(result, depth); + result += dependency.ToString(depth); + } + + return result; + } + + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& buildOverrides) + { + ScriptCanvas::RuntimeDataOverrides runtimeOverrides; + + runtimeOverrides.m_runtimeAsset = AZ::Data::Asset + (AZ::Data::AssetId(buildOverrides.m_source.GetId().m_guid, AZ_CRC("RuntimeData", 0x163310ae)), azrtti_typeid(), {}); + runtimeOverrides.m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); + runtimeOverrides.m_variableIndices.resize(buildOverrides.m_variables.size()); + + for (size_t index = 0; index != buildOverrides.m_variables.size(); ++index) + { + auto& variable = buildOverrides.m_variables[index]; + auto iter = AZStd::find_if(buildOverrides.m_overrides.begin(), buildOverrides.m_overrides.end(), [&variable](auto& candidate) { return candidate.GetVariableId() == variable.GetVariableId(); }); + if (iter != buildOverrides.m_overrides.end()) + { + if (iter->GetDatum()) + { + runtimeOverrides.m_variables.push_back(ScriptCanvas::RuntimeVariable(iter->GetDatum()->ToAny())); + runtimeOverrides.m_variableIndices[index] = true; + } + else + { + AZ_Warning("ScriptCanvasBuilder", false, "build overrides missing variable override, Script may not function properly"); + runtimeOverrides.m_variableIndices[index] = false; + } + } + else + { + runtimeOverrides.m_variableIndices[index] = false; + } + } + + for (auto& entity : buildOverrides.m_entityIds) + { + auto& variableId = entity.first; + auto iter = AZStd::find_if(buildOverrides.m_overrides.begin(), buildOverrides.m_overrides.end(), [&variableId](auto& candidate) { return candidate.GetVariableId() == variableId; }); + if (iter != buildOverrides.m_overrides.end()) + { + // the entity was overridden on the instance + if (iter->GetDatum() && iter->GetDatum()->GetAs()) + { + runtimeOverrides.m_entityIds.push_back(*iter->GetDatum()->GetAs()); + } + else + { + AZ_Warning("ScriptCanvasBuilder", false, "build overrides missing EntityId, Script may not function properly"); + runtimeOverrides.m_entityIds.push_back(AZ::EntityId{}); + } + } + else + { + // the entity is overridden, as part of the required process of to instantiation + runtimeOverrides.m_entityIds.push_back(entity.second); + } + } + + for (auto& buildDependency : buildOverrides.m_dependencies) + { + runtimeOverrides.m_dependencies.push_back(ConvertToRuntime(buildDependency)); + } + + return runtimeOverrides; + } + + AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent) + { + EditorAssetTree result; + AZ::Data::AssetInfo assetInfo; + AZStd::string watchFolder; + bool resultFound = false; + + if (!AzToolsFramework::AssetSystemRequestBus::FindFirstHandler()) + { + return AZ::Failure(AZStd::string("LoadEditorAssetTree found no handler for AzToolsFramework::AssetSystemRequestBus.")); + } + + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + (resultFound + , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourceUUID + , editorAssetId.m_guid + , assetInfo + , watchFolder); + + if (!resultFound) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%s.", editorAssetId.ToString().c_str(), assetHint.data())); + } + + AZStd::vector dependentAssets; + + auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + { + if (filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(AZ::Data::AssetId(filterInfo.m_assetId.m_guid, 0)); + } + else if (filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(filterInfo.m_assetId); + } + + return true; + }; + + auto loadAssetOutcome = ScriptCanvasBuilder::LoadEditorAsset(assetInfo.m_relativePath, editorAssetId, filterCB); + if (!loadAssetOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadAssetOutcome.GetError().c_str())); + } + + for (auto& dependentAsset : dependentAssets) + { + auto loadDependentOutcome = LoadEditorAssetTree(dependentAsset, "", &result); + if (!loadDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load dependent graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadDependentOutcome.GetError().c_str())); + } + + result.m_dependencies.push_back(loadDependentOutcome.TakeValue()); + } + + if (parent) + { + result.SetParent(*parent); + } + + result.m_asset = loadAssetOutcome.TakeValue(); + + return AZ::Success(result); + } + + AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree) + { + auto buildEntity = editorAssetTree.m_asset->GetScriptCanvasEntity(); + if (!buildEntity) + { + return AZ::Failure(AZStd::string("No entity from source asset")); + } + + auto variableComponent = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); + if (!variableComponent) + { + return AZ::Failure(AZStd::string("No GraphVariableManagerComponent in source Entity")); + } + + const ScriptCanvas::VariableData* variableData = variableComponent->GetVariableDataConst(); // get this from the entity + if (!variableData) + { + return AZ::Failure(AZStd::string("No variableData in source GraphVariableManagerComponent")); + } + + auto parseOutcome = ScriptCanvasBuilder::ParseGraph(*buildEntity, ""); + if (!parseOutcome.IsSuccess() || !parseOutcome.GetValue()) + { + return AZ::Failure(AZStd::string("graph failed to parse")); + } + + BuildVariableOverrides result; + result.m_source = editorAssetTree.m_asset; + result.PopulateFromParsedResults(parseOutcome.GetValue()->GetRuntimeInputs(), *variableData); + + // recurse... + for (auto& dependentAsset : editorAssetTree.m_dependencies) + { + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + auto parseDependentOutcome = ParseEditorAssetTree(dependentAsset); + if (!parseDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format + ("ParseEditorAssetTree failed to parse dependent graph from %s-%s: %s" + , dependentAsset.m_asset.GetId().ToString().c_str() + , dependentAsset.m_asset.GetHint().c_str() + , parseDependentOutcome.GetError().c_str())); + } + + result.m_dependencies.push_back(parseDependentOutcome.TakeValue()); + } + + return AZ::Success(result); + } + +} diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h new file mode 100644 index 0000000000..ea77b4c9b0 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace ScriptCanvas +{ + namespace Grammar + { + struct ParsedRuntimeInputs; + } +} + +namespace ScriptCanvasEditor +{ + class ScriptCanvasAsset; +} + +namespace ScriptCanvasBuilder +{ + class BuildVariableOverrides + { + public: + AZ_TYPE_INFO(BuildVariableOverrides, "{8336D44C-8EDC-4C28-AEB4-3420D5FD5AE2}"); + AZ_CLASS_ALLOCATOR(BuildVariableOverrides, AZ::SystemAllocator, 0); + + static void Reflect(AZ::ReflectContext* reflectContext); + + void Clear(); + + // use this to preserve old values that may have been overridden on the instance, and are still valid in the parsed graph + void CopyPreviousOverriddenValues(const BuildVariableOverrides& source); + + bool IsEmpty() const; + + // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display + void PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables); + + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. + AZ::Data::Asset m_source; + + // all of the variables here are overrides + AZStd::vector m_variables; + // the values here may or may not be overrides + AZStd::vector> m_entityIds; + // this is all that gets exposed to the edit context + AZStd::vector m_overrides; + // AZStd::vector m_entityIdRuntimeInputIndices; since all of the entity ids need to go in, they may not need indices + AZStd::vector m_dependencies; + }; + + class EditorAssetTree + { + public: + AZ_CLASS_ALLOCATOR(EditorAssetTree, AZ::SystemAllocator, 0); + + EditorAssetTree* m_parent = nullptr; + AZStd::vector m_dependencies; + AZ::Data::Asset m_asset; + + EditorAssetTree* ModRoot(); + + void SetParent(EditorAssetTree& parent); + + AZStd::string ToString(size_t depth = 0) const; + }; + + // copy the variables overridden during editor / prefab build time back to runtime data + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& overrides); + + AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent = nullptr); + + AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree); +} diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index cd7540c663..269c033dd9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +164,8 @@ namespace ScriptCanvasBuilder void PluginComponent::Reflect(AZ::ReflectContext* context) { + BuildVariableOverrides::Reflect(context); + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 2284ba94cf..1c6fc3f2db 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -70,6 +70,7 @@ namespace ScriptCanvasBuilder AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); return; } + AZStd::vector fileBuffer(ioStream.GetLength()); size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); if (bytesRead != ioStream.GetLength()) @@ -87,15 +88,15 @@ namespace ScriptCanvasBuilder { // force load these before processing if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + || filterInfo.m_assetType == azrtti_typeid()) { this->m_processEditorAssetDependencies.push_back(filterInfo); } // these trigger re-processing if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + || filterInfo.m_assetType == azrtti_typeid() + || filterInfo.m_assetType == azrtti_typeid()) { AssetBuilderSDK::SourceFileDependency dependency; dependency.m_sourceFileDependencyUUID = filterInfo.m_assetId.m_guid; @@ -210,7 +211,7 @@ namespace ScriptCanvasBuilder bool pathFound = false; AZStd::string relativePath; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound + (pathFound , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath , request.m_fullPath.c_str(), relativePath); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 4ef20f5fb1..90dfb843b9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -130,10 +130,12 @@ namespace ScriptCanvasBuilder int GetBuilderVersion(); - AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath); + AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB = {}); AZ::Outcome, AZStd::string> LoadEditorFunctionAsset(AZStd::string_view graphPath); + AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath); + AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity); @@ -149,7 +151,7 @@ namespace ScriptCanvasBuilder { public: static AZ::Uuid GetUUID(); - + Worker() = default; Worker(const Worker&) = delete; @@ -175,7 +177,7 @@ namespace ScriptCanvasBuilder // cached on first time query mutable AZStd::string m_fingerprintString; }; - + class FunctionWorker : public AssetBuilderSDK::AssetBuilderCommandBus::Handler { @@ -195,7 +197,7 @@ namespace ScriptCanvasBuilder int GetVersionNumber() const; void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; - + void ShutDown() override {}; private: diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 375b217780..529a611c67 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -17,9 +17,7 @@ #include #include #include - #include - #include #include #include @@ -32,7 +30,6 @@ #include #include #include - #include namespace ScriptCanvasBuilder @@ -62,6 +59,26 @@ namespace ScriptCanvasBuilder } } + AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath) + { + AZStd::string fileNameOnly; + AzFramework::StringFunc::Path::GetFullFileName(graphPath.data(), fileNameOnly); + + ScriptCanvas::Grammar::Request request; + request.graph = PrepareSourceGraph(&buildEntity); + if (!request.graph) + { + return AZ::Failure(AZStd::string("build entity did not have source graph components")); + } + + request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFileAtPrefabTime; + request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModelAtPrefabTime; + request.name = fileNameOnly.empty() ? fileNameOnly : "BuilderGraph"; + request.addDebugInformation = false; + + return ScriptCanvas::Translation::ParseGraph(request); + } + AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath) { AZStd::string fullPath(rawLuaFilePath); @@ -72,7 +89,7 @@ namespace ScriptCanvasBuilder auto sourceGraph = PrepareSourceGraph(buildEntity); ScriptCanvas::Grammar::Request request; - request.assetId = scriptAssetId; + request.scriptAssetId = scriptAssetId; request.graph = sourceGraph; request.name = fileNameOnly; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; @@ -82,7 +99,7 @@ namespace ScriptCanvasBuilder bool pathFound = false; AZStd::string relativePath; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound + (pathFound , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath , fullPath.c_str(), relativePath); @@ -396,7 +413,7 @@ namespace ScriptCanvasBuilder ; } - AZ::Outcome < AZ::Data::Asset, AZStd::string> LoadEditorAsset(AZStd::string_view filePath) + AZ::Outcome < AZ::Data::Asset, AZStd::string> LoadEditorAsset(AZStd::string_view filePath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB) { AZStd::shared_ptr assetDataStream = AZStd::make_shared(); @@ -425,9 +442,9 @@ namespace ScriptCanvasBuilder AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + asset.Create(assetId); - if (editorAssetHandler.LoadAssetData(asset, assetDataStream, AZ::Data::AssetFilterCB{}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + if (editorAssetHandler.LoadAssetData(asset, assetDataStream, assetFilterCB) != AZ::Data::AssetHandler::LoadResult::LoadComplete) { return AZ::Failure(AZStd::string::format("Failed to load ScriptCavas asset: %s", filePath.data())); } @@ -513,10 +530,7 @@ namespace ScriptCanvasBuilder } } - if (buildEntity->GetState() == AZ::Entity::State::Constructed) - { - buildEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(buildEntity); if (buildEntity->GetState() == AZ::Entity::State::Init) { @@ -533,7 +547,7 @@ namespace ScriptCanvasBuilder auto version = sourceGraph->GetVersion(); if (version.grammarVersion == ScriptCanvas::GrammarVersion::Initial - || version.runtimeVersion == ScriptCanvas::RuntimeVersion::Initial) + || version.runtimeVersion == ScriptCanvas::RuntimeVersion::Initial) { return AZ::Failure(AZStd::string(ScriptCanvas::ParseErrors::SourceUpdateRequired)); } @@ -542,7 +556,7 @@ namespace ScriptCanvasBuilder request.path = input.fullPath; request.name = input.fileNameOnly; request.namespacePath = input.namespacePath; - request.assetId = input.assetID; + request.scriptAssetId = input.assetID; request.graph = sourceGraph; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModel; @@ -728,6 +742,6 @@ namespace ScriptCanvasBuilder ScriptCanvas::Translation::Result TranslateToLua(ScriptCanvas::Grammar::Request& request) { request.translationTargetFlags = ScriptCanvas::Translation::TargetFlags::Lua; - return ScriptCanvas::Translation::ParseGraph(request); + return ScriptCanvas::Translation::ParseAndTranslateGraph(request); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index b767a2b52e..56a170f851 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -19,17 +19,16 @@ #include #include #include - #include #include #include +#include #include #include #include #include #include #include -#include #include namespace ScriptCanvasEditor @@ -83,10 +82,11 @@ namespace ScriptCanvasEditor if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(8, &EditorScriptCanvasComponentVersionConverter) + ->Version(10, &EditorScriptCanvasComponentVersionConverter) ->Field("m_name", &EditorScriptCanvasComponent::m_name) ->Field("m_assetHolder", &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder) - ->Field("m_variableData", &EditorScriptCanvasComponent::m_editableData) + ->Field("runtimeDataIsValid", &EditorScriptCanvasComponent::m_runtimeDataIsValid) + ->Field("runtimeDataOverrides", &EditorScriptCanvasComponent::m_variableOverrides) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -103,9 +103,9 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder, "Script Canvas Asset", "Script Canvas asset associated with this component") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_editableData, "Properties", "Script Canvas Graph Properties") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; } } @@ -133,6 +133,11 @@ namespace ScriptCanvasEditor AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); } + const AZStd::string& EditorScriptCanvasComponent::GetName() const + { + return m_name; + } + void EditorScriptCanvasComponent::UpdateName() { AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); @@ -233,81 +238,67 @@ namespace ScriptCanvasEditor EditorComponentBase::Deactivate(); - //EditorScriptCanvasAssetNotificationBus::Handler::BusDisconnect(); EditorScriptCanvasComponentRequestBus::Handler::BusDisconnect(); EditorContextMenuRequestBus::Handler::BusDisconnect(); } - //========================================================================= - void EditorScriptCanvasComponent::BuildGameEntity(AZ::Entity* gameEntity) + void EditorScriptCanvasComponent::BuildGameEntityData() { - AZ::Data::AssetId editorAssetId = m_scriptCanvasAssetHolder.GetAssetId(); + using namespace ScriptCanvasBuilder; - if (!editorAssetId.IsValid()) + m_runtimeDataIsValid = false; + + auto assetTreeOutcome = LoadEditorAssetTree(m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetHint()); + if (!assetTreeOutcome.IsSuccess()) { + AZ_Warning("ScriptCanvas", false, AZStd::string::format("EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()).c_str()); return; } - AZ::Data::AssetId runtimeAssetId(editorAssetId.m_guid, AZ_CRC("RuntimeData", 0x163310ae)); - AZ::Data::Asset runtimeAsset(runtimeAssetId, azrtti_typeid(), {}); - - /* + EditorAssetTree& editorAssetTree = assetTreeOutcome.GetValue(); - This defense against creating useless runtime components is pending changes the slice update system. - It also would require better abilities to check asset integrity when building assets that depend - on ScriptCanvas assets. + auto parseOutcome = ParseEditorAssetTree(editorAssetTree); + if (!parseOutcome.IsSuccess()) + { + AZ_Warning("ScriptCanvas", false, AZStd::string::format("EditorScriptCanvasComponent::BuildGameEntityData failed: %s", parseOutcome.GetError().c_str()).c_str()); + return; + } - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, runtimeAssetId); + auto& variableOverrides = parseOutcome.GetValue(); - if (assetInfo.m_assetType == AZ::Data::s_invalidAssetType) + if (!m_variableOverrides.IsEmpty()) { - AZ_Warning("ScriptCanvas", false, "No ScriptCanvas Runtime Asset information for Entity ('%s' - '%s') Graph ('%s'), asset may be in error or deleted" - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); - return; + variableOverrides.CopyPreviousOverriddenValues(m_variableOverrides); } - AzFramework::AssetSystem::AssetStatus statusResult = AzFramework::AssetSystem::AssetStatus_Unknown; - AzFramework::AssetSystemRequestBus::BroadcastResult(statusResult, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById, runtimeAssetId); + m_variableOverrides = parseOutcome.TakeValue(); + m_runtimeDataIsValid = true; + } - if (statusResult != AzFramework::AssetSystem::AssetStatus_Compiled) + void EditorScriptCanvasComponent::BuildGameEntity(AZ::Entity* gameEntity) + { + if (!m_runtimeDataIsValid) { - AZ_Warning("ScriptCanvas", false, "No ScriptCanvas Runtime Asset for Entity ('%s' - '%s') Graph ('%s'), compilation may have failed or not completed" - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); + // this is fine, there could have been no graph set, or set to a graph that failed to compile return; } - */ - // #functions2 dependency-ctor-args make recursive - auto executionComponent = gameEntity->CreateComponent(runtimeAsset); - ScriptCanvas::VariableData varData; + // build everything again as a sanity check against dependencies. All of the variable overrides that were valid will be copied over + BuildGameEntityData(); - for (const auto& varConfig : m_editableData.GetVariables()) + if (!m_runtimeDataIsValid) { - if (varConfig.m_graphVariable.GetDatum()->Empty()) - { - AZ_Error("ScriptCanvas", false, "Data loss detected for GraphVariable ('%s') on Entity ('%s' - '%s') Graph ('%s')" - , varConfig.m_graphVariable.GetVariableName().data() - , gameEntity->GetName().c_str() - , GetEntityId().ToString().c_str() - , GetName().c_str()); - } - else - { - varData.AddVariable(varConfig.m_graphVariable.GetVariableName(), varConfig.m_graphVariable); - } + AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s", m_scriptCanvasAssetHolder.GetAssetId().ToString().c_str()); + return; } - executionComponent->SetVariableOverrides(varData); + auto runtimeComponent = gameEntity->CreateComponent(); + auto runtimeOverrides = ConvertToRuntime(m_variableOverrides); + runtimeComponent->SetRuntimeDataOverrides(runtimeOverrides); } void EditorScriptCanvasComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) { - // If we removed out asset due to the catalog removing. Just set it back. if (m_removedCatalogId == assetId) { if (!m_scriptCanvasAssetHolder.GetAssetId().IsValid()) @@ -317,12 +308,9 @@ namespace ScriptCanvasEditor } } } - void EditorScriptCanvasComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& removedAssetId, const AZ::Data::AssetInfo& /*assetInfo*/) { AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - - // If the Asset gets removed from disk while the Editor is loaded clear out the asset reference. if (assetId == removedAssetId) { m_removedCatalogId = assetId; @@ -355,8 +343,6 @@ namespace ScriptCanvasEditor } } - AzToolsFramework::ScopedUndoBatch undo("Update Entity With New SC Graph"); - AzToolsFramework::ToolsApplicationRequests::Bus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::Bus::Events::AddDirtyEntity, GetEntityId()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } @@ -448,7 +434,6 @@ namespace ScriptCanvasEditor { // Invalidate the previously removed catalog id if we are setting a new asset id m_removedCatalogId.SetInvalid(); - SetPrimaryAsset(assetId); } } @@ -469,125 +454,17 @@ namespace ScriptCanvasEditor { if (memoryAsset->GetFileAssetId() == m_scriptCanvasAssetHolder.GetAssetId()) { - LoadVariables(memoryAsset); + auto assetData = memoryAsset->GetAsset(); + AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); + AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); + BuildGameEntityData(); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); UpdateName(); } } - /*! Start Variable Block Implementation */ - void EditorScriptCanvasComponent::AddVariable(AZStd::string_view varName, const ScriptCanvas::GraphVariable& graphVariable) - { - // We only add component properties to the component - if (!graphVariable.IsComponentProperty()) - { - return; - } - - const auto& variableId = graphVariable.GetVariableId(); - ScriptCanvas::EditableVariableConfiguration* originalVarNameValuePair = m_editableData.FindVariable(variableId); - if (!originalVarNameValuePair) - { - m_editableData.AddVariable(varName, graphVariable); - originalVarNameValuePair = m_editableData.FindVariable(variableId); - } - - if (!originalVarNameValuePair) - { - AZ_Error("Script Canvas", false, "Unable to find variable with id %s and name %s on the ScriptCanvas Component. There is an issue in AddVariable", - variableId.ToString().data(), varName.data()); - return; - } - - // Update the variable name as it may have changed - originalVarNameValuePair->m_graphVariable.SetVariableName(varName); - originalVarNameValuePair->m_graphVariable.SetExposureCategory(graphVariable.GetExposureCategory()); - originalVarNameValuePair->m_graphVariable.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); - originalVarNameValuePair->m_graphVariable.SetAllowSignalOnChange(false); - } - - void EditorScriptCanvasComponent::AddNewVariables(const ScriptCanvas::VariableData& graphVarData) - { - for (auto&& variablePair : graphVarData.GetVariables()) - { - AddVariable(variablePair.second.GetVariableName(), variablePair.second); - } - } - - void EditorScriptCanvasComponent::RemoveVariable(const ScriptCanvas::VariableId& varId) - { - m_editableData.RemoveVariable(varId); - } - - void EditorScriptCanvasComponent::RemoveOldVariables(const ScriptCanvas::VariableData& graphVarData) - { - AZStd::vector oldVariableIds; - for (auto varConfig : m_editableData.GetVariables()) - { - const auto& variableId = varConfig.m_graphVariable.GetVariableId(); - - // We only add component sourced graph properties to the script canvas component, so if this variable was switched to a graph-only property remove it. - // Also be sure to remove this variable if it's been deleted entirely. - auto graphVariable = graphVarData.FindVariable(variableId); - if (!graphVariable || !graphVariable->IsComponentProperty()) - { - oldVariableIds.push_back(variableId); - } - } - - for (const auto& oldVariableId : oldVariableIds) - { - RemoveVariable(oldVariableId); - } - } - - bool EditorScriptCanvasComponent::UpdateVariable(const ScriptCanvas::GraphVariable& graphDatum, ScriptCanvas::GraphVariable& updateDatum, ScriptCanvas::GraphVariable& originalDatum) - { - // If the editable datum is the different than the original datum, then the "variable value" has been overridden on this component - - // Variable values only propagate from the Script Canvas graph to this component if the original "variable value" has not been overridden - // by the editable "variable value" on this component and the "variable value" on the graph is different than the variable value on this component - auto isNotOverridden = (*updateDatum.GetDatum()) == (*originalDatum.GetDatum()); - auto scGraphIsModified = (*originalDatum.GetDatum()) != (*graphDatum.GetDatum()); - - if (isNotOverridden && scGraphIsModified) - { - ScriptCanvas::ModifiableDatumView originalDatumView; - originalDatum.ConfigureDatumView(originalDatumView); - - originalDatumView.AssignToDatum((*graphDatum.GetDatum())); - - - ScriptCanvas::ModifiableDatumView updatedDatumView; - updateDatum.ConfigureDatumView(updatedDatumView); - - updatedDatumView.AssignToDatum((*graphDatum.GetDatum())); - - return true; - } - return false; - } - - void EditorScriptCanvasComponent::LoadVariables(const ScriptCanvasMemoryAsset::pointer memoryAsset) - { - auto assetData = memoryAsset->GetAsset(); - - AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); - - auto variableComponent = scriptCanvasEntity ? AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity) : nullptr; - if (variableComponent) - { - // Add properties from the SC Asset to the SC Component if they do not exist on the SC Component - AddNewVariables(*variableComponent->GetVariableData()); - RemoveOldVariables(*variableComponent->GetVariableData()); - } - - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } - void EditorScriptCanvasComponent::ClearVariables() { - m_editableData.Clear(); + m_variableOverrides.Clear(); } - /* End Variable Block Implementation*/ } diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h index fbb6829a4f..da4335526f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -19,8 +19,15 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - using LoadedInterpretedDependencies = AZStd::vector>; - AZ_INLINE LoadedInterpretedDependencies LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet); + struct LoadedInterpretedDependency + { + AZStd::string path; + AZ::Data::Asset runtimeAsset; + ScriptCanvas::Translation::LuaAssetResult luaAssetResult; + AZStd::vector dependencies; + }; + + AZ_INLINE AZStd::vector LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet); AZ_INLINE LoadTestGraphResult LoadTestGraph(AZStd::string_view path); @@ -49,10 +56,11 @@ namespace ScriptCanvasEditor AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporter& reporter); AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, LoadTestGraphResult& loadGraphResult, Reporter& reporter); AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporters& reporters); - + AZ_INLINE void Simulate(const DurationSpec& duration); AZ_INLINE void SimulateDuration(const DurationSpec& duration); AZ_INLINE void SimulateSeconds(const DurationSpec& duration); AZ_INLINE void SimulateTicks(const DurationSpec& duration); } // ScriptCanvasEditor + #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index bb40575367..298c881575 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -26,9 +26,25 @@ namespace ScriptCanvasEditor { using namespace ScriptCanvas; - AZ_INLINE LoadedInterpretedDependencies LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet) + // The runtime context (appropriately) always assumes that EntityIds are overridden, this step copies the values from the runtime data + // over to the override data to simulate build step that does this when building prefabs + AZ_INLINE void CopyAssetEntityIdsToOverrides(RuntimeDataOverrides& runtimeDataOverrides) { - LoadedInterpretedDependencies loadedAssets; + runtimeDataOverrides.m_entityIds.reserve(runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds.size()); + for (auto& varEntityPar : runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds) + { + runtimeDataOverrides.m_entityIds.push_back(varEntityPar.second); + } + + for (auto& dependency : runtimeDataOverrides.m_dependencies) + { + CopyAssetEntityIdsToOverrides(dependency); + } + } + + AZ_INLINE AZStd::vector LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet) + { + AZStd::vector loadedAssets; if (!dependencySet.empty()) { @@ -41,7 +57,7 @@ namespace ScriptCanvasEditor AZ_Assert(namespacePath.size() >= 3, "This functions assumes unit test dependencies are in the ScriptCanvas gem unit test folder"); AZStd::string originalPath = namespacePath[2].data(); - + for (size_t index = 3; index < namespacePath.size(); ++index) { originalPath += "/"; @@ -52,11 +68,11 @@ namespace ScriptCanvasEditor { originalPath.resize(originalPath.size() - AZStd::string_view(Grammar::k_internalRuntimeSuffix).size()); } - + AZStd::string path = AZStd::string::format("%s/%s.scriptcanvas", k_unitTestDirPathRelative, originalPath.data()); LoadTestGraphResult loadResult = LoadTestGraph(path); AZ_Assert(loadResult.m_runtimeAsset, "failed to load dependent asset"); - + AZ::Outcome luaAssetOutcome = AZ::Failure(AZStd::string("lua asset creation for function failed")); ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_graphPath); AZ_Assert(luaAssetOutcome.IsSuccess(), "failed to create Lua asset"); @@ -69,8 +85,9 @@ namespace ScriptCanvasEditor } const ScriptCanvas::Translation::LuaAssetResult& luaAssetResult = luaAssetOutcome.GetValue(); - loadedAssets.push_back({ modulePath, luaAssetResult }); - } + // #functions2_recursive_unit_tests + loadedAssets.push_back({ modulePath, loadResult.m_runtimeAsset, luaAssetResult, {} }); + } } return loadedAssets; @@ -182,7 +199,7 @@ namespace ScriptCanvasEditor RuntimeData runtimeDataBuffer; AZStd::vector dependencyDataBuffer; - LoadedInterpretedDependencies dependencies; + AZStd::vector dependencies; if (runGraphSpec.runSpec.execution == ExecutionMode::Interpreted) { @@ -202,9 +219,12 @@ namespace ScriptCanvasEditor { dependencies = LoadInterpretedDepencies(luaAssetResult.m_dependencies.source.userSubgraphs); + RuntimeDataOverrides runtimeDataOverrides; + runtimeDataOverrides.m_runtimeAsset = loadResult.m_runtimeAsset; + if (!dependencies.empty()) { - // eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework + // #functions2_recursive_unit_tests eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework // in order to test functionality with a dependency stack greater than 2 // load all script assets, and their dependencies, initialize statics on all those dependencies if it is the first time loaded @@ -215,7 +235,7 @@ namespace ScriptCanvasEditor for (auto& dependency : dependencies) { - inMemoryModules.emplace_back(dependency.first, dependency.second.m_scriptAsset); + inMemoryModules.emplace_back(dependency.path, dependency.luaAssetResult.m_scriptAsset); } AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::UseInMemoryRequireHook, inMemoryModules, AZ::ScriptContextIds::DefaultScriptContextId); @@ -224,7 +244,11 @@ namespace ScriptCanvasEditor for (size_t index = 0; index < dependencies.size(); ++index) { auto& dependency = dependencies[index]; - const ScriptCanvas::Translation::LuaAssetResult& depencyAssetResult = dependency.second; + const ScriptCanvas::Translation::LuaAssetResult& depencyAssetResult = dependency.luaAssetResult; + + RuntimeDataOverrides dependencyRuntimeDataOverrides; + dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; + runtimeDataOverrides.m_dependencies.push_back(dependencyRuntimeDataOverrides); RuntimeData& dependencyData = dependencyDataBuffer[index]; dependencyData.m_input = depencyAssetResult.m_runtimeInputs; @@ -239,7 +263,9 @@ namespace ScriptCanvasEditor loadResult.m_runtimeAsset.Get()->GetData().m_script = loadResult.m_scriptAsset; loadResult.m_runtimeAsset.Get()->GetData().m_input = luaAssetResult.m_runtimeInputs; loadResult.m_runtimeAsset.Get()->GetData().m_debugMap = luaAssetResult.m_debugMap; - loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(loadResult.m_runtimeAsset); + loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(); + CopyAssetEntityIdsToOverrides(runtimeDataOverrides); + loadResult.m_runtimeComponent->SetRuntimeDataOverrides(runtimeDataOverrides); Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->GetData()); Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->GetData()); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index c3f500c3cc..5746ece85d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -8,14 +8,14 @@ #pragma once #include +#include #include - +#include #include #include #include +#include #include -#include -#include namespace ScriptCanvasEditor { @@ -27,11 +27,10 @@ namespace ScriptCanvasEditor which it uses to maintain the asset data in memory. Therefore removing an open ScriptCanvasAsset from the file system will remove the reference from the EditorScriptCanvasComponent, but not the reference from the MainWindow allowing the ScriptCanvas graph to still be modified while open - Finally per graph instance variables values are stored on the EditorScriptCanvasComponent and injected into the runtime ScriptCanvas component in BuildGameEntity */ class EditorScriptCanvasComponent - : public AzToolsFramework::Components::EditorComponentBase + : public AzToolsFramework::Components::EditorComponentBase , private EditorContextMenuRequestBus::Handler , private AzFramework::AssetCatalogEventBus::Handler , private EditorScriptCanvasComponentLoggingBus::Handler @@ -54,7 +53,6 @@ namespace ScriptCanvasEditor void Deactivate() override; //===================================================================== - //===================================================================== // EditorComponentBase void BuildGameEntity(AZ::Entity* gameEntity) override; @@ -71,10 +69,10 @@ namespace ScriptCanvasEditor void CloseGraph(); void SetName(const AZStd::string& name) { m_name = name; } - const AZStd::string& GetName() const { return m_name; }; + const AZStd::string& GetName() const; AZ::EntityId GetEditorEntityId() const { return GetEntity() ? GetEntityId() : AZ::EntityId(); } AZ::NamedEntityId GetNamedEditorEntityId() const { return GetEntity() ? GetNamedEntityId() : AZ::NamedEntityId(); } - + //===================================================================== // EditorScriptCanvasComponentRequestBus void SetAssetId(const AZ::Data::AssetId& assetId) override; @@ -119,12 +117,8 @@ namespace ScriptCanvasEditor (void)incompatible; } - //===================================================================== - // AssetCatalogEventBus void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override; - //===================================================================== - void OnScriptCanvasAssetChanged(AZ::Data::AssetId assetId); void UpdateName(); @@ -133,21 +127,15 @@ namespace ScriptCanvasEditor void OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer asset); //===================================================================== - void AddVariable(AZStd::string_view varName, const ScriptCanvas::GraphVariable& varDatum); - void AddNewVariables(const ScriptCanvas::VariableData& graphVarData); - void RemoveVariable(const ScriptCanvas::VariableId& varId); - void RemoveOldVariables(const ScriptCanvas::VariableData& graphVarData); - bool UpdateVariable(const ScriptCanvas::GraphVariable& graphDatum, ScriptCanvas::GraphVariable& updateDatum, ScriptCanvas::GraphVariable& originalDatum); - void LoadVariables(const ScriptCanvasMemoryAsset::pointer memoryAsset); + void BuildGameEntityData(); void ClearVariables(); private: AZ::Data::AssetId m_removedCatalogId; AZ::Data::AssetId m_previousAssetId; - AZStd::string m_name; ScriptCanvasAssetHolder m_scriptCanvasAssetHolder; - - ScriptCanvas::EditableVariableData m_editableData; + bool m_runtimeDataIsValid = false; + ScriptCanvasBuilder::BuildVariableOverrides m_variableOverrides; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp index f036835618..634eee5b17 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -289,7 +289,7 @@ namespace ScriptCanvasEditor void LoggingDataAggregator::OnRegistrationDisabled(const AZ::NamedEntityId&, const ScriptCanvas::GraphIdentifier&) { - + } void LoggingDataAggregator::ResetLog() @@ -324,7 +324,7 @@ namespace ScriptCanvasEditor m_hasAnchor = false; m_anchorTimeStamp = ScriptCanvas::Timestamp(0); } - + void LoggingDataAggregator::RegisterScriptCanvas(const AZ::NamedEntityId& entityId, const ScriptCanvas::GraphIdentifier& graphIdentifier) { bool foundMatch = false; @@ -335,7 +335,7 @@ namespace ScriptCanvasEditor if (mapIter->second == graphIdentifier) { foundMatch = true; - AZ_Error("ScriptCanvas", false, "Received a duplicated registration callback."); + AZ_Warning("ScriptCanvas", false, "Received a duplicated registration callback."); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp index a675a62788..b9dd45555b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -15,17 +15,28 @@ namespace ScriptCanvasRuntimeAssetCpp { AddDependencies = 3, ChangeScriptRequirementToAsset, - // add your entry above + + // add description above Current }; + enum class RuntimeDataOverridesVersion : unsigned int + { + Initial = 0, + AddRuntimeAsset, + + // add description above + Current, + }; + enum class FunctionRuntimeDataVersion { MergeBackEnd2dotZero, AddSubgraphInterface, RemoveLegacyData, RemoveConnectionToRuntimeData, - // add your entry above + + // add description above Current }; } @@ -87,9 +98,9 @@ namespace ScriptCanvas { return data.m_input.GetConstructorParameterCount() != 0 || AZStd::any_of(data.m_requiredAssets.begin(), data.m_requiredAssets.end(), [](const AZ::Data::Asset& asset) - { - return RequiresDependencyConstructionParametersRecurse(asset.Get()->m_runtimeData); - }); + { + return RequiresDependencyConstructionParametersRecurse(asset.Get()->m_runtimeData); + }); } bool RuntimeData::RequiresStaticInitialization() const @@ -97,6 +108,80 @@ namespace ScriptCanvas return !m_cloneSources.empty(); } + bool RuntimeDataOverrides::IsPreloadBehaviorEnforced(const RuntimeDataOverrides& overrides) + { + if (overrides.m_runtimeAsset.GetAutoLoadBehavior() != AZ::Data::AssetLoadBehavior::PreLoad) + { + return false; + } + + for (auto& dependency : overrides.m_dependencies) + { + if (!IsPreloadBehaviorEnforced(dependency)) + { + return false; + } + } + + return true; + } + + void RuntimeDataOverrides::EnforcePreloadBehavior() + { + m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); + + for (auto& dependency : m_dependencies) + { + dependency.EnforcePreloadBehavior(); + } + } + + void RuntimeDataOverrides::Reflect(AZ::ReflectContext* context) + { + RuntimeVariable::Reflect(context); + + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataOverridesVersion::Current)) + ->Field("runtimeAsset", &RuntimeDataOverrides::m_runtimeAsset) + ->Field("variables", &RuntimeDataOverrides::m_variables) + ->Field("variableIndices", &RuntimeDataOverrides::m_variableIndices) + ->Field("entityIds", &RuntimeDataOverrides::m_entityIds) + ->Field("dependencies", &RuntimeDataOverrides::m_dependencies) + ; + } + } + + RuntimeVariable::RuntimeVariable(const AZStd::any& source) + : value(source) + { + } + + RuntimeVariable::RuntimeVariable(AZStd::any&& source) + : value(AZStd::move(source)) + { + } + + void RuntimeVariable::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Field("value", &RuntimeVariable::value) + ; + + if (auto editContext = serializeContext->GetEditContext()) + { + editContext->Class("RuntimeVariable", "RuntimeVariable") + ->DataElement(AZ::Edit::UIHandlers::Default, &RuntimeVariable::value, "value", "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) + ; + } + } + } //////////////////////// // SubgraphInterfaceData @@ -118,7 +203,7 @@ namespace ScriptCanvas { *this = AZStd::move(other); } - + SubgraphInterfaceData& SubgraphInterfaceData::operator=(SubgraphInterfaceData&& other) { if (this != &other) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h index fd746f947d..318fd0790a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,7 @@ namespace ScriptCanvas { class RuntimeAsset; + struct RuntimeVariable; class RuntimeAssetDescription : public AssetDescription { @@ -41,7 +43,7 @@ namespace ScriptCanvas "Script Canvas Runtime", "Script Canvas Runtime", "Icons/ScriptCanvas/Viewport/ScriptCanvas.png", - AZ::Color(1.0f,0.0f,0.0f,1.0f), + AZ::Color(1.0f, 0.0f, 0.0f, 1.0f), false ) {} @@ -82,6 +84,24 @@ namespace ScriptCanvas bool static RequiresDependencyConstructionParametersRecurse(const RuntimeData& data); }; + struct RuntimeDataOverrides + { + AZ_TYPE_INFO(RuntimeDataOverrides, "{CE3C0AE6-4EBA-43B2-B2D5-7AC24A194E63}"); + AZ_CLASS_ALLOCATOR(RuntimeDataOverrides, AZ::SystemAllocator, 0); + + static bool IsPreloadBehaviorEnforced(const RuntimeDataOverrides& overrides); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZ::Data::Asset m_runtimeAsset; + AZStd::vector m_variables; + AZStd::vector m_variableIndices; + AZStd::vector m_entityIds; + AZStd::vector m_dependencies; + + void EnforcePreloadBehavior(); + }; + class RuntimeAssetBase : public AZ::Data::AssetData { @@ -94,7 +114,6 @@ namespace ScriptCanvas { } - }; template class RuntimeAssetTyped @@ -165,7 +184,7 @@ namespace ScriptCanvas "Script Canvas Function Interface", "Script Canvas Function Interface", "Icons/ScriptCanvas/Viewport/ScriptCanvas_Function.png", - AZ::Color(1.0f,0.0f,0.0f,1.0f), + AZ::Color(1.0f, 0.0f, 0.0f, 1.0f), false ) {} @@ -207,6 +226,6 @@ namespace ScriptCanvas static const char* GetFileExtension() { return "scriptcanvas_fn_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_fn_compiled"; } - friend class SubgraphInterfaceAssetHandler; + friend class SubgraphInterfaceAssetHandler; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index a79c58ea32..a6e02e796f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -1,12 +1,12 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include +#include #include #include #include @@ -17,6 +17,33 @@ namespace ScriptCanvas { + ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) + : m_buildEntity(buildEntity) + , m_wasAdded(false) + { + if (AZ::Interface::Get() != nullptr) + { + AZ::Interface::Get()->RemoveEntity(buildEntity); + } + + if (buildEntity->GetState() == AZ::Entity::State::Constructed) + { + buildEntity->Init(); + m_wasAdded = true; + } + } + + ScopedAuxiliaryEntityHandler::~ScopedAuxiliaryEntityHandler() + { + if (!m_wasAdded) + { + if (AZ::Interface::Get() != nullptr) + { + AZ::Interface::Get()->AddEntity(m_buildEntity); + } + } + } + bool IsNamespacePathEqual(const NamespacePath& lhs, const NamespacePath& rhs) { if (lhs.size() != rhs.size()) @@ -128,4 +155,3 @@ namespace ScriptCanvas runtimeVersion = RuntimeVersion::Current; } } - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 78e51ddbb0..4f76e84775 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,7 @@ namespace AZ { class Entity; class ReflectContext; - + template bool ReadAttribute(t_Attribute& resultOut, AttributeId id, const t_Container& attributes) { @@ -41,7 +42,7 @@ namespace ScriptCanvas // The actual value in each location initialized to GraphOwnerId is populated with the owning entity at editor-time, Asset Processor-time, or runtime, as soon as the owning entity is known. using GraphOwnerIdType = AZ::EntityId; static const GraphOwnerIdType GraphOwnerId = AZ::EntityId(0xacedc0de); - + // A place holder identifier for unique runtime graph on Entity that is running more than one instance of the same graph. // This allows multiple instances of the same graph to be addressed individually on the same entity. // The actual value in each location initialized to UniqueId is populated at run-time. @@ -52,7 +53,7 @@ namespace ScriptCanvas constexpr const char* k_OnVariableWriteEventName = "OnVariableValueChanged"; constexpr const char* k_OnVariableWriteEbusName = "VariableNotification"; - + class Node; class Edge; @@ -195,7 +196,7 @@ namespace ScriptCanvas using PropertyFields = AZStd::vector>; - using NamedActiveEntityId = AZ::NamedEntityId; + using NamedActiveEntityId = AZ::NamedEntityId; using NamedNodeId = NamedId; using NamedSlotId = NamedId; @@ -204,7 +205,26 @@ namespace ScriptCanvas using EBusBusId = AZ::Crc32; using ScriptCanvasId = AZ::EntityId; enum class AzEventIdentifier : size_t {}; - + + struct RuntimeVariable + { + AZ_TYPE_INFO(RuntimeVariable, "{6E969359-5AF5-4ECA-BE89-A96AB30A624E}"); + AZ_CLASS_ALLOCATOR(RuntimeVariable, AZ::SystemAllocator, 0); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZStd::any value; + + RuntimeVariable() = default; + RuntimeVariable(const RuntimeVariable&) = default; + RuntimeVariable(RuntimeVariable&&) = default; + explicit RuntimeVariable(const AZStd::any& source); + explicit RuntimeVariable(AZStd::any&& source); + + RuntimeVariable& operator=(const RuntimeVariable&) = default; + RuntimeVariable& operator=(RuntimeVariable&&) = default; + }; + struct NamespacePathHasher { AZ_FORCE_INLINE size_t operator()(const NamespacePath& path) const @@ -245,6 +265,17 @@ namespace ScriptCanvas }; using ScriptCanvasSettingsRequestBus = AZ::EBus; + + class ScopedAuxiliaryEntityHandler + { + public: + ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity); + ~ScopedAuxiliaryEntityHandler(); + + private: + bool m_wasAdded = false; + AZ::Entity* m_buildEntity = nullptr; + }; } namespace AZStd diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp index d51fc0038e..3c70031af0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -17,15 +17,55 @@ #include #include - #include #include "DatumBus.h" namespace DatumHelpers { + enum Version + { + JSONSerializerSupport = 6, + + // label your entry above + Current + }; + using namespace ScriptCanvas; - + + bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootDataElementNode) + { + if (rootDataElementNode.GetVersion() <= Version::JSONSerializerSupport) + { + auto storageElementIndex = rootDataElementNode.FindElement(AZ_CRC_CE("m_datumStorage")); + if (storageElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: 'm_datumStorage' was missing."); + return false; + } + + auto& storageElement = rootDataElementNode.GetSubElement(storageElementIndex); + + AZStd::any previousStorage; + if (!storageElement.GetData(previousStorage)) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: Could not retrieve old version of 'm_datumStorage'."); + return false; + } + + rootDataElementNode.RemoveElement(storageElementIndex); + + RuntimeVariable newStorage(previousStorage); + if (!rootDataElementNode.AddElementWithData(context, "m_datumStorage", newStorage)) + { + AZ_Error("ScriptCanvas", false, "Datum Version conversion failed: Could not add new version of 'm_datumStorage'."); + return false; + } + } + + return true; + } + template struct ImplicitConversionHelp { @@ -129,7 +169,7 @@ namespace DatumHelpers return true; } - + AZ_FORCE_INLINE bool ConvertImplicitlyCheckedVector3(const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { const AZ::Vector3& sourceVector = *reinterpret_cast(source); @@ -246,10 +286,10 @@ namespace DatumHelpers ? Data::IsVectorType(type.GetAZType()) : Data::IsVectorType(type); } - + AZ_FORCE_INLINE Data::eType GetVectorType(const Data::Type& type) { - return type.GetType() == Data::eType::BehaviorContextObject + return type.GetType() == Data::eType::BehaviorContextObject ? Data::FromAZType(type.GetAZType()).GetType() : type.GetType(); } @@ -257,7 +297,7 @@ namespace DatumHelpers AZ_FORCE_INLINE bool ConvertImplicitlyCheckedVector(const Data::Type& sourceType, const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { const Data::eType sourceVectorType = GetVectorType(sourceType); - + switch (sourceVectorType) { case Data::eType::Vector2: @@ -277,9 +317,9 @@ namespace DatumHelpers AZ_Assert ( (a.GetType() == Data::eType::BehaviorContextObject && Data::IsAutoBoxedType(b)) - || + || (b.GetType() == Data::eType::BehaviorContextObject && Data::IsAutoBoxedType(a)) - , "these types are not convertible, or need no conversion."); + , "these types are not convertible, or need no conversion."); return a.GetType() == Data::eType::BehaviorContextObject ? b.GetType() : a.GetType(); } @@ -287,15 +327,15 @@ namespace DatumHelpers AZ_FORCE_INLINE bool ConvertImplicitlyChecked(const Data::Type& sourceType, const void* source, const Data::Type& targetType, AZStd::any& target, const AZ::BehaviorClass* targetClass) { AZ_Assert(!targetType.IS_A(sourceType), "Bad use of conversion, target type IS-A source type"); - + if (IsAnyVectorType(sourceType) && IsAnyVectorType(targetType)) { return ConvertImplicitlyCheckedVector(sourceType, source, targetType, target, targetClass); - } + } else if (Data::IsConvertible(sourceType, targetType)) { auto conversionType = GetMathConversionType(targetType, sourceType); - + switch (conversionType) { case Data::eType::AABB: @@ -323,7 +363,7 @@ namespace DatumHelpers return false; } - + template AZ_INLINE bool FromBehaviorContext(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { @@ -339,7 +379,7 @@ namespace DatumHelpers return false; } - + AZ_INLINE bool FromBehaviorContextAABB(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { return FromBehaviorContext(typeID, source, destination); @@ -364,7 +404,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + AZ_INLINE bool FromBehaviorContextEntityID(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { return FromBehaviorContext(typeID, source, destination); @@ -443,7 +483,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + AZ_INLINE bool FromBehaviorContextVector2(const AZ::Uuid& typeID, const void* source, AZStd::any& destination) { AZ::Vector2* target = AZStd::any_cast(&destination); @@ -532,7 +572,7 @@ namespace DatumHelpers { return FromBehaviorContext(typeID, source, destination); } - + template AZ_INLINE bool IsDataEqual(const void* lhs, const void* rhs) { @@ -952,7 +992,7 @@ namespace DatumHelpers { return ToBehaviorContext(valueOut, typeIDOut, valueIn); } - + AZ_INLINE bool ToBehaviorContextString(AZ::BehaviorValueParameter& destination, const void* valueIn) { if (Data::IsString(destination.m_typeId)) @@ -1006,7 +1046,7 @@ namespace DatumHelpers vector4out->SetY(vector2in->GetY()); return true; } - + return false; } @@ -1029,7 +1069,7 @@ namespace DatumHelpers *reinterpret_cast(valueOut) = AZ::Vector4::CreateFromVector3(*vector3in); return true; } - + return false; } @@ -1052,7 +1092,7 @@ namespace DatumHelpers *reinterpret_cast(valueOut) = *vector4in; return true; } - + return false; } @@ -1060,7 +1100,7 @@ namespace DatumHelpers { const AZ::Uuid& typeIDOut = destination.m_typeId; void* valueOut = destination.GetValueAddress(); - + if (valueIn) { switch (typeIn.GetType()) @@ -1128,7 +1168,7 @@ namespace DatumHelpers AZ::BehaviorValueParameter parameter; parameter.m_typeId = description.m_typeId; parameter.m_name = name.data(); - + if (description.m_traits & AZ::BehaviorParameter::TR_POINTER) { pointer = value; @@ -1153,7 +1193,7 @@ namespace DatumHelpers if (parameterDesc.m_typeId == azrtti_typeid() && (parameterDesc.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_CONST))) { - AZStd::string_view parameterString = *reinterpret_cast(source); + AZStd::string_view parameterString = *reinterpret_cast(source); return AZ::Success(AZStd::string(parameterString)); } else if (parameterDesc.m_typeId == azrtti_typeid()) @@ -1161,7 +1201,7 @@ namespace DatumHelpers const AZStd::string_view* parameterString = nullptr; if (parameterDesc.m_traits & AZ::BehaviorParameter::TR_POINTER) { - parameterString = *reinterpret_cast(source); + parameterString = *reinterpret_cast(source); } else { @@ -1209,7 +1249,7 @@ namespace ScriptCanvas { Initialize(type, originality, source, sourceTypeID); } - + Datum::Datum(const AZStd::string& behaviorClassName, eOriginality originality) : Datum(Data::FromAZType(AZ::BehaviorContextHelper::GetClassType(behaviorClassName)), originality, nullptr, AZ::Uuid::CreateNull()) { @@ -1227,12 +1267,12 @@ namespace ScriptCanvas Datum::Datum(const AZ::BehaviorValueParameter& value) : Datum(value, - !(value.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy, + !(value.m_traits& (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy, value.m_value) { } - void Datum::ReconfigureDatumTo(Datum&& datum) + void Datum::ReconfigureDatumTo(Datum&& datum) { bool isOverloadedStorage = datum.m_isOverloadedStorage; @@ -1258,7 +1298,7 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = source.m_class; m_type = source.m_type; - + if (!Data::IsValueType(m_type)) { AZ::BehaviorContext* behaviorContext = nullptr; @@ -1268,15 +1308,15 @@ namespace ScriptCanvas if (classIter != behaviorContext->m_typeToClassMap.end()) { - BehaviorContextObjectPtr sourceObjectPtr = (*AZStd::any_cast(&source.m_storage)); + BehaviorContextObjectPtr sourceObjectPtr = (*AZStd::any_cast(&source.m_storage.value)); BehaviorContextObjectPtr newObjectPtr = sourceObjectPtr->CloneObject((*classIter->second)); - m_storage = AZStd::move(newObjectPtr); - BehaviorContextObjectPtr newSourceObjectPtr = (*AZStd::any_cast(&m_storage)); + m_storage.value = AZStd::move(newObjectPtr); + BehaviorContextObjectPtr newSourceObjectPtr = (*AZStd::any_cast(&m_storage.value)); } } else { - m_storage = source.m_storage; + m_storage.value = source.m_storage.value; m_conversionStorage = source.m_conversionStorage; } @@ -1303,7 +1343,7 @@ namespace ScriptCanvas { AZ::AttributeReader operatorAttrReader(nullptr, operatorAttr); AZ::Script::Attributes::OperatorType methodAttribute{}; - + if (operatorAttrReader.Read(methodAttribute) && methodAttribute == operatorType && method->HasResult() @@ -1314,16 +1354,16 @@ namespace ScriptCanvas AZ::BehaviorValueParameter result(&comparisonResult); AZStd::array params; AZ::Outcome lhsArgument = lhs.ToBehaviorValueParameter(*method->GetArgument(0)); - + if (lhsArgument.IsSuccess() && lhsArgument.GetValue().m_value) { params[0].Set(lhsArgument.GetValue()); AZ::Outcome rhsArgument = rhs.ToBehaviorValueParameter(*method->GetArgument(1)); - + if (rhsArgument.IsSuccess() && rhsArgument.GetValue().m_value) { params[1].Set(rhsArgument.GetValue()); - + if (method->Call(params.data(), aznumeric_caster(params.size()), &result)) { return AZ::Success(comparisonResult); @@ -1339,7 +1379,7 @@ namespace ScriptCanvas void Datum::Clear() { - m_storage.clear(); + m_storage.value.clear(); m_class = nullptr; m_type = Data::Type::Invalid(); } @@ -1352,12 +1392,12 @@ namespace ScriptCanvas { if (m_pointer) { - DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, m_pointer, m_storage); + DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, m_pointer, m_storage.value); } } else { - DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, reinterpret_cast(&m_conversionStorage), m_storage); + DatumHelpers::FromBehaviorContextNumber(resultType.m_typeId, reinterpret_cast(&m_conversionStorage), m_storage.value); } } else if (IS_A(Data::Type::String()) && !Data::IsString(resultType.m_typeId) && AZ::BehaviorContextHelper::IsStringParameter(resultType)) @@ -1365,7 +1405,7 @@ namespace ScriptCanvas void* storageAddress = (resultType.m_traits & AZ::BehaviorParameter::TR_POINTER) ? reinterpret_cast(&m_pointer) : AZStd::any_cast(&m_conversionStorage); if (auto stringOutcome = DatumHelpers::ConvertBehaviorContextString(resultType, storageAddress)) { - m_storage = stringOutcome.GetValue(); + m_storage.value = stringOutcome.GetValue(); } } else if (m_type.GetType() == Data::eType::BehaviorContextObject @@ -1373,73 +1413,73 @@ namespace ScriptCanvas { if (m_pointer) { - m_storage = BehaviorContextObject::CreateReference(resultType.m_typeId, m_pointer); + m_storage.value = BehaviorContextObject::CreateReference(resultType.m_typeId, m_pointer); } } } - + bool Datum::FromBehaviorContext(const void* source, const AZ::Uuid& typeID) { const auto& type = Data::FromAZType(typeID); InitializeOverloadedStorage(type, eOriginality::Copy); - + if (IS_A(type)) { switch (m_type.GetType()) { case ScriptCanvas::Data::eType::AABB: - return DatumHelpers::FromBehaviorContextAABB(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextAABB(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::BehaviorContextObject: return FromBehaviorContextObject(m_class, source); - + case ScriptCanvas::Data::eType::Boolean: - return DatumHelpers::FromBehaviorContextBool(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextBool(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Color: - return DatumHelpers::FromBehaviorContextColor(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextColor(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::CRC: - return DatumHelpers::FromBehaviorContextCRC(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextCRC(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::EntityID: - return DatumHelpers::FromBehaviorContextEntityID(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextEntityID(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Matrix3x3: - return DatumHelpers::FromBehaviorContextMatrix3x3(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextMatrix3x3(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Matrix4x4: - return DatumHelpers::FromBehaviorContextMatrix4x4(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextMatrix4x4(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Number: - return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::OBB: - return DatumHelpers::FromBehaviorContextOBB(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextOBB(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Plane: - return DatumHelpers::FromBehaviorContextPlane(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextPlane(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Quaternion: - return DatumHelpers::FromBehaviorContextQuaternion(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextQuaternion(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::String: - return DatumHelpers::FromBehaviorContextString(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextString(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Transform: - return DatumHelpers::FromBehaviorContextTransform(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextTransform(typeID, source, m_storage.value); case ScriptCanvas::Data::eType::Vector2: - return DatumHelpers::FromBehaviorContextVector2(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextVector2(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::Vector3: - return DatumHelpers::FromBehaviorContextVector3(typeID, source, m_storage); - + return DatumHelpers::FromBehaviorContextVector3(typeID, source, m_storage.value); + case ScriptCanvas::Data::eType::Vector4: - return DatumHelpers::FromBehaviorContextVector4(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextVector4(typeID, source, m_storage.value); } } - else if (DatumHelpers::ConvertImplicitlyChecked(type, source, m_type, m_storage, m_class)) + else if (DatumHelpers::ConvertImplicitlyChecked(type, source, m_type, m_storage.value, m_class)) { return true; } @@ -1455,14 +1495,14 @@ namespace ScriptCanvas bool Datum::FromBehaviorContextNumber(const void* source, const AZ::Uuid& typeID) { - return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage); + return DatumHelpers::FromBehaviorContextNumber(typeID, source, m_storage.value); } bool Datum::FromBehaviorContextObject(const AZ::BehaviorClass* behaviorClass, const void* source) { if (behaviorClass) { - m_storage = BehaviorContextObject::CreateReference(behaviorClass->m_typeId, const_cast(source)); + m_storage.value = BehaviorContextObject::CreateReference(behaviorClass->m_typeId, const_cast(source)); return true; } @@ -1471,10 +1511,10 @@ namespace ScriptCanvas const void* Datum::GetValueAddress() const { - return !m_storage.empty() - ? m_type.GetType() != Data::eType::BehaviorContextObject - ? AZStd::any_cast(&m_storage) - : (*AZStd::any_cast(&m_storage))->Get() + return !m_storage.value.empty() + ? m_type.GetType() != Data::eType::BehaviorContextObject + ? AZStd::any_cast(&m_storage.value) + : (*AZStd::any_cast(&m_storage.value))->Get() : nullptr; } @@ -1488,7 +1528,7 @@ namespace ScriptCanvas AZ_Error("ScriptCanvas", Empty(), "double initialized datum"); m_type = type; - + switch (type.GetType()) { case ScriptCanvas::Data::eType::AABB: @@ -1532,10 +1572,10 @@ namespace ScriptCanvas case ScriptCanvas::Data::eType::Quaternion: return InitializeQuaternion(source); - + case ScriptCanvas::Data::eType::String: return InitializeString(source, sourceTypeID); - + case ScriptCanvas::Data::eType::Transform: return InitializeTransform(source); @@ -1554,13 +1594,13 @@ namespace ScriptCanvas bool Datum::InitializeAABB(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeAssetId(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } @@ -1594,7 +1634,7 @@ namespace ScriptCanvas } const auto& type = Data::FromAZType(description.m_typeId); - const eOriginality originality + const eOriginality originality = !(description.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) ? eOriginality::Original : eOriginality::Copy; @@ -1621,11 +1661,11 @@ namespace ScriptCanvas if (m_originality == eOriginality::Original) { - m_storage = BehaviorContextObject::Create(behaviorClass, source); + m_storage.value = BehaviorContextObject::Create(behaviorClass, source); } else { - m_storage = BehaviorContextObject::CreateReference(behaviorClass.m_typeId, const_cast(source)); + m_storage.value = BehaviorContextObject::CreateReference(behaviorClass.m_typeId, const_cast(source)); } return true; @@ -1636,68 +1676,68 @@ namespace ScriptCanvas bool Datum::InitializeBool(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeColor(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeCRC(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeEntityID(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeNamedEntityID(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeMatrix3x3(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeMatrix4x4(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeNumber(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); - return (source && DatumHelpers::FromBehaviorContextNumber(sourceTypeID, source, m_storage)) || true; + m_storage.value = Data::Traits::GetDefault(); + return (source && DatumHelpers::FromBehaviorContextNumber(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeOBB(const void* source) { - m_storage = source - ? *reinterpret_cast(source) + m_storage.value = source + ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializePlane(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeQuaternion(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } @@ -1707,49 +1747,49 @@ namespace ScriptCanvas { if (sourceTypeID == azrtti_typeid()) { - m_storage = Data::StringType(*reinterpret_cast(source)); + m_storage.value = Data::StringType(*reinterpret_cast(source)); } else if (sourceTypeID == azrtti_typeid()) { - m_storage = Data::StringType(reinterpret_cast(source)); + m_storage.value = Data::StringType(reinterpret_cast(source)); } else { - m_storage = *reinterpret_cast(source); + m_storage.value = *reinterpret_cast(source); } } else { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); } return true; } bool Datum::InitializeTransform(const void* source) { - m_storage = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); + m_storage.value = source ? *reinterpret_cast(source) : Data::Traits::GetDefault(); return true; } bool Datum::InitializeVector2(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector2(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector2(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeVector3(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector3(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector3(sourceTypeID, source, m_storage.value)) || true; } bool Datum::InitializeVector4(const void* source, const AZ::Uuid& sourceTypeID) { - m_storage = Data::Traits::GetDefault(); + m_storage.value = Data::Traits::GetDefault(); // return a success regardless, but do the initialization first if source is not null - return (source && DatumHelpers::FromBehaviorContextVector4(sourceTypeID, source, m_storage)) || true; + return (source && DatumHelpers::FromBehaviorContextVector4(sourceTypeID, source, m_storage.value)) || true; } void Datum::SetType(const Data::Type& dataType) @@ -1759,7 +1799,7 @@ namespace ScriptCanvas if (dataType.IsValid()) { m_isDefaultConstructed = false; - + Datum tempDatum(dataType, ScriptCanvas::Datum::eOriginality::Original); ReconfigureDatumTo(AZStd::move(tempDatum)); } @@ -1787,18 +1827,18 @@ namespace ScriptCanvas auto dataTraitIt = typeIdTraitMap.find(m_type.GetType()); if (dataTraitIt != typeIdTraitMap.end()) { - return dataTraitIt->second.m_dataTraits.IsDefault(m_storage, m_type); + return dataTraitIt->second.m_dataTraits.IsDefault(m_storage.value, m_type); } AZ_Error("Script Canvas", m_isOverloadedStorage, "Unsupported ScriptCanvas Data type"); return true; } - + void* Datum::ModResultAddress() { return m_type.GetType() != Data::eType::BehaviorContextObject - ? AZStd::any_cast(&m_storage) - : (*AZStd::any_cast(&m_storage))->Mod(); + ? AZStd::any_cast(&m_storage.value) + : (*AZStd::any_cast(&m_storage.value))->Mod(); } void* Datum::ModValueAddress() const @@ -1821,12 +1861,12 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = AZStd::move(source.m_class); m_type = AZStd::move(source.m_type); - if (!source.m_storage.empty()) + if (!source.m_storage.value.empty()) { - m_storage = AZStd::move(source.m_storage); + m_storage.value = AZStd::move(source.m_storage.value); } } - else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage, m_class)) + else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage.value, m_class)) { AZ_Error("Script Canvas", false, "Failed to convert from %s to %s", GetName(source.GetType()).c_str(), GetName(m_type).c_str()); } @@ -1852,9 +1892,9 @@ namespace ScriptCanvas InitializeOverloadedStorage(source.m_type, m_originality); m_class = source.m_class; m_type = source.m_type; - m_storage = source.m_storage; + m_storage.value = source.m_storage.value; } - else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage, m_class)) + else if (!DatumHelpers::ConvertImplicitlyChecked(source.GetType(), source.GetValueAddress(), m_type, m_storage.value, m_class)) { AZ_Error("Script Canvas", false, "Failed to convert from %s to %s", GetName(source.GetType()).c_str(), GetName(m_type).c_str()); } @@ -1924,7 +1964,7 @@ namespace ScriptCanvas { return CallComparisonOperator(AZ::Script::Attributes::OperatorType::LessThan, m_class, *this, other); } - else + else { return AZ::Success(DatumHelpers::IsDataLess(m_type, GetValueAddress(), other.GetValueAddress())); } @@ -1970,7 +2010,7 @@ namespace ScriptCanvas } ComparisonOutcome isLessEqualResult = (*this <= other); - + if (isLessEqualResult.IsSuccess()) { return AZ::Success(!isLessEqualResult.GetValue()); @@ -1989,7 +2029,7 @@ namespace ScriptCanvas } ComparisonOutcome isLessResult = (*this < other); - + if (isLessResult.IsSuccess()) { return AZ::Success(!isLessResult.GetValue()); @@ -2028,7 +2068,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflection)) { serializeContext->Class() - ->Version(6) + ->Version(DatumHelpers::Version::Current, &DatumHelpers::VersionConverter) ->EventHandler() ->Field("m_isUntypedStorage", &Datum::m_isOverloadedStorage) ->Field("m_type", &Datum::m_type) @@ -2041,13 +2081,13 @@ namespace ScriptCanvas { editContext->Class("Datum", "Datum") ->ClassElement(AZ::Edit::ClassElements::EditorData, "Datum") - ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetVisibility) - ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &Datum::GetLabel) + ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetVisibility) + ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &Datum::GetLabel) ->DataElement(AZ::Edit::UIHandlers::Default, &Datum::m_storage, "Datum", "") - ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetDatumVisibility) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Datum::OnDatumEdited) + ->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetDatumVisibility) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Datum::OnDatumEdited) ; } } @@ -2066,7 +2106,7 @@ namespace ScriptCanvas return findIt != uniqueIdMap.end() ? findIt->second : sourceId; }, serializeContext, false); } - + void Datum::SetToDefaultValueOfType() { if (m_isOverloadedStorage) @@ -2079,7 +2119,7 @@ namespace ScriptCanvas auto dataTraitIt = typeIdTraitMap.find(m_type.GetType()); if (dataTraitIt != typeIdTraitMap.end()) { - m_storage = dataTraitIt->second.m_dataTraits.GetDefault(m_type); + m_storage.value = dataTraitIt->second.m_dataTraits.GetDefault(m_type); } else { @@ -2119,7 +2159,7 @@ namespace ScriptCanvas return AZ::Edit::PropertyVisibility::ShowChildrenOnly; } } - + void Datum::SetNotificationsTarget(AZ::EntityId notificationId) { m_notificationId = notificationId; @@ -2129,12 +2169,12 @@ namespace ScriptCanvas { if (m_type.GetType() == Data::eType::BehaviorContextObject) { - BehaviorContextObjectPtr ptr = (*AZStd::any_cast(&m_storage)); + BehaviorContextObjectPtr ptr = (*AZStd::any_cast(&m_storage.value)); return ptr->ToAny(); } else { - return m_storage; + return m_storage.value; } } @@ -2144,11 +2184,11 @@ namespace ScriptCanvas AZ::BehaviorContext* behaviorContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); AZ_Assert(behaviorContext, "Script Canvas can't do anything without a behavior context!"); - AZ::BehaviorClass* destinationBehaviorClass = AZ::BehaviorContextHelper::GetClass(behaviorContext, destination.m_typeId); + AZ::BehaviorClass* destinationBehaviorClass = AZ::BehaviorContextHelper::GetClass(behaviorContext, destination.m_typeId); const auto targetType = Data::FromAZType(destination.m_typeId); - - const bool success = - ( (IS_A(targetType) || IsConvertibleTo(targetType)) || (IS_A(Data::Type::String()) && AZ::BehaviorContextHelper::IsStringParameter(destination)) ) + + const bool success = + ((IS_A(targetType) || IsConvertibleTo(targetType)) || (IS_A(Data::Type::String()) && AZ::BehaviorContextHelper::IsStringParameter(destination))) && DatumHelpers::ToBehaviorContext(m_type, GetValueAddress(), destination, destinationBehaviorClass); AZ_Error("Script Canvas", success, "Cannot push Datum with type %s into BehaviorValueParameter expecting type %s", GetName(m_type).c_str(), GetName(targetType).c_str()); @@ -2176,9 +2216,9 @@ namespace ScriptCanvas AZ::Outcome Datum::ToBehaviorValueParameter(const AZ::BehaviorParameter& description) const { AZ_Assert(m_isOverloadedStorage || IS_A(Data::FromAZType(description.m_typeId)) || IsConvertibleTo(description), "Mismatched type going to behavior value parameter: %s", description.m_name); - + const_cast(this)->InitializeOverloadedStorage(Data::FromAZType(description.m_typeId), eOriginality::Copy); - + if (!Data::IsValueType(m_type) && !SatisfiesTraits(description.m_traits)) { return AZ::Failure(AZStd::string("Attempting to convert null value to BehaviorValueParameter that expects reference or value")); @@ -2218,7 +2258,7 @@ namespace ScriptCanvas return AZ::Success(parameter); } } - + AZ::Outcome Datum::ToBehaviorValueParameterResult([[maybe_unused]] const AZ::BehaviorParameter& description, [[maybe_unused]] const AZStd::string_view className, [[maybe_unused]] const AZStd::string_view methodName) { AZ_Assert(m_isOverloadedStorage || IS_A(Data::FromAZType(description.m_typeId)) || IsConvertibleTo(description), "Mismatched type going to behavior value parameter: %s (Context: %s :: %s)", description.m_name, className.data(), methodName.data()); @@ -2245,7 +2285,7 @@ namespace ScriptCanvas if (description.m_traits & AZ::BehaviorParameter::TR_POINTER) { m_pointer = ModResultAddress(); - + if (!m_pointer) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); @@ -2257,12 +2297,12 @@ namespace ScriptCanvas else { parameter.m_value = ModResultAddress(); - + if (!parameter.m_value) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); } - + parameter.m_traits = 0; } } @@ -2271,7 +2311,7 @@ namespace ScriptCanvas parameter.m_typeId = description.m_typeId; /// \todo verify there is no polymorphic danger here parameter.m_name = m_class ? m_class->m_name.c_str() : Data::GetBehaviorContextName(m_type); parameter.m_azRtti = m_class ? m_class->m_azRtti : nullptr; - + if (description.m_traits & (AZ::BehaviorParameter::TR_POINTER | AZ::BehaviorParameter::TR_REFERENCE)) { parameter.m_value = &m_pointer; @@ -2280,7 +2320,7 @@ namespace ScriptCanvas else { parameter.m_value = ModResultAddress(); - + if (!parameter.m_value) { return AZ::Failure(AZStd::string("nowhere to go for the for behavior context result")); @@ -2333,7 +2373,7 @@ namespace ScriptCanvas return AZ::Failure(AZStd::string::format("Cannot create a BehaviorValueParameter of type %s", description.m_name)); } - + bool Datum::ToString(Data::StringType& result) const { switch (GetType().GetType()) @@ -2422,11 +2462,11 @@ namespace ScriptCanvas result = AZStd::string::format("", Data::GetName(m_type).data()); return false; } - + AZStd::string Datum::ToStringAABB(const Data::AABBType& aabb) const { return AZStd::string::format - ( "(Min: %s, Max: %s)" + ("(Min: %s, Max: %s)" , ToStringVector3(aabb.GetMin()).c_str() , ToStringVector3(aabb.GetMax()).c_str()); } @@ -2466,15 +2506,15 @@ namespace ScriptCanvas } } } - + stringOut = ""; return false; } - + AZStd::string Datum::ToStringMatrix3x3(const AZ::Matrix3x3& m) const { return AZStd::string::format - ( "(%s, %s, %s)" + ("(%s, %s, %s)" , ToStringVector3(m.GetColumn(0)).c_str() , ToStringVector3(m.GetColumn(1)).c_str() , ToStringVector3(m.GetColumn(2)).c_str()); @@ -2484,7 +2524,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringMatrix4x4(const AZ::Matrix4x4& m) const { return AZStd::string::format - ( "(%s, %s, %s, %s)" + ("(%s, %s, %s, %s)" , ToStringVector4(m.GetColumn(0)).c_str() , ToStringVector4(m.GetColumn(1)).c_str() , ToStringVector4(m.GetColumn(2)).c_str() @@ -2495,7 +2535,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringOBB(const Data::OBBType& obb) const { return AZStd::string::format - ( "(Position: %s, AxisX: %s, AxisY: %s, AxisZ: %s, halfLengthX: %.7f, halfLengthY: %.7f, halfLengthZ: %.7f)" + ("(Position: %s, AxisX: %s, AxisY: %s, AxisZ: %s, halfLengthX: %.7f, halfLengthY: %.7f, halfLengthZ: %.7f)" , ToStringVector3(obb.GetPosition()).c_str() , ToStringVector3(obb.GetAxisX()).c_str() , ToStringVector3(obb.GetAxisY()).c_str() @@ -2514,7 +2554,7 @@ namespace ScriptCanvas { AZ::Vector3 eulerRotation = AZ::ConvertTransformToEulerDegrees(AZ::Transform::CreateFromQuaternion(source)); return AZStd::string::format - ( "(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)" + ("(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)" , static_cast(eulerRotation.GetX()) , static_cast(eulerRotation.GetY()) , static_cast(eulerRotation.GetZ())); @@ -2527,35 +2567,35 @@ namespace ScriptCanvas float scale = copy.ExtractUniformScale(); AZ::Vector3 rotation = AZ::ConvertTransformToEulerDegrees(copy); return AZStd::string::format - ( "(Position: X: %f, Y: %f, Z: %f," - " Rotation: X: %f, Y: %f, Z: %f," - " Scale: %f)" - , static_cast(pos.GetX()), static_cast(pos.GetY()), static_cast(pos.GetZ()) - , static_cast(rotation.GetX()), static_cast(rotation.GetY()), static_cast(rotation.GetZ()) - , scale); + ("(Position: X: %f, Y: %f, Z: %f," + " Rotation: X: %f, Y: %f, Z: %f," + " Scale: %f)" + , static_cast(pos.GetX()), static_cast(pos.GetY()), static_cast(pos.GetZ()) + , static_cast(rotation.GetX()), static_cast(rotation.GetY()), static_cast(rotation.GetZ()) + , scale); } AZStd::string Datum::ToStringVector2(const AZ::Vector2& source) const { return AZStd::string::format - ( "(X: %f, Y: %f)" + ("(X: %f, Y: %f)" , source.GetX() , source.GetY()); } - + AZStd::string Datum::ToStringVector3(const AZ::Vector3& source) const { return AZStd::string::format - ( "(X: %f, Y: %f, Z: %f)" + ("(X: %f, Y: %f, Z: %f)" , static_cast(source.GetX()) , static_cast(source.GetY()) , static_cast(source.GetZ())); } - + AZStd::string Datum::ToStringVector4(const AZ::Vector4& source) const { return AZStd::string::format - ("(X: %f, Y: %f, Z: %f, W: %f)" + ("(X: %f, Y: %f, Z: %f, W: %f)" , static_cast(source.GetX()) , static_cast(source.GetY()) , static_cast(source.GetZ()) @@ -2608,5 +2648,4 @@ namespace ScriptCanvas { return datum != nullptr && !datum->Empty(); } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h index 0c6912afe8..00500b4035 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -9,8 +9,8 @@ #include #include -#include #include +#include #include #include #include @@ -59,7 +59,7 @@ namespace ScriptCanvas Datum(BehaviorContextResultTag, const AZ::BehaviorParameter& resultType); Datum(const AZStd::string& behaviorClassName, eOriginality originality); Datum(const AZ::BehaviorValueParameter& value); - + void ReconfigureDatumTo(Datum&& object); void ReconfigureDatumTo(const Datum& object); @@ -204,18 +204,18 @@ namespace ScriptCanvas { static_assert(!AZStd::is_pointer::value, "no pointer types in the Datum::GetAsHelper"); - if (datum.m_storage.empty()) + if (datum.m_storage.value.empty()) { // rare, but can be caused by removals or problems with reflection to BehaviorContext, so must be checked return nullptr; } else if (datum.m_type.GetType() == Data::eType::BehaviorContextObject) { - return (*AZStd::any_cast(&datum.m_storage))->CastConst(); + return (*AZStd::any_cast(&datum.m_storage.value))->CastConst(); } else { - return AZStd::any_cast(&datum.m_storage); + return AZStd::any_cast(&datum.m_storage.value); } } }; @@ -253,12 +253,12 @@ namespace ScriptCanvas // eOriginality records the graph source of the object eOriginality m_originality = eOriginality::Copy; // storage for the datum, regardless of ScriptCanvas::Data::Type - AZStd::any m_storage; + RuntimeVariable m_storage; - // This contains the editor label for m_storage. + // This contains the editor label for m_storage.value. AZStd::string m_datumLabel; - // This contains the editor visibility for m_storage. + // This contains the editor visibility for m_storage.value. AZ::Crc32 m_visibility{ AZ::Edit::PropertyVisibility::ShowChildrenOnly }; // storage for implicit conversions, when needed AZStd::any m_conversionStorage; @@ -304,7 +304,7 @@ namespace ScriptCanvas bool InitializeCRC(const void* source); bool InitializeEntityID(const void* source); - + bool InitializeNamedEntityID(const void* source); bool InitializeMatrix3x3(const void* source); @@ -384,7 +384,7 @@ namespace ScriptCanvas bool Datum::Empty() const { - return m_storage.empty() || GetValueAddress() == nullptr; + return m_storage.value.empty() || GetValueAddress() == nullptr; } template @@ -492,7 +492,7 @@ namespace ScriptCanvas { if (Data::IsValueType(m_type)) { - m_storage = value; + m_storage.value = value; return true; } else diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index abd4cf1bb7..7b9c4bc048 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -136,10 +136,7 @@ namespace ScriptCanvas { if (nodeEntity) { - if (nodeEntity->GetState() == AZ::Entity::State::Constructed) - { - nodeEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(nodeEntity); if (auto* node = AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity)) { @@ -155,10 +152,7 @@ namespace ScriptCanvas { if (connectionEntity) { - if (connectionEntity->GetState() == AZ::Entity::State::Constructed) - { - connectionEntity->Init(); - } + ScriptCanvas::ScopedAuxiliaryEntityHandler entityHandler(connectionEntity); } } @@ -169,7 +163,7 @@ namespace ScriptCanvas { if (m_isFunctionGraph) { - return true; + return true; } return false; @@ -418,7 +412,7 @@ namespace ScriptCanvas void Graph::ValidateVariables(ValidationResults& validationResults) { const VariableData* variableData = GetVariableData(); - + if (!variableData) { return; @@ -440,7 +434,7 @@ namespace ScriptCanvas { errorDescription = AZStd::string::format("Variable %s has an invalid type %s.", GetVariableName(variableId).data(), variableType.GetAZType().ToString().c_str()); } - } + } else if (variableType == Data::Type::Invalid()) { errorDescription = AZStd::string::format("Variable %s has an invalid type.", GetVariableName(variableId).data()); @@ -502,7 +496,7 @@ namespace ScriptCanvas { m_graphData.m_nodes.emplace(nodeEntity); m_nodeMapping[nodeId] = node; - + node->SetOwningScriptCanvasId(m_scriptCanvasId); node->Configure(); GraphNotificationBus::Event(m_scriptCanvasId, &GraphNotifications::OnNodeAdded, nodeId); @@ -523,17 +517,17 @@ namespace ScriptCanvas if (node) { auto entry = m_graphData.m_nodes.find(node->GetEntity()); - if (entry != m_graphData.m_nodes.end()) - { - m_nodeMapping.erase(nodeId); - m_graphData.m_nodes.erase(entry); - GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnNodeRemoved, nodeId); + if (entry != m_graphData.m_nodes.end()) + { + m_nodeMapping.erase(nodeId); + m_graphData.m_nodes.erase(entry); + GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnNodeRemoved, nodeId); - RemoveDependentAsset(nodeId); - return true; + RemoveDependentAsset(nodeId); + return true; + } } } - } return false; } @@ -1036,17 +1030,17 @@ namespace ScriptCanvas } } -// for (auto connectionId : removableConnections) -// { -// DisconnectById(connectionId); -// } + // for (auto connectionId : removableConnections) + // { + // DisconnectById(connectionId); + // } if (!removableConnections.empty()) { // RefreshConnectionValidity(warnOnRemoval); } } - + void Graph::OnEntityActivated(const AZ::EntityId&) { } @@ -1075,7 +1069,7 @@ namespace ScriptCanvas AZ::Data::AssetManager::Instance().GetAsset(scriptEventNode->GetAssetId(), AZ::Data::AssetLoadBehavior::Default); } } - + m_batchAddingData = false; GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnBatchAddComplete); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp index 1e3ba13aaf..4ec5c31ca5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/Debugger.cpp @@ -756,10 +756,9 @@ namespace ScriptCanvas { auto runtimeComponent = (*graphIter); - if (graphIdentifier.m_assetId.m_guid == runtimeComponent->GetAsset().GetId().m_guid) + if (graphIdentifier.m_assetId.m_guid == runtimeComponent->GetRuntimeDataOverrides().m_runtimeAsset.GetId().m_guid) { // TODO: Gate on ComponentId - // \todo chcurran restore this functionality // runtimeComponent->SetIsGraphObserved(observedState); runtimeComponents.erase(graphIter); break; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp index af8a2d5f15..292a9490b8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp @@ -1,12 +1,13 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include +#include #include #include #include @@ -19,13 +20,13 @@ namespace ExecutionContextCpp { - void TypeCopy(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) + void CopyTypeInformationOnly(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) { lhs.m_typeId = rhs.m_typeId; lhs.m_azRtti = rhs.m_azRtti; } - void ValueCopy(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) + void CopyTypeAndValueSource(AZ::BehaviorValueParameter& lhs, const AZ::BehaviorValueParameter& rhs) { lhs.m_typeId = rhs.m_typeId; lhs.m_azRtti = rhs.m_azRtti; @@ -37,87 +38,102 @@ namespace ScriptCanvas { namespace Execution { - ActivationData::ActivationData(const RuntimeComponent& component, ActivationInputArray& storage) - : entityId(component.GetEntityId()) - , variableOverrides(component.GetVariableOverrides()) - , runtimeData(component.GetAsset()->GetData()) + ActivationData::ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage) + : variableOverrides(variableOverrides) + , runtimeData(variableOverrides.m_runtimeAsset->GetData()) , storage(storage) {} - ActivationData::ActivationData(const AZ::EntityId entityId, const VariableData& variableOverrides, const RuntimeData& runtimeData, ActivationInputArray& storage) - : entityId(entityId) - , variableOverrides(variableOverrides) - , runtimeData(runtimeData) - , storage(storage) - {} + const void* ActivationData::GetVariableSource(size_t index, size_t& overrideIndexTracker) const + { + if (variableOverrides.m_variableIndices[index]) + { + return AZStd::any_cast(&variableOverrides.m_variables[overrideIndexTracker++].value); + } + else + { + return runtimeData.m_input.m_variables[index].second.GetAsDanger(); + } + } - ActivationInputRange Context::CreateActivateInputRange(ActivationData& activationData) + ActivationInputRange Context::CreateActivateInputRange(ActivationData& activationData, [[maybe_unused]] const AZ::EntityId& forSliceSupportOnly) { const RuntimeData& runtimeData = activationData.runtimeData; ActivationInputRange rangeOut = runtimeData.m_activationInputRange; rangeOut.inputs = activationData.storage.begin(); - + AZ_Assert(rangeOut.totalCount <= activationData.storage.size(), "Too many initial arguments for activation. " "Consider increasing size, source of ActivationInputArray, or breaking up the source graph"); - // nodeables + // nodeables - until the optimization is required, every instance gets their own copy { auto sourceVariableIter = runtimeData.m_activationInputRange.inputs; const auto sourceVariableSentinel = runtimeData.m_activationInputRange.inputs + runtimeData.m_activationInputRange.nodeableCount; auto destVariableIter = rangeOut.inputs; for (; sourceVariableIter != sourceVariableSentinel; ++sourceVariableIter, ++destVariableIter) { - ExecutionContextCpp::ValueCopy(*destVariableIter, *sourceVariableIter); + ExecutionContextCpp::CopyTypeAndValueSource(*destVariableIter, *sourceVariableIter); } } - // (possibly overridden) variables + // (possibly overridden) variables, only the overrides are saved in on the component, otherwise they are taken from the runtime asset { auto sourceVariableIter = runtimeData.m_activationInputRange.inputs + runtimeData.m_activationInputRange.nodeableCount; auto destVariableIter = rangeOut.inputs + runtimeData.m_activationInputRange.nodeableCount; - for (auto& idDatumPair : runtimeData.m_input.m_variables) + size_t overrideIndexTracker = 0; + const size_t sentinel = runtimeData.m_input.m_variables.size(); + for (size_t index = 0; index != sentinel; ++index, ++destVariableIter, ++sourceVariableIter) { - ExecutionContextCpp::TypeCopy(*destVariableIter, *sourceVariableIter); - - auto variableOverride = activationData.variableOverrides.FindVariable(idDatumPair.first); - const Datum* datum = variableOverride ? variableOverride->GetDatum() : &idDatumPair.second; - destVariableIter->m_value = const_cast(datum->GetAsDanger()); - - ++destVariableIter; - ++sourceVariableIter; + ExecutionContextCpp::CopyTypeInformationOnly(*destVariableIter, *sourceVariableIter); + destVariableIter->m_value = const_cast(activationData.GetVariableSource(index, overrideIndexTracker)); } } - // (must always be re-mapped) EntityId - if (!runtimeData.m_input.m_entityIds.empty()) + // (always overridden) EntityIds { - AZ::SliceComponent::EntityIdToEntityIdMap loadedEntityIdMap; - AzFramework::EntityContextId owningContextId = AzFramework::EntityContextId::CreateNull(); - AzFramework::EntityIdContextQueryBus::EventResult(owningContextId, activationData.entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); - if (!owningContextId.IsNull()) + bool prefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult(prefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + + if (prefabSystemEnabled) { - AzFramework::SliceEntityOwnershipServiceRequestBus::EventResult(loadedEntityIdMap, owningContextId, &AzFramework::SliceEntityOwnershipServiceRequestBus::Events::GetLoadedEntityIdMap); - } + AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs + + runtimeData.m_activationInputRange.nodeableCount + + runtimeData.m_activationInputRange.variableCount; - AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs - + runtimeData.m_activationInputRange.nodeableCount - + runtimeData.m_activationInputRange.variableCount; + const auto entityIdTypeId = azrtti_typeid(); - const auto entityIdTypeId = azrtti_typeid(); - for (auto& idEntityPair : runtimeData.m_input.m_entityIds) + for (auto& entityId : activationData.variableOverrides.m_entityIds) + { + destVariableIter->m_typeId = entityIdTypeId; + destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); + auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); + *entityIdValuePtr = entityId; + ++destVariableIter; + } + } + else { - destVariableIter->m_typeId = entityIdTypeId; - destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); - auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); - - if (auto variableOverride = activationData.variableOverrides.FindVariable(idEntityPair.first)) + AZ::SliceComponent::EntityIdToEntityIdMap loadedEntityIdMap; + AzFramework::EntityContextId owningContextId = AzFramework::EntityContextId::CreateNull(); + AzFramework::EntityIdContextQueryBus::EventResult(owningContextId, forSliceSupportOnly, &AzFramework::EntityIdContextQueries::GetOwningContextId); + if (!owningContextId.IsNull()) { - *entityIdValuePtr = *variableOverride->GetDatum()->GetAs(); + AzFramework::SliceEntityOwnershipServiceRequestBus::EventResult(loadedEntityIdMap, owningContextId, &AzFramework::SliceEntityOwnershipServiceRequestBus::Events::GetLoadedEntityIdMap); } - else + + AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs + + runtimeData.m_activationInputRange.nodeableCount + + runtimeData.m_activationInputRange.variableCount; + + const auto entityIdTypeId = azrtti_typeid(); + for (auto& entityId : activationData.variableOverrides.m_entityIds) { - auto iter = loadedEntityIdMap.find(idEntityPair.second); + destVariableIter->m_typeId = entityIdTypeId; + destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); + auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); + + auto iter = loadedEntityIdMap.find(entityId); if (iter != loadedEntityIdMap.end()) { *entityIdValuePtr = iter->second; @@ -126,9 +142,10 @@ namespace ScriptCanvas { *entityIdValuePtr = Data::EntityIDType(); } - } - ++destVariableIter; + *entityIdValuePtr = entityId; + ++destVariableIter; + } } } @@ -156,7 +173,7 @@ namespace ScriptCanvas for (auto& idDatumPair : runtimeData.m_input.m_variables) { - const Datum* datum = &idDatumPair.second; + const Datum* datum = &idDatumPair.second; AZ::BehaviorValueParameter bvp; bvp.m_typeId = datum->GetType().GetAZType(); const auto classIter(behaviorContext.m_typeToClassMap.find(bvp.m_typeId)); @@ -214,6 +231,6 @@ namespace ScriptCanvas Execution::InterpretedUnloadData(runtimeData); } - } + } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h index ed55af7286..c697bf71f6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -12,9 +12,9 @@ namespace ScriptCanvas { class RuntimeComponent; - class VariableData; struct RuntimeData; + struct RuntimeDataOverrides; namespace Execution { @@ -22,15 +22,15 @@ namespace ScriptCanvas struct ActivationData { - ActivationData(const RuntimeComponent& component, ActivationInputArray& storage); - ActivationData(const AZ::EntityId entityId, const VariableData& variableOverrides, const RuntimeData& runtimeData, ActivationInputArray& storage); - - const AZ::EntityId entityId; - const VariableData& variableOverrides; + const RuntimeDataOverrides& variableOverrides; const RuntimeData& runtimeData; ActivationInputArray& storage; + + ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage); + + const void* GetVariableSource(size_t index, size_t& overrideIndexTracker) const; }; - + struct ActivationInputRange { AZ::BehaviorValueParameter* inputs = nullptr; @@ -47,7 +47,7 @@ namespace ScriptCanvas AZ_TYPE_INFO(Context, "{2C137581-19F4-42EB-8BF3-14DBFBC02D8D}"); AZ_CLASS_ALLOCATOR(Context, AZ::SystemAllocator, 0); - static ActivationInputRange CreateActivateInputRange(ActivationData& activationData); + static ActivationInputRange CreateActivateInputRange(ActivationData& activationData, const AZ::EntityId& forSliceSupportOnly); static void InitializeActivationData(RuntimeData& runtimeData); static void UnloadData(RuntimeData& runtimeData); @@ -56,5 +56,5 @@ namespace ScriptCanvas static void IntializeStaticCloners(RuntimeData& runtimeData, AZ::BehaviorContext& behaviorContext); }; - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp index fb9ba1afb0..aebb3ed20e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -27,34 +27,34 @@ namespace ScriptCanvas ExecutionState::ExecutionState(const ExecutionStateConfig& config) : m_component(&config.component) {} - + ExecutionStatePtr ExecutionState::Create(const ExecutionStateConfig& config) { Grammar::ExecutionStateSelection selection = config.runtimeData.m_input.m_executionSelection; switch (selection) { - case Grammar::InterpretedPure: + case Grammar::ExecutionStateSelection::InterpretedPure: return AZStd::make_shared(config); - - case Grammar::InterpretedPureOnGraphStart: + + case Grammar::ExecutionStateSelection::InterpretedPureOnGraphStart: return AZStd::make_shared(config); - case Grammar::InterpretedObject: + case Grammar::ExecutionStateSelection::InterpretedObject: return AZStd::make_shared(config); - case Grammar::InterpretedObjectOnGraphStart: + case Grammar::ExecutionStateSelection::InterpretedObjectOnGraphStart: return AZStd::make_shared(config); - + default: AZ_Assert(false, "Unsupported ScriptCanvas execution selection"); return nullptr; } } - + AZ::Data::AssetId ExecutionState::GetAssetId() const { - return m_component->GetAsset().GetId(); + return m_component->GetRuntimeDataOverrides().m_runtimeAsset.GetId(); } AZ::EntityId ExecutionState::GetEntityId() const @@ -82,9 +82,9 @@ namespace ScriptCanvas return m_component->GetScriptCanvasId(); } - const VariableData& ExecutionState::GetVariableOverrides() const + const RuntimeDataOverrides& ExecutionState::GetRuntimeDataOverrides() const { - return m_component->GetVariableOverrides(); + return m_component->GetRuntimeDataOverrides(); } void ExecutionState::Reflect(AZ::ReflectContext* reflectContext) @@ -95,7 +95,7 @@ namespace ScriptCanvas ->Method("GetEntityId", &ExecutionState::GetEntityId) ->Method("GetScriptCanvasId", &ExecutionState::GetScriptCanvasId) ->Method("ToString", &ExecutionState::ToString) - ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString) + ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString) ; } @@ -116,7 +116,7 @@ namespace ScriptCanvas { return shared_from_this(); } - + AZStd::string ExecutionState::ToString() const { return AZStd::string::format("ExecutionState[%p]", this); @@ -132,4 +132,4 @@ namespace ScriptCanvas return ExecutionStateWeakConstPtr(this); } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h index 0cb51b028e..12c74f39eb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -37,7 +37,7 @@ namespace ScriptCanvas ExecutionStateConfig(AZ::Data::Asset asset, RuntimeComponent& component); }; - + class ExecutionState : public AZStd::enable_shared_from_this { @@ -50,7 +50,7 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* reflectContext); const RuntimeComponent* m_component = nullptr; - + ExecutionState(const ExecutionStateConfig& config); virtual ~ExecutionState() = default; @@ -71,7 +71,7 @@ namespace ScriptCanvas AZ::EntityId GetScriptCanvasId() const; - const VariableData& GetVariableOverrides() const; + const RuntimeDataOverrides& GetRuntimeDataOverrides() const; virtual void Initialize() = 0; @@ -88,4 +88,4 @@ namespace ScriptCanvas ExecutionStateWeakConstPtr WeakFromThisConst() const; }; -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 9730d52289..3806e7a3c7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -176,7 +176,7 @@ namespace ExecutionInterpretedAPICpp // Lua: AZStd::pair multipleResults = ScriptCanvas::BehaviorContextUtils::ConstructTupleGetContext(typeId); AZ_Assert(multipleResults.first, "failure to construct a tuple by typeid from behavior context"); - AZ::BehaviorValueParameter parameter; + AZ::BehaviorValueParameter parameter; parameter.m_value = multipleResults.first; parameter.m_typeId = typeId; AZ::StackPush(lua, multipleResults.second, parameter); @@ -253,7 +253,7 @@ namespace ScriptCanvas break; } } - + void SetInterpretedExecutionModeDebug() { AZ::ScriptContext* scriptContext{}; @@ -314,7 +314,7 @@ namespace ScriptCanvas { using namespace ExecutionInterpretedAPICpp; static_assert(sizeof(AZ::Uuid) == k_UuidSize, "size of uuid has changed"); - + AZStd::string fastString; fastString.resize(k_StringFastSize); char* fastDigit = fastString.begin(); @@ -338,7 +338,7 @@ namespace ScriptCanvas AZ_Assert(string, "string argument must not be null"); AZ_Assert(strlen(string) == k_StringFastSize, "invalid length of string, fast format must be: 0123456789ABCDEF0123456789ABCDEF"); const char* current = string; - + AZ::Uuid id; auto data = id.begin(); auto sentinel = id.end(); @@ -358,8 +358,7 @@ namespace ScriptCanvas ++current; *data = (value0 << 4) | value1; - } - while ((++data) != sentinel); + } while ((++data) != sentinel); return id; } @@ -370,7 +369,6 @@ namespace ScriptCanvas /** Here is the function in Lua for easier reading - function OverrideNodeableMetatable(userdata, class_mt) local proxy = setmetatable({}, class_mt) -- class_mt from the user graph definition local instance_mt = { @@ -388,18 +386,16 @@ namespace ScriptCanvas --]] return setmetatable(userdata instance_mt) -- can't be done from Lua end - --[[ userdata to Nodeable before: getmetatable(userdata).__index == Nodeable - + userdata to Nodeable after: local override_mt = getmetatable(userdata) local proxy = override_mt.__index local SubGraph = getmetatable(proxy).__index getmetatable(SubGraph.__index) == Nodeable) --]] - */ // \note: all other metamethods ignored for now @@ -504,7 +500,7 @@ namespace ScriptCanvas AZ_Assert(argsCount >= 2, "CallExecutionOut: Error in compiled Lua file, not enough arguments"); AZ_Assert(lua_isuserdata(lua, 1), "CallExecutionOut: Error in compiled lua file, 1st argument to SetExecutionOut is not userdata (Nodeable)"); AZ_Assert(lua_isnumber(lua, 2), "CallExecutionOut: Error in compiled lua file, 2nd argument to SetExecutionOut is not a number"); - Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, 1); + Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, 1); size_t index = aznumeric_caster(lua_tointeger(lua, 2)); nodeable->CallOut(index, nullptr, nullptr, argsCount - 2); // Lua: results... @@ -568,7 +564,7 @@ namespace ScriptCanvas { const int handlerIndex = lua_gettop(lua) - argCount; lua_pushcfunction(lua, &ExecutionInterpretedAPICpp::ErrorHandler); - lua_insert(lua, handlerIndex); + lua_insert(lua, handlerIndex); int result = lua_pcall(lua, argCount, returnValueCount, handlerIndex); lua_remove(lua, handlerIndex); return result; @@ -581,7 +577,7 @@ namespace ScriptCanvas AZ_Assert(lua_isuserdata(lua, -3), "Error in compiled lua file, 1st argument to SetExecutionOut is not userdata (Nodeable)"); AZ_Assert(lua_isnumber(lua, -2), "Error in compiled lua file, 2nd argument to SetExecutionOut is not a number"); - AZ_Assert(lua_isfunction(lua, -1), "Error in compiled lua file, 3rd argument to SetExecutionOut is not a function (lambda need to get around atypically routed arguments)"); + AZ_Assert(lua_isfunction(lua, -1), "Error in compiled lua file, 3rd argument to SetExecutionOut is not a function (lambda need to get around atypically routed arguments)"); Nodeable* nodeable = AZ::ScriptValue::StackRead(lua, -3); AZ_Assert(nodeable, "Failed to read nodeable"); size_t index = aznumeric_caster(lua_tointeger(lua, -2)); @@ -680,9 +676,9 @@ namespace ScriptCanvas struct DependencyConstructionPack { ExecutionStateInterpreted* executionState; - AZStd::vector>* dependentAssets; - const size_t dependentAssetsIndex; - RuntimeData& runtimeData; + AZStd::vector* dependencies; + const size_t dependenciesIndex; + RuntimeDataOverrides& runtimeOverrides; }; DependencyConstructionPack UnpackDependencyConstructionArgsSanitize(lua_State* lua) @@ -690,27 +686,26 @@ namespace ScriptCanvas auto executionState = AZ::ScriptValue::StackRead(lua, 1); AZ_Assert(executionState, "Error in compiled lua file, 1st argument to UnpackDependencyArgs is not an ExecutionStateInterpreted"); AZ_Assert(lua_islightuserdata(lua, 2), "Error in compiled lua file, 2nd argument to UnpackDependencyArgs is not userdata (AZStd::vector>*), but a :%s", lua_typename(lua, 2)); - auto dependentAssets = reinterpret_cast>*>(lua_touserdata(lua, 2)); + auto dependentOverrides = reinterpret_cast*>(lua_touserdata(lua, 2)); AZ_Assert(lua_isinteger(lua, 3), "Error in compiled Lua file, 3rd argument to UnpackDependencyArgs is not a number"); - const size_t dependentAssetsIndex = aznumeric_caster(lua_tointeger(lua, 3)); - - return DependencyConstructionPack{ executionState, dependentAssets, dependentAssetsIndex, (*dependentAssets)[dependentAssetsIndex].Get()->m_runtimeData }; + const size_t dependencyIndex = aznumeric_caster(lua_tointeger(lua, 3)); + return DependencyConstructionPack{ executionState, dependentOverrides, dependencyIndex, (*dependentOverrides)[dependencyIndex] }; } int Unpack(lua_State* lua, DependencyConstructionPack& args) { ActivationInputArray storage; - ActivationData data(args.executionState->GetEntityId(), args.executionState->GetVariableOverrides(), args.runtimeData, storage); - ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + ActivationData data(args.runtimeOverrides, storage); + ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, args.executionState->GetEntityId()); PushActivationArgs(lua, range.inputs, range.totalCount); return range.totalCount; } int UnpackDependencyConstructionArgs(lua_State* lua) { - // Lua: executionState, dependentAssets, dependentAssetsIndex + // Lua: executionState, dependent overrides, index into dependent overrides DependencyConstructionPack pack = UnpackDependencyConstructionArgsSanitize(lua); - lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&pack.runtimeData.m_requiredAssets))); + lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&pack.runtimeOverrides.m_dependencies))); return 1 + Unpack(lua, pack); } @@ -720,6 +715,5 @@ namespace ScriptCanvas DependencyConstructionPack constructionArgs = UnpackDependencyConstructionArgsSanitize(lua); return Unpack(lua, constructionArgs); } - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 27377157be..d7cc05cf1b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -20,6 +20,7 @@ namespace ExecutionStateInterpretedCpp AZ::Data::Asset GetSubgraphAssetForDebug(const AZ::Data::AssetId& id) { + // #functions2 this may have to be made recursive auto asset = AZ::Data::AssetManager::Instance().GetAsset(id, AZ::Data::AssetLoadBehavior::PreLoad); asset.BlockUntilLoadComplete(); return asset; @@ -32,7 +33,7 @@ namespace ScriptCanvas : ExecutionState(config) , m_interpretedAsset(config.runtimeData.m_script) {} - + void ExecutionStateInterpreted::ClearLuaRegistryIndex() { m_luaRegistryIndex = LUA_NOREF; @@ -40,8 +41,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolIn(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_ins.size() - ? &(m_component->GetAssetData().m_debugMap.m_ins[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_ins.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_ins[index]) : nullptr; } @@ -55,8 +56,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolOut(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_outs.size() - ? &(m_component->GetAssetData().m_debugMap.m_outs[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_outs.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_outs[index]) : nullptr; } @@ -70,8 +71,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolReturn(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_returns.size() - ? &(m_component->GetAssetData().m_debugMap.m_returns[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_returns.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_returns[index]) : nullptr; } @@ -85,8 +86,8 @@ namespace ScriptCanvas const Grammar::DebugDataSource* ExecutionStateInterpreted::GetDebugSymbolVariableChange(size_t index) const { - return index < m_component->GetAssetData().m_debugMap.m_variables.size() - ? &(m_component->GetAssetData().m_debugMap.m_variables[index]) + return index < m_component->GetRuntimeAssetData().m_debugMap.m_variables.size() + ? &(m_component->GetRuntimeAssetData().m_debugMap.m_variables[index]) : nullptr; } @@ -148,5 +149,4 @@ namespace ScriptCanvas luaL_unref(m_luaState, LUA_REGISTRYINDEX, m_luaRegistryIndex); m_luaRegistryIndex = LUA_NOREF; } - -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 86e2b6d7fd..5dbc35236f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -19,7 +19,7 @@ namespace ScriptCanvas ExecutionStateInterpretedPerActivation::ExecutionStateInterpretedPerActivation(const ExecutionStateConfig& config) : ExecutionStateInterpreted(config) {} - + ExecutionStateInterpretedPerActivation::~ExecutionStateInterpretedPerActivation() { if (m_deactivationRequired) @@ -45,15 +45,15 @@ namespace ScriptCanvas AZ::Internal::LuaClassToStack(lua, this, azrtti_typeid(), AZ::ObjectToLua::ByReference, AZ::AcquisitionOnPush::None); // Lua: graph_VM, graph_VM['new'], userdata Execution::ActivationInputArray storage; - Execution::ActivationData data(*m_component, storage); - Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + Execution::ActivationData data(m_component->GetRuntimeDataOverrides(), storage); + Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, m_component->GetEntityId()); if (range.requiresDependencyConstructionParameters) { - lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&data.runtimeData.m_requiredAssets))); - // Lua: graph_VM, graph_VM['new'], userdata, dependencies + lua_pushlightuserdata(lua, const_cast(reinterpret_cast(&data.variableOverrides.m_dependencies))); + // Lua: graph_VM, graph_VM['new'], userdata, runtimeDataOverrides Execution::PushActivationArgs(lua, range.inputs, range.totalCount); - // Lua: graph_VM, graph_VM['new'], userdata, dependencies, args... + // Lua: graph_VM, graph_VM['new'], userdata, runtimeDataOverrides, args... AZ::Internal::LuaSafeCall(lua, aznumeric_caster(2 + range.totalCount), 1); } else @@ -139,5 +139,4 @@ namespace ScriptCanvas ; } } - -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp index 20f5a2126e..368ceccf95 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -21,7 +21,7 @@ namespace ScriptCanvas void ExecutionStateInterpretedPure::Execute() {} - + void ExecutionStateInterpretedPure::Initialize() {} @@ -52,8 +52,8 @@ namespace ScriptCanvas AZ::Internal::LuaClassToStack(lua, this, azrtti_typeid(), AZ::ObjectToLua::ByReference, AZ::AcquisitionOnPush::None); // Lua: graph_VM, graph_VM['k_OnGraphStartFunctionName'], userdata Execution::ActivationInputArray storage; - Execution::ActivationData data(*m_component, storage); - Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data); + Execution::ActivationData data(m_component->GetRuntimeDataOverrides(), storage); + Execution::ActivationInputRange range = Execution::Context::CreateActivateInputRange(data, m_component->GetEntityId()); Execution::PushActivationArgs(lua, range.inputs, range.totalCount); // Lua: graph_VM, graph_VM['k_OnGraphStartFunctionName'], userdata, args... const int result = Execution::InterpretedSafeCall(lua, aznumeric_caster(1 + range.totalCount), 0); @@ -78,4 +78,4 @@ namespace ScriptCanvas ; } } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index 94cb258c95..d5ba635838 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -24,9 +24,12 @@ namespace RuntimeComponentCpp { - enum Version + enum class RuntimeComponentVersion : unsigned int { ForceAssetPreloads = 5, + AddRuntimeDataOverrides, + PrefabSupport, + RemoveRuntimeAsset, // add description above Current, @@ -40,17 +43,11 @@ namespace ScriptCanvas return GraphInfo(scriptCanvasId, graphIdentifier); } - DatumValue CreateDatumValue(ScriptCanvasId /*scriptCanvasId*/, const GraphVariable& variable) + DatumValue CreateDatumValue([[maybe_unused]] ScriptCanvasId scriptCanvasId, const GraphVariable& variable) { return DatumValue::Create(GraphVariable((*variable.GetDatum()), variable.GetVariableId())); } - RuntimeComponent::RuntimeComponent(AZ::Data::Asset runtimeAsset) - : m_runtimeAsset(runtimeAsset) - { - m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - } - void RuntimeComponent::Activate() { InitializeExecution(); @@ -66,18 +63,13 @@ namespace ScriptCanvas AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeAsset.GetId().ToString().c_str()); AZ_Assert(m_executionState, "RuntimeComponent::Execute called without an execution state"); SC_EXECUTION_TRACE_GRAPH_ACTIVATED(CreateActivationInfo()); - SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeAsset.GetId()); + SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); m_executionState->Execute(); } - const AZ::Data::Asset& RuntimeComponent::GetAsset() const - { - return m_runtimeAsset; - } - - const RuntimeData& RuntimeComponent::GetAssetData() const + const RuntimeData& RuntimeComponent::GetRuntimeAssetData() const { - return m_runtimeAsset->GetData(); + return m_runtimeOverrides.m_runtimeAsset->GetData(); } ExecutionMode RuntimeComponent::GetExecutionMode() const @@ -87,7 +79,7 @@ namespace ScriptCanvas GraphIdentifier RuntimeComponent::GetGraphIdentifier() const { - return GraphIdentifier(AZ::Data::AssetId(m_runtimeAsset.GetId().m_guid, 0), 0); + return GraphIdentifier(AZ::Data::AssetId(m_runtimeOverrides.m_runtimeAsset.GetId().m_guid, 0), 0); } AZ::EntityId RuntimeComponent::GetScriptCanvasId() const @@ -95,37 +87,43 @@ namespace ScriptCanvas return m_scriptCanvasId; } - const VariableData& RuntimeComponent::GetVariableOverrides() const + const RuntimeDataOverrides& RuntimeComponent::GetRuntimeDataOverrides() const { - return m_variableOverrides; + return m_runtimeOverrides; + } + + void RuntimeComponent::SetRuntimeDataOverrides(const RuntimeDataOverrides& overrideData) + { + m_runtimeOverrides = overrideData; + m_runtimeOverrides.EnforcePreloadBehavior(); } void RuntimeComponent::Init() { m_scriptCanvasId = AZ::Entity::MakeId(); - AZ_Assert(m_runtimeAsset.GetAutoLoadBehavior() == AZ::Data::AssetLoadBehavior::PreLoad, "RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad"); + AZ_Assert(RuntimeDataOverrides::IsPreloadBehaviorEnforced(m_runtimeOverrides), "RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad"); } void RuntimeComponent::InitializeExecution() { #if defined(SCRIPT_CANVAS_RUNTIME_ASSET_CHECK) - if (!m_runtimeAsset.Get()) + if (!m_runtimeOverrides.m_runtimeAsset.Get()) { - AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); return; } #else - AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); #endif AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeAsset.GetId().ToString().c_str()); - SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeAsset.GetId()); - m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeAsset, *this)); + SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeOverrides.m_runtimeAsset.GetId()); + m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeOverrides.m_runtimeAsset, *this)); #if defined(SCRIPT_CANVAS_RUNTIME_ASSET_CHECK) if (!m_executionState) { - AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeAsset.GetId().ToString().data()); + AZ_Error("ScriptCanvas", false, "RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); return; } #else @@ -135,7 +133,7 @@ namespace ScriptCanvas AZ::EntityBus::Handler::BusConnect(GetEntityId()); m_executionState->Initialize(); } - + void RuntimeComponent::OnEntityActivated(const AZ::EntityId&) { Execute(); @@ -151,24 +149,18 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(RuntimeComponentCpp::Version::Current, &RuntimeComponent::VersionConverter) - ->Field("m_runtimeAsset", &RuntimeComponent::m_runtimeAsset) - ->Field("m_variableOverrides", &RuntimeComponent::m_variableOverrides) + ->Version(static_cast(RuntimeComponentCpp::RuntimeComponentVersion::Current), &RuntimeComponent::VersionConverter) + ->Field("runtimeOverrides", &RuntimeComponent::m_runtimeOverrides) ; } } - void RuntimeComponent::SetVariableOverrides(const VariableData& overrideData) - { - m_variableOverrides = overrideData; - } - void RuntimeComponent::StopExecution() { if (m_executionState) { m_executionState->StopExecution(); - SCRIPT_CANVAS_PERFORMANCE_FINALIZE_TIMER(GetScriptCanvasId(), m_runtimeAsset.GetId()); + SCRIPT_CANVAS_PERFORMANCE_FINALIZE_TIMER(GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); SC_EXECUTION_TRACE_GRAPH_DEACTIVATED(CreateActivationInfo()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h index 3bee2ea592..b24cd55069 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -17,9 +17,6 @@ #include #include -#include "RuntimeComponent.h" - - namespace ScriptCanvas { using VariableIdMap = AZStd::unordered_map; @@ -45,11 +42,8 @@ namespace ScriptCanvas RuntimeComponent() = default; - RuntimeComponent(AZ::Data::Asset runtimeAsset); - - const AZ::Data::Asset& GetAsset() const; - - const RuntimeData& GetAssetData() const; + // used to provide debug symbols, usually coming in the form of Node/Slot/Variable IDs + const RuntimeData& GetRuntimeAssetData() const; GraphIdentifier GetGraphIdentifier() const; @@ -57,9 +51,9 @@ namespace ScriptCanvas AZ::EntityId GetScriptCanvasId() const; - const VariableData& GetVariableOverrides() const; + const RuntimeDataOverrides& GetRuntimeDataOverrides() const; - void SetVariableOverrides(const VariableData& overrideData); + void SetRuntimeDataOverrides(const RuntimeDataOverrides& overrideData); protected: static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) @@ -94,15 +88,8 @@ namespace ScriptCanvas void StopExecution(); private: - AZ::Data::Asset m_runtimeAsset; ExecutionStatePtr m_executionState; AZ::EntityId m_scriptCanvasId; - - //! Per instance variable data overrides for the runtime asset - //! This is serialized when building this component from the EditorScriptCanvasComponent - // \todo remove the names from this data, and make it more lightweight - // it only needs variable id and value - // move the other information to the runtime system component - VariableData m_variableOverrides; + RuntimeDataOverrides m_runtimeOverrides; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 37a7ab898c..1851b5e65d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -1,12 +1,13 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include +#include #include #include #include @@ -41,11 +42,11 @@ namespace AbstractCodeModelCpp using namespace ScriptCanvas::Grammar; AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*> Intersection - ( const AZStd::unordered_multimap& lhs + (const AZStd::unordered_multimap& lhs , const AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*>& rhs) { AZStd::unordered_set< const Nodes::Core::FunctionDefinitionNode*> intersection; - + for (auto candidate : lhs) { if (rhs.contains(candidate.first)) @@ -147,7 +148,7 @@ namespace ScriptCanvas } } m_functions.clear(); - + m_userInsThatRequireTopology.clear(); m_userOutsThatRequireTopology.clear(); @@ -239,7 +240,7 @@ namespace ScriptCanvas // #functions2 slot<->variable consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering m_sourceVariableByDatum.insert(AZStd::make_pair(datum, &variablePair.second)); } - + } for (auto& sourceVariable : sortedVariables) @@ -424,7 +425,7 @@ namespace ScriptCanvas } void AbstractCodeModel::AddExecutionMapIn - ( UserInParseTopologyResult /*result*/ + (UserInParseTopologyResult /*result*/ , ExecutionTreeConstPtr root , const AZStd::vector& outCalls , AZStd::string_view defaultOutName @@ -441,10 +442,10 @@ namespace ScriptCanvas for (auto& input : functionInput) { in.inputs.push_back - ({ GetOriginalVariableName(input.second->m_source, nodelingIn) - , input.second->m_source->m_name - , input.second->m_source->m_datum - , input.second->m_source->m_sourceVariableId }); + ({ GetOriginalVariableName(input.second->m_source, nodelingIn) + , input.second->m_source->m_name + , input.second->m_source->m_datum + , input.second->m_source->m_sourceVariableId }); } if (!root->HasExplicitUserOutCalls()) @@ -473,10 +474,10 @@ namespace ScriptCanvas { const auto& returnValueVariable = root->GetReturnValue(returnValueIndex).second->m_source; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, *uniqueNodelingsOut.begin()) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, *uniqueNodelingsOut.begin()) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } in.outs.push_back(AZStd::move(out)); @@ -505,15 +506,15 @@ namespace ScriptCanvas SetDisplayAndParsedName(out, defaultOutName); out.sourceID = defaultOutId; } - + for (size_t inputIndex = 0; inputIndex < outCall->GetInputCount(); ++inputIndex) { const auto& returnValueVariable = outCall->GetInput(inputIndex).m_value; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, outCallID.m_node) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, outCallID.m_node) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } AZStd::const_pointer_cast(outCall)->SetOutCallIndex(m_outIndexCount); @@ -543,20 +544,20 @@ namespace ScriptCanvas { const auto& inputVariable = outCall->GetInput(inputIndex).m_value; out.outputs.push_back - ({ GetOriginalVariableName(inputVariable, &nodeling) - , inputVariable->m_name - , inputVariable->m_datum.GetType() - , inputVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(inputVariable, &nodeling) + , inputVariable->m_name + , inputVariable->m_datum.GetType() + , inputVariable->m_sourceVariableId }); } for (size_t returnValueIndex = 0; returnValueIndex < outCall->GetReturnValueCount(); ++returnValueIndex) { const auto& returnValueVariable = outCall->GetReturnValue(returnValueIndex).second->m_source; out.outputs.push_back - ({ GetOriginalVariableName(returnValueVariable, &nodeling) - , returnValueVariable->m_name - , returnValueVariable->m_datum.GetType() - , returnValueVariable->m_sourceVariableId }); + ({ GetOriginalVariableName(returnValueVariable, &nodeling) + , returnValueVariable->m_name + , returnValueVariable->m_datum.GetType() + , returnValueVariable->m_sourceVariableId }); } AZStd::const_pointer_cast(outCall)->SetOutCallIndex(m_outIndexCount); @@ -697,7 +698,7 @@ namespace ScriptCanvas } AZStd::string AbstractCodeModel::CheckUniqueInterfaceNames - ( AZStd::string_view candidate + (AZStd::string_view candidate , AZStd::string_view defaultName , AZStd::unordered_set& uniqueNames , const AZStd::unordered_set& nodelingsOut) @@ -755,7 +756,7 @@ namespace ScriptCanvas } AZStd::vector AbstractCodeModel::CombineVariableLists - ( const AZStd::vector& constructionNodeables + (const AZStd::vector& constructionNodeables , const AZStd::vector>& constructionInputVariables , const AZStd::vector>& entityIds) const { @@ -766,12 +767,12 @@ namespace ScriptCanvas const void* nodeableAsVoidPtr = nodeable; auto iter = AZStd::find_if - ( m_nodeablesByNode.begin() + (m_nodeablesByNode.begin() , m_nodeablesByNode.end() - , [&](const auto& candidate) - { - return candidate.second->m_nodeable->m_datum.GetAsDanger() == nodeableAsVoidPtr; - }); + , [&](const auto& candidate) + { + return candidate.second->m_nodeable->m_datum.GetAsDanger() == nodeableAsVoidPtr; + }); if (iter != m_nodeablesByNode.end()) { @@ -784,7 +785,7 @@ namespace ScriptCanvas for (const auto& variable : entityIds) { - auto iter = AZStd::find_if( m_variables.begin(), m_variables.end(), [&](const auto& candidate) { + auto iter = AZStd::find_if(m_variables.begin(), m_variables.end(), [&](const auto& candidate) { if (candidate->m_datum.GetType() == Data::Type::EntityID()) { bool isVariableIdMatch = candidate->m_sourceVariableId == variable.first; @@ -836,7 +837,7 @@ namespace ScriptCanvas { ExecutionTreePtr child = AZStd::make_shared(); child->SetParent(parent); - child->SetId({node, slot}); + child->SetId({ node, slot }); child->SetScope(parent ? parent->ModScope() : m_graphScope); return child; } @@ -944,7 +945,7 @@ namespace ScriptCanvas AddError(node.GetEntityId(), nullptr, ParseErrors::EventNodeConnectCallMalformed); return false; } - + auto azEventNode = azrtti_cast(&node); if (!azEventNode) { @@ -1081,7 +1082,7 @@ namespace ScriptCanvas { // Node output is input data to a function definition OutputAssignmentPtr output = CreateOutput(execution, outputSlot, {}, "input"); - + if (auto variable = FindReferencedVariableChecked(execution, outputSlot)) { output->m_assignments.push_back(variable); @@ -1222,11 +1223,11 @@ namespace ScriptCanvas if (m_uniqueInNames.contains(displayName)) { AddError - ( nodeling->GetEntityId() + (nodeling->GetEntityId() , nullptr , AZStd::string::format - ( "%s is the name of multiple In Nodelings in a subgraph,\n" - "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); + ("%s is the name of multiple In Nodelings in a subgraph,\n" + "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); return; } else @@ -1258,8 +1259,8 @@ namespace ScriptCanvas AddError(nodeling->GetEntityId() , nullptr , AZStd::string::format - ( "%s is the name of multiple In Nodelings in a subgraph,\n" - "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); + ("%s is the name of multiple In Nodelings in a subgraph,\n" + "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); } else { @@ -1354,7 +1355,7 @@ namespace ScriptCanvas if (ExecutionContainsCycles(node, outSlot)) { AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format - ( "Execution cycle detected (see connections to %s-%s. Use a looping node like While or For" + ("Execution cycle detected (see connections to %s-%s. Use a looping node like While or For" , node.GetDebugName().data(), outSlot.GetName().data()).data())); return true; @@ -1368,12 +1369,12 @@ namespace ScriptCanvas AbstractCodeModel::ReturnValueConnections AbstractCodeModel::FindAssignments(ExecutionTreeConstPtr execution, const Slot& output) { ReturnValueConnections connections; - + if (auto variable = FindReferencedVariableChecked(execution, output)) { connections.m_returnValuesOrReferences.push_back(variable); } - + auto connectedNodes = execution->GetId().m_node->GetConnectedNodes(output); bool isAtLeastOneReturnValueFound = false; @@ -1453,8 +1454,7 @@ namespace ScriptCanvas { result.m_mostParent = outputSource; } - } - while (childSequenceIndex); + } while (childSequenceIndex); } } @@ -1477,7 +1477,7 @@ namespace ScriptCanvas return slot && candidate.second == slot; }); - return iter != scriptCanvasNodesConnectedToInput.end() ? *iter : EndpointResolved{nullptr, nullptr}; + return iter != scriptCanvasNodesConnectedToInput.end() ? *iter : EndpointResolved{ nullptr, nullptr }; }; for (size_t childIndex = 0; childIndex < outputSource->GetChildrenCount(); ++childIndex) @@ -1543,8 +1543,8 @@ namespace ScriptCanvas for (const auto& otherConnections : scriptCanvasNodesConnectedToInput) { if (otherConnections.first == outputSCNode - && otherConnections.second != outputSlot - && InSimultaneousDataPath(*outputSCNode, *otherConnections.second, *outputSlot)) + && otherConnections.second != outputSlot + && InSimultaneousDataPath(*outputSCNode, *otherConnections.second, *outputSlot)) { AddError(executionWithInput->GetId().m_node->GetEntityId(), executionWithInput, ParseErrors::MultipleSimulaneousInputValues); } @@ -1570,7 +1570,7 @@ namespace ScriptCanvas VariableConstPtr AbstractCodeModel::FindVariable(const AZ::EntityId& sourceNodeId) const { auto resultIter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&sourceNodeId](const VariableConstPtr& candidate) { return candidate->m_nodeableNodeId == sourceNodeId; }); @@ -1580,7 +1580,7 @@ namespace ScriptCanvas VariableConstPtr AbstractCodeModel::FindVariable(const VariableId& sourceVariableId) const { auto resultIter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&sourceVariableId](const VariableConstPtr& candidate) { return candidate->m_sourceVariableId == sourceVariableId; }); @@ -1591,7 +1591,7 @@ namespace ScriptCanvas { if (IsUserNodeable(variable)) { - auto iter = AZStd::find_if(m_nodeablesByNode.begin(), m_nodeablesByNode.end(), [&variable](auto& candidate){ return candidate.second->m_nodeable == variable; }); + auto iter = AZStd::find_if(m_nodeablesByNode.begin(), m_nodeablesByNode.end(), [&variable](auto& candidate) { return candidate.second->m_nodeable == variable; }); if (iter != m_nodeablesByNode.end()) { return iter->second->m_simpleName; @@ -1604,7 +1604,7 @@ namespace ScriptCanvas const AZStd::pair* AbstractCodeModel::FindStaticVariable(VariableConstPtr variable) const { auto iter = AZStd::find_if - ( m_staticVariableNames.begin() + (m_staticVariableNames.begin() , m_staticVariableNames.end() , [&](const auto& candidate) { return candidate.first == variable; }); @@ -1622,7 +1622,7 @@ namespace ScriptCanvas else { const_cast(this)->AddError(execution, aznew ParseError(slot.GetNodeId(), AZStd::string::format - ( "Failed to find member variable for Variable Reference in slot: %s Id: %s" + ("Failed to find member variable for Variable Reference in slot: %s Id: %s" , slot.GetName().data() , slot.GetVariableReference().ToString().data()))); } @@ -1965,7 +1965,7 @@ namespace ScriptCanvas return {}; } - + AZStd::sys_time_t AbstractCodeModel::GetParseDuration() const { return m_parseDuration; @@ -2091,7 +2091,7 @@ namespace ScriptCanvas { const AZStd::vector& slots = outcome.GetValue(); if (AZStd::find(slots.begin(), slots.end(), &reference) != slots.end() - && AZStd::find(slots.begin(), slots.end(), &candidate) != slots.end()) + && AZStd::find(slots.begin(), slots.end(), &candidate) != slots.end()) { return true; } @@ -2165,7 +2165,7 @@ namespace ScriptCanvas if (m_start) { - roots.push_back(m_start); + roots.push_back(m_start); } for (auto& nodeableParse : m_nodeablesByNode) @@ -2237,7 +2237,7 @@ namespace ScriptCanvas { ExecutionTreePtr child = CreateChild(parent, node, outSlot); child->SetScope(AZStd::make_shared()); - child->ModScope()->m_parent = parent ? parent->ModScope(): m_graphScope; + child->ModScope()->m_parent = parent ? parent->ModScope() : m_graphScope; return child; } @@ -2334,7 +2334,7 @@ namespace ScriptCanvas AddError(nullptr, ValidationConstPtr(aznew InactiveGraph())); } } - else + else { MarkParseStop(); @@ -2629,9 +2629,9 @@ namespace ScriptCanvas // create a variable declaration ExecutionTreePtr variableConstruction = CreateChild(inPreviouslyExecutedScopeResult.m_mostParent->ModParent(), nullptr, nullptr); - variableConstruction->AddInput({ nullptr , newInputResultOfAssignment, DebugDataSource::FromInternal()}); + variableConstruction->AddInput({ nullptr , newInputResultOfAssignment, DebugDataSource::FromInternal() }); variableConstruction->SetSymbol(Symbol::VariableDeclaration); - + // splice the variable declaration right before the most parent for loop is executed auto positionOutcome = mostForLoopParent->RemoveChild(inPreviouslyExecutedScopeResult.m_mostParent); if (!positionOutcome.IsSuccess()) @@ -2701,7 +2701,7 @@ namespace ScriptCanvas case VariableConstructionRequirement::InputVariable: { - auto variableID = variable->m_sourceVariableId.IsValid() ? variable->m_sourceVariableId : VariableId::MakeVariableId(); + auto variableID = variable->m_sourceVariableId.IsValid() ? variable->m_sourceVariableId : MakeParserGeneratedId(m_generatedIdCount++); inputVariableIds.push_back(variableID); inputVariablesById.insert({ variableID, variable }); // sort revealed a datum copy issue: type is not preserved, workaround below @@ -2755,7 +2755,7 @@ namespace ScriptCanvas { auto& localStatics = ModStaticVariablesNames(staticVariable->m_source); auto iter = AZStd::find_if - ( localStatics.begin() + (localStatics.begin() , localStatics.end() , [&](const auto& candidate) { return candidate.first == staticVariable; }); @@ -2834,16 +2834,16 @@ namespace ScriptCanvas { switch (execution->GetSymbol()) { - // nothing required + // nothing required case Symbol::PlaceHolderDuringParsing: break; - // out and return value information + // out and return value information case Symbol::FunctionDefinition: AddDebugInformationFunctionDefinition(execution); break; - // add in out everything + // add in out everything case Symbol::ForEach: case Symbol::FunctionCall: case Symbol::OperatorAddition: @@ -2857,7 +2857,7 @@ namespace ScriptCanvas AddDebugInformationOut(execution); break; - // add in but not out + // add in but not out case Symbol::Break: case Symbol::LogicalAND: case Symbol::LogicalNOT: @@ -2871,8 +2871,8 @@ namespace ScriptCanvas AddDebugInformationIn(execution); break; - // add in-debug-info if the if condition is NOT prefixed with logic or comparison expression (which will have the in-debug-info) - // add out-debug-info in all cases including including empty cases + // add in-debug-info if the if condition is NOT prefixed with logic or comparison expression (which will have the in-debug-info) + // add out-debug-info in all cases including including empty cases case Symbol::IfCondition: if (!(execution->GetId().m_node->IsIfBranchPrefacedWithBooleanExpression())) { @@ -2900,7 +2900,7 @@ namespace ScriptCanvas if (dependencies.userSubgraphs.find(m_source.m_namespacePath) != dependencies.userSubgraphs.end()) { AZStd::string circularDependency = AZStd::string::format - ( ParseErrors::CircularDependencyFormat + (ParseErrors::CircularDependencyFormat , m_source.m_name.data() , node.GetDebugName().data() , m_source.m_name.data()); @@ -2908,6 +2908,7 @@ namespace ScriptCanvas AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), circularDependency)); } + // #functions2 make this use an identifier for the node, for property window display and easier find/replace updates // this part must NOT recurse, the dependency tree should remain a tree and not be flattened m_orderedDependencies.source.MergeWith(dependencies); } @@ -2950,11 +2951,32 @@ namespace ScriptCanvas { if (!input->m_sourceVariableId.IsValid() && IsEntityIdThatRequiresRuntimeRemap(input)) { - input->m_sourceVariableId = VariableId::MakeVariableId(); + input->m_sourceVariableId = MakeParserGeneratedId(m_generatedIdCount++); input->m_source = nullptr; // promote to member variable for at this stage, optimizations on data flow will occur later input->m_isMember = true; - input->m_name = m_graphScope->AddVariableName(input->m_name); + + AZStd::string entityVariableName; + + if (slotAndVariable.m_slot) + { + if (execution->GetId().m_node) + { + entityVariableName.append(execution->GetId().m_node->GetNodeName()); + entityVariableName.append("."); + entityVariableName.append(slotAndVariable.m_slot->GetName()); + } + else + { + entityVariableName.append(slotAndVariable.m_slot->GetName()); + } + } + else + { + entityVariableName = input->m_name; + } + + input->m_name = m_graphScope->AddVariableName(entityVariableName); AddVariable(input); } } @@ -3020,11 +3042,11 @@ namespace ScriptCanvas CullUnusedVariables(); if (allRootsArePure - && m_ebusHandlingByNode.empty() - && m_eventHandlingByNode.empty() - && m_nodeablesByNode.empty() - && m_variableWriteHandlingByVariable.empty() - && m_subgraphInterface.IsParsedPure()) + && m_ebusHandlingByNode.empty() + && m_eventHandlingByNode.empty() + && m_nodeablesByNode.empty() + && m_variableWriteHandlingByVariable.empty() + && m_subgraphInterface.IsParsedPure()) { if (m_start) { @@ -3077,7 +3099,7 @@ namespace ScriptCanvas void AbstractCodeModel::ParseExecutionLoop(ExecutionTreePtr executionLoop) { AddDebugInfiniteLoopDetectionInLoop(executionLoop); - + auto loopSlot = executionLoop->GetId().m_node->GetSlot(executionLoop->GetId().m_node->GetLoopSlotId()); AZ_Assert(loopSlot, "Node did not return a valid loop slot"); ExecutionTreePtr executionLoopBody = OpenScope(executionLoop, executionLoop->GetId().m_node, loopSlot); @@ -3255,7 +3277,7 @@ namespace ScriptCanvas } else if (numConnections == 1) { - ParseExecutionFunctionRecurse(execution, execution->ModChild(0), outSlot, executionOutNodes[0]); + ParseExecutionFunctionRecurse(execution, execution->ModChild(0), outSlot, executionOutNodes[0]); } else { @@ -3762,7 +3784,7 @@ namespace ScriptCanvas trueValue->m_source = once; trueValue->m_datum = Datum(Data::BooleanType(true)); once->AddInput({ nullptr, trueValue, DebugDataSource::FromInternal() }); - + ExecutionTreePtr onReset = CreateChild(once, once->GetId().m_node, onceResetSlot); onReset->SetSymbol(Symbol::PlaceHolderDuringParsing); onReset->MarkInputOutputPreprocessed(); @@ -3849,7 +3871,7 @@ namespace ScriptCanvas executionSwitch->SetSymbol(Symbol::Switch); ParseExecutionSequentialChildren(executionSwitch); } - + // the execution will already have its function definition defined, this will create the body of that function void AbstractCodeModel::ParseExecutionTreeBody(ExecutionTreePtr execution, const Slot& outSlot) { @@ -4112,7 +4134,7 @@ namespace ScriptCanvas { auto& userFunctionNode = *userFunctionIter->first; auto outSlots = userFunctionNode.GetSlotsByType(CombinedSlotType::ExecutionOut); - + if (outSlots.empty() || !outSlots.front()) { AddError(userFunctionNode.GetEntityId(), nullptr, ScriptCanvas::ParseErrors::NoOutSlotInFunctionDefinitionStart); @@ -4179,7 +4201,7 @@ namespace ScriptCanvas auto onceControl = AddMemberVariable(Datum(Data::BooleanType(true)), "onceControl"); m_controlVariablesBySourceNode.insert({ &node, onceControl }); } - else + else { const auto nodelingType = CheckNodelingType(node); if (nodelingType != NodelingType::None) @@ -4208,7 +4230,7 @@ namespace ScriptCanvas { const VariableId assignedFromId = execution->GetId().m_node->GetVariableIdRead(execution->GetId().m_slot); auto variableRead = assignedFromId.IsValid() ? FindVariable(assignedFromId) : nullptr; - + if (variableRead) { // nullptr is acceptable here @@ -4314,7 +4336,7 @@ namespace ScriptCanvas for (auto sourceNodeAndSlot : nodes) { AddError(nullptr, aznew ScopedDataConnectionEvent - ( execution->GetNodeId() + (execution->GetNodeId() , targetNode , targetSlot , *sourceNodeAndSlot.first @@ -4324,7 +4346,7 @@ namespace ScriptCanvas } } } - + bool AbstractCodeModel::ParseInputThisPointer(ExecutionTreePtr execution) { auto node = execution->GetId().m_node; @@ -4364,7 +4386,7 @@ namespace ScriptCanvas { auto node2 = execution->GetId().m_node; AddError(execution, aznew ParseError(node2->GetEntityId(), AZStd::string::format - ( "Failed to find member variable for Node: %s Id: %s" + ("Failed to find member variable for Node: %s Id: %s" , node2->GetNodeName().data() , node2->GetEntityId().ToString().data()).data())); } @@ -4394,7 +4416,7 @@ namespace ScriptCanvas { auto node2 = execution->GetId().m_node; AddError(execution, aznew ParseError(node2->GetEntityId(), AZStd::string::format - ( "Failed to find member variable for Node: %s Id: %s" + ("Failed to find member variable for Node: %s Id: %s" , node2->GetNodeName().data() , node2->GetEntityId().ToString().data()).data())); } @@ -4451,10 +4473,10 @@ namespace ScriptCanvas } ExecutionChild* executionChildInParent = &parent->ModChild(indexInParentCall); - + const size_t executionInputCount = execution->GetInputCount(); const size_t thisInputOffset = execution->InputHasThisPointer() ? 1 : 0; - + // the original index has ALL the input from the slots on the node // create multiple calls with separate function call nodes, but ONLY take the inputs required // as indicated by the function call info @@ -4811,7 +4833,7 @@ namespace ScriptCanvas } } } - + void AbstractCodeModel::ParseReturnValue(ExecutionTreePtr execution, const Slot& returnValueSlot) { if (auto variable = FindReferencedVariableChecked(execution, returnValueSlot)) @@ -4862,9 +4884,9 @@ namespace ScriptCanvas { ParseUserIn(iter.second, iter.first); } - + m_userInsThatRequireTopology.clear(); - + ParseUserOuts(); auto parseOutcome = m_subgraphInterface.Parse(); @@ -4920,7 +4942,7 @@ namespace ScriptCanvas AddError(root, aznew Internal::ParseError(AZ::EntityId(), "In Nodeling didn't parse properly, there were still leaves without nodelings in the execution tree.")); return; } - } + } auto& outCallsChecked = listenerCheck.GetOutCalls(); if (!result.addSingleOutToMap && outCallsChecked.empty()) @@ -4968,8 +4990,8 @@ namespace ScriptCanvas } if ((!root->HasExplicitUserOutCalls()) - && root->GetReturnValueCount() > 0 - && branches > 1) + && root->GetReturnValueCount() > 0 + && branches > 1) { AddError(root->GetNodeId(), root, ScriptCanvas::ParseErrors::TooManyBranchesForReturn); return; @@ -5005,7 +5027,7 @@ namespace ScriptCanvas AZStd::pair returnValue = execution->GetReturnValue(execution->GetReturnValueCount() - 1); AZStd::const_pointer_cast(returnValue.second)->m_isNewValue = true; } - } + } } } @@ -5029,7 +5051,7 @@ namespace ScriptCanvas result.addExplicitOutCalls = nodelingsOutCount > 1; result.isSimpleFunction = !result.addExplicitOutCalls; } - else + else { // user explicitly defined at least 1 Out and there are execution leaves without Outs, so we provide an Out to any missing ones result.addSingleOutToMap = true; @@ -5037,7 +5059,7 @@ namespace ScriptCanvas result.addExplicitOutCalls = true; result.isSimpleFunction = false; } - + return result; } @@ -5058,41 +5080,41 @@ namespace ScriptCanvas void AbstractCodeModel::ParseUserLatentData(ExecutionTreePtr execution) { - if (execution->IsOnLatentPath()) - { - if (execution->GetChildrenCount() == 0) - { - execution->AddChild({ nullptr, {}, nullptr }); - } - - auto& executionChild = execution->ModChild(0); - - // inputs are return values expected from the latent out call - for (auto& returnValue : FindUserLatentReturnValues(execution)) - { - // if there are return values, we can continue execution after - // the nodeling out that is in the path (disable the contract) - // and we must make sure there's ONLY ONE - // and no immediate ins - auto outputAssignment = CreateOutputAssignment(returnValue); - executionChild.m_output.push_back({ nullptr, outputAssignment }); - } - - auto methodRoot = execution->ModRoot(); - - // outputs are inputs to the latent out call - for (auto& inputValue : FindUserLatentOutput(execution)) - { - inputValue->m_source = methodRoot; - execution->AddInput({ nullptr, inputValue, DebugDataSource::FromVariable(SlotId{}, inputValue->m_datum.GetType(), inputValue->m_sourceVariableId) }); - } - - methodRoot->CopyInput(execution, ExecutionTree::RemapVariableSource::No); - } - else - { - AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), "immediate execution parsed data in latent thread")); - } + if (execution->IsOnLatentPath()) + { + if (execution->GetChildrenCount() == 0) + { + execution->AddChild({ nullptr, {}, nullptr }); + } + + auto& executionChild = execution->ModChild(0); + + // inputs are return values expected from the latent out call + for (auto& returnValue : FindUserLatentReturnValues(execution)) + { + // if there are return values, we can continue execution after + // the nodeling out that is in the path (disable the contract) + // and we must make sure there's ONLY ONE + // and no immediate ins + auto outputAssignment = CreateOutputAssignment(returnValue); + executionChild.m_output.push_back({ nullptr, outputAssignment }); + } + + auto methodRoot = execution->ModRoot(); + + // outputs are inputs to the latent out call + for (auto& inputValue : FindUserLatentOutput(execution)) + { + inputValue->m_source = methodRoot; + execution->AddInput({ nullptr, inputValue, DebugDataSource::FromVariable(SlotId{}, inputValue->m_datum.GetType(), inputValue->m_sourceVariableId) }); + } + + methodRoot->CopyInput(execution, ExecutionTree::RemapVariableSource::No); + } + else + { + AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), "immediate execution parsed data in latent thread")); + } } void AbstractCodeModel::ParseUserOutCall(ExecutionTreePtr execution) @@ -5164,7 +5186,7 @@ namespace ScriptCanvas if (!IsConnectedToUserIn(nodeling)) { const auto report = AZStd::string::format - ( "Nodeling Out (%s) not connected to Nodeling In, functionality cannot be executed", nodeling->GetDisplayName().data()); + ("Nodeling Out (%s) not connected to Nodeling In, functionality cannot be executed", nodeling->GetDisplayName().data()); AddError(nullptr, aznew Internal::ParseError(nodeling->GetEntityId(), report)); } @@ -5172,7 +5194,7 @@ namespace ScriptCanvas else { const auto report = AZStd::string::format - ("null nodeling in immediate out list"); + ("null nodeling in immediate out list"); AddError(nullptr, aznew Internal::ParseError(nodeling->GetEntityId(), report)); } @@ -5220,7 +5242,7 @@ namespace ScriptCanvas { auto& localStatics = ModStaticVariablesNames(execution); auto iter = AZStd::find_if - (localStatics.begin() + (localStatics.begin() , localStatics.end() , [&](const auto& candidate) { return candidate.first == variable; }); @@ -5285,7 +5307,7 @@ namespace ScriptCanvas RemoveFromTree(noOpChild); } } - + void AbstractCodeModel::RemoveFromTree(ExecutionTreePtr execution) { if (!execution->GetParent()) @@ -5304,7 +5326,7 @@ namespace ScriptCanvas { AddError(execution->GetNodeId(), execution, ScriptCanvas::ParseErrors::RequiredOutputRemoved); } - + if (childCount != 0) { if (childCount > 1) @@ -5332,7 +5354,7 @@ namespace ScriptCanvas execution->Clear(); } - + AZ::Outcome> AbstractCodeModel::RemoveChild(const ExecutionTreePtr& execution, const ExecutionTreeConstPtr& child) { return execution->RemoveChild(child); @@ -5342,7 +5364,5 @@ namespace ScriptCanvas { return type == Data::eType::BehaviorContextObject; } - } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h index c0ef720fbe..f87913d47a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -71,7 +71,7 @@ namespace ScriptCanvas AZStd::optional> CheckUserNodeableDependencyConstructionIndex(VariableConstPtr nodeable) const; AZStd::vector CombineVariableLists - ( const AZStd::vector& constructionNodeables + (const AZStd::vector& constructionNodeables , const AZStd::vector>& constructionInputVariableIds , const AZStd::vector>& entityIds) const; @@ -120,7 +120,7 @@ namespace ScriptCanvas const ParsedRuntimeInputs& GetRuntimeInputs() const; const Source& GetSource() const; - + const AZStd::string& GetSourceString() const; ExecutionTreeConstPtr GetStart() const; @@ -150,21 +150,19 @@ namespace ScriptCanvas bool IsUserNodeable(VariableConstPtr variable) const; - bool HasUserNodeableDependenciesInVariables() const; - template AZStd::vector ToVariableList(const AZStd::vector>& source) const; private: - ////////////////////////////////////////////////////////////////////////// - // Internal parsing - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // Internal parsing + ////////////////////////////////////////////////////////////////////////// struct ReturnValueConnections { bool m_hasOtherConnections = false; AZStd::vector m_returnValuesOrReferences; }; - + void AddAllVariablesPreParse(); void AddAllVariablesPreParse_LegacyFunctions(); @@ -210,7 +208,7 @@ namespace ScriptCanvas bool CheckCreateRoot(const Node& node); AZStd::string CheckUniqueInterfaceNames - ( AZStd::string_view candidate + (AZStd::string_view candidate , AZStd::string_view defaultName , AZStd::unordered_set& uniqueNames , const AZStd::unordered_set& nodelingsOut); @@ -340,7 +338,7 @@ namespace ScriptCanvas void ParseExecutionLogicalExpression(ExecutionTreePtr execution, Symbol symbol); void ParseExecutionLoop(ExecutionTreePtr execution); - + void ParseExecutionMultipleOutSyntaxSugar(ExecutionTreePtr execution, const EndpointsResolved& executionOutNodes, const AZStd::vector& outSlots); void ParseExecutionMultipleOutSyntaxSugarOfSequencNode(ExecutionTreePtr sequence); @@ -428,7 +426,7 @@ namespace ScriptCanvas void PruneNoOpChildren(const ExecutionTreePtr& execution); AZ::Outcome> RemoveChild(const ExecutionTreePtr& execution, const ExecutionTreeConstPtr& child); - + void RemoveFromTree(ExecutionTreePtr execution); struct ConnectionInPreviouslyExecutedScope @@ -473,7 +471,7 @@ namespace ScriptCanvas } void AddExecutionMapIn - ( UserInParseTopologyResult result + (UserInParseTopologyResult result , ExecutionTreeConstPtr root , const AZStd::vector& outCalls , AZStd::string_view defaultOutName @@ -505,6 +503,7 @@ namespace ScriptCanvas static UserInParseTopologyResult ParseUserInTolopology(size_t nodelingsOutCount, size_t leavesWithoutNodelingsCount); size_t m_outIndexCount = 0; + size_t m_generatedIdCount = 0; ExecutionTreePtr m_start; AZStd::vector m_startNodes; ScopePtr m_graphScope; @@ -513,7 +512,7 @@ namespace ScriptCanvas AZStd::unordered_set m_userNodeables; AZStd::unordered_map m_dependencyByVariable; - + AZStd::vector m_variables; AZStd::vector m_possibleExecutionRoots; @@ -621,7 +620,7 @@ namespace ScriptCanvas for (const auto& variable : source) { auto iter = AZStd::find_if - ( m_variables.begin() + (m_variables.begin() , m_variables.end() , [&](const auto& candidate) { return candidate->m_sourceVariableId == variable.first; }); @@ -633,7 +632,5 @@ namespace ScriptCanvas return variables; } - - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp index 43d0823b25..2a3801ba26 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -47,6 +47,10 @@ namespace ParsingUtilitiesCpp using namespace ScriptCanvas; using namespace ScriptCanvas::Grammar; + const AZ::u64 k_parserGeneratedMask = 0x7FC0616C94E7465F; + const size_t k_maskIndex = 0; + const size_t k_countIndex = 1; + class PrettyPrinter : public ExecutionTreeTraversalListener { @@ -85,7 +89,7 @@ namespace ParsingUtilitiesCpp { m_result += AZStd::string::format(" # children: %zu", childCount); } - + if (m_marker == execution) { m_result += " <<<< MARKER <<<< "; @@ -97,7 +101,7 @@ namespace ParsingUtilitiesCpp m_result += "\n"; } - void EvaluateRoot(ExecutionTreeConstPtr node, const Slot* ) + void EvaluateRoot(ExecutionTreeConstPtr node, const Slot*) { m_result += "\nRoot:\n"; } @@ -356,7 +360,7 @@ namespace ScriptCanvas else if (nodeling->IsExecutionExit()) { return NodelingType::Out; - } + } } return NodelingType::None; @@ -785,7 +789,7 @@ namespace ScriptCanvas { return execution->GetInputCount() > index && ((execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction) - || (execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction)); + || (execution->GetInput(index).m_value->m_datum.GetAs() && *execution->GetInput(index).m_value->m_datum.GetAs() == GraphOwnerId && !execution->GetInput(index).m_value->m_isExposedToConstruction)); } bool IsIsNull(const ExecutionTreeConstPtr& execution) @@ -855,7 +859,7 @@ namespace ScriptCanvas return true; } } - + return IsMidSequence(parent); } @@ -1001,10 +1005,16 @@ namespace ScriptCanvas return true; } + bool IsParserGeneratedId(const ScriptCanvas::VariableId& id) + { + using namespace ParsingUtilitiesCpp; + return reinterpret_cast(id.m_id.data)[k_maskIndex] == k_parserGeneratedMask; + } + bool IsPropertyExtractionSlot(const ExecutionTreeConstPtr& execution, const Slot* outputSlot) { auto iter = AZStd::find_if - ( execution->GetPropertyExtractionSources().begin() + (execution->GetPropertyExtractionSources().begin() , execution->GetPropertyExtractionSources().end() , [&](const auto& iter) { return iter.first == outputSlot; }); @@ -1052,9 +1062,9 @@ namespace ScriptCanvas bool IsSequenceNode(const ExecutionTreeConstPtr& execution) { return (IsSequenceNode(execution->GetId().m_node) - && execution->GetId().m_slot->GetType() == CombinedSlotType::ExecutionIn); + && execution->GetId().m_slot->GetType() == CombinedSlotType::ExecutionIn); } - + bool IsSwitchStatement(const ExecutionTreeConstPtr& execution) { return execution->GetId().m_node->IsSwitchStatement() @@ -1120,6 +1130,16 @@ namespace ScriptCanvas return AZStd::string::format("%s%s", k_memberNamePrefix, name.data()); } + VariableId MakeParserGeneratedId(size_t count) + { + using namespace ParsingUtilitiesCpp; + + AZ::Uuid parserGenerated; + reinterpret_cast(parserGenerated.data)[k_maskIndex] = k_parserGeneratedMask; + reinterpret_cast(parserGenerated.data)[k_countIndex] = count; + return ScriptCanvas::VariableId(parserGenerated); + } + VariableConstructionRequirement ParseConstructionRequirement(VariableConstPtr variable) { if (IsEntityIdThatRequiresRuntimeRemap(variable)) @@ -1216,7 +1236,7 @@ namespace ScriptCanvas result += AZStd::string::format("Variable: %s, Type: %s, Scope: %s, \n" , variable->m_name.data() , Data::GetName(variable->m_datum.GetType()).data() - , variable->m_isMember ? "Member" : "Local" ); + , variable->m_isMember ? "Member" : "Local"); } auto roots = model.GetAllExecutionRoots(); @@ -1261,11 +1281,11 @@ namespace ScriptCanvas bool RequiresRuntimeRemap(const AZ::EntityId& entityId) { - return entityId.IsValid() + return entityId.IsValid() && entityId != UniqueId && entityId != GraphOwnerId; } - + AZStd::string SlotNameToIndexString(const Slot& slot) { auto indexString = slot.GetName(); @@ -1445,5 +1465,5 @@ namespace ScriptCanvas } } } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h index d264983e03..a1c6ac0e44 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingUtilities.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -113,7 +113,7 @@ namespace ScriptCanvas bool IsInfiniteSelfEntityActivationLoop(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); bool IsInfiniteSelfEntityActivationLoopRecurse(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); - + bool IsInfiniteVariableWriteHandlingLoop(const AbstractCodeModel& model, VariableWriteHandlingPtr variableHandling, ExecutionTreeConstPtr execution, bool isConnected); bool IsInLoop(const ExecutionTreeConstPtr& execution); @@ -144,6 +144,8 @@ namespace ScriptCanvas bool IsOnSelfEntityActivated(const AbstractCodeModel& model, ExecutionTreeConstPtr execution); + bool IsParserGeneratedId(const VariableId& id); + bool IsPropertyExtractionSlot(const ExecutionTreeConstPtr& execution, const Slot* outputSlot); bool IsPropertyExtractionNode(const ExecutionTreeConstPtr& execution); @@ -178,6 +180,8 @@ namespace ScriptCanvas bool IsWrittenMathExpression(const ExecutionTreeConstPtr& execution); + VariableId MakeParserGeneratedId(size_t count); + AZStd::string MakeMemberVariableName(AZStd::string_view name); VariableConstructionRequirement ParseConstructionRequirement(Grammar::VariableConstPtr value); @@ -203,6 +207,5 @@ namespace ScriptCanvas void TraverseTree(const AbstractCodeModel& execution, ExecutionTreeTraversalListener& listener); void TraverseTree(const ExecutionTreeConstPtr& execution, ExecutionTreeTraversalListener& listener); - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp index 82d93ac45e..b1e58cac54 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Primitives.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -99,9 +99,9 @@ namespace ScriptCanvas m_inputs.clear(); m_outputs.clear(); } - + bool FunctionPrototype::IsVoid() const - { + { return m_outputs.empty(); } @@ -200,24 +200,23 @@ namespace ScriptCanvas baseName.append(suffix); return AddVariableName(baseName); } - + AZ::s32 Scope::AddNameCount(AZStd::string_view name) { AZ::s32 count = -1; ScopePtr ns = shared_from_this(); - + do { auto iter = ns->m_baseNameToCount.find(name); - + if (iter != ns->m_baseNameToCount.end()) { // a basename has been found in current or parent scope, get the latest count count = iter->second; break; } - } - while ((ns = AZStd::const_pointer_cast(ns->m_parent))); + } while ((ns = AZStd::const_pointer_cast(ns->m_parent))); auto iter = m_baseNameToCount.find(name); if (iter == m_baseNameToCount.end()) @@ -235,7 +234,7 @@ namespace ScriptCanvas const VariableData Source::k_emptyVardata{}; Source::Source - ( const Graph& graph + (const Graph& graph , const AZ::Data::AssetId& id , const GraphData& graphData , const VariableData& variableData @@ -277,8 +276,8 @@ namespace ScriptCanvas AzFramework::StringFunc::Path::StripExtension(namespacePath); return AZ::Success(Source - ( *request.graph - , request.assetId + (*request.graph + , request.scriptAssetId , *graphData , *sourceVariableData , name @@ -294,23 +293,23 @@ namespace ScriptCanvas } Variable::Variable(Datum&& datum) - : m_datum(datum) + : m_datum(datum) {} - + Variable::Variable(const Datum& datum, const AZStd::string& name, TraitsFlags traitsFlags) : m_datum(datum) , m_name(name) - , m_isConst(traitsFlags & TraitsFlags::Const) - , m_isMember(traitsFlags & TraitsFlags::Member) + , m_isConst(traitsFlags& TraitsFlags::Const) + , m_isMember(traitsFlags& TraitsFlags::Member) {} Variable::Variable(Datum&& datum, AZStd::string&& name, TraitsFlags&& traitsFlags) : m_datum(datum) , m_name(name) - , m_isConst(traitsFlags & TraitsFlags::Const) - , m_isMember(traitsFlags & TraitsFlags::Member) + , m_isConst(traitsFlags& TraitsFlags::Const) + , m_isMember(traitsFlags& TraitsFlags::Member) {} - + void Variable::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) @@ -339,5 +338,5 @@ namespace ScriptCanvas m_variable = nullptr; m_connectionVariable = nullptr; } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp index 9a164cd339..d57aa9d621 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -12,7 +12,9 @@ namespace ScriptCanvas namespace Grammar { AZ_CVAR(bool, g_disableParseOnGraphValidation, false, {}, AZ::ConsoleFunctorFlags::Null, "In case parsing the graph is interfering with opening a graph, disable parsing on validation"); - AZ_CVAR(bool, g_printAbstractCodeModel, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing for debug purposes."); - AZ_CVAR(bool, g_saveRawTranslationOuputToFile, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes."); + AZ_CVAR(bool, g_printAbstractCodeModel, true, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing for debug purposes."); + AZ_CVAR(bool, g_printAbstractCodeModelAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing (at prefab time) for debug purposes."); + AZ_CVAR(bool, g_saveRawTranslationOuputToFile, true, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes."); + AZ_CVAR(bool, g_saveRawTranslationOuputToFileAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation (at prefab time) for debug purposes."); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h index 95c57b3211..0923f32771 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -108,7 +108,7 @@ namespace ScriptCanvas constexpr const char* k_InitializeExecutionOutByRequiredCountName = "InitializeExecutionOutByRequiredCount"; constexpr const char* k_InterpretedConfigurationPerformance = "SCRIPT_CANVAS_GLOBAL_PERFORMANCE"; constexpr const char* k_InterpretedConfigurationRelease = "SCRIPT_CANVAS_GLOBAL_RELEASE"; - + constexpr const char* k_NodeableCallInterpretedOut = "ExecutionOut"; constexpr const char* k_NodeableUserBaseClassName = "Nodeable"; constexpr const char* k_NodeableSetExecutionOutName = "SetExecutionOut"; @@ -120,7 +120,7 @@ namespace ScriptCanvas constexpr const char* k_OnGraphStartFunctionName = "OnGraphStart"; constexpr const char* k_OverrideNodeableMetatableName = "OverrideNodeableMetatable"; - + constexpr const char* k_stringFormatLexicalScopeName = "string"; constexpr const char* k_stringFormatName = "format"; @@ -139,7 +139,7 @@ namespace ScriptCanvas constexpr const char* k_DependentAssetsIndexArgName = "dependentAssetsIndex"; constexpr const char* k_UnpackDependencyConstructionArgsFunctionName = "UnpackDependencyConstructionArgs"; constexpr const char* k_UnpackDependencyConstructionArgsLeafFunctionName = "UnpackDependencyConstructionArgsLeaf"; - + enum class ExecutionCharacteristics : AZ::u32 { Object, @@ -147,7 +147,7 @@ namespace ScriptCanvas }; // default to a pure, interpreted function - enum ExecutionStateSelection : AZ::u32 + enum class ExecutionStateSelection : AZ::u32 { InterpretedPure, InterpretedPureOnGraphStart, @@ -172,7 +172,7 @@ namespace ScriptCanvas Count, }; #undef REGISTER_ENUM - + // create the Symbol strings #define REGISTER_ENUM(x) #x, static const char* g_SymbolNames[] = @@ -247,7 +247,9 @@ namespace ScriptCanvas AZ_CVAR_EXTERNED(bool, g_disableParseOnGraphValidation); AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModel); + AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModelAtPrefabTime); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFile); + AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFileAtPrefabTime); struct DependencyInfo { @@ -258,7 +260,7 @@ namespace ScriptCanvas struct Request { - AZ::Data::AssetId assetId; + AZ::Data::AssetId scriptAssetId; const Graph* graph = nullptr; AZStd::string_view name; AZStd::string_view path; @@ -291,7 +293,7 @@ namespace ScriptCanvas Source() = default; Source - ( const Graph& graph + (const Graph& graph , const AZ::Data::AssetId& id , const GraphData& graphData , const VariableData& variableData @@ -305,8 +307,8 @@ namespace ScriptCanvas AZStd::string ToTypeSafeEBusResultName(const Data::Type& type); AZStd::string ToSafeName(const AZStd::string& name); NamespacePath ToNamespacePath(AZStd::string_view path, AZStd::string_view name); - } -} + } +} namespace AZStd { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp new file mode 100644 index 0000000000..207acafd82 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include "ScriptUserDataSerializer.h" + +#include +#include + +using namespace ScriptCanvas; + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(ScriptUserDataSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result ScriptUserDataSerializer::Load + ( void* outputValue + , [[maybe_unused]] const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(outputValueTypeId == azrtti_typeid(), "ScriptUserDataSerializer Load against output typeID that was not RuntimeVariable"); + AZ_Assert(outputValue, "ScriptUserDataSerializer Load against null output"); + + auto outputVariable = reinterpret_cast(outputValue); + JsonSerializationResult::ResultCode result(JSR::Tasks::ReadField); + AZ::Uuid typeId = AZ::Uuid::CreateNull(); + + auto typeIdMember = inputValue.FindMember("$type"); + if (typeIdMember == inputValue.MemberEnd()) + { + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load the $type member"); + } + + result.Combine(LoadTypeId(typeId, typeIdMember->value, context)); + if (typeId.IsNull()) + { + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load the AZ TypeId of the value"); + } + + outputVariable->value = context.GetSerializeContext()->CreateAny(typeId); + if (outputVariable->value.empty() || outputVariable->value.type() != typeId) + { + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); + } + + result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast(&outputVariable->value), typeId, inputValue, "value", context)); + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "ScriptUserDataSerializer Store finished loading RuntimeVariable" + : "ScriptUserDataSerializer Store failed to load RuntimeVariable"); + } + + JsonSerializationResult::Result ScriptUserDataSerializer::Store + ( rapidjson::Value& outputValue + , const void* inputValue + , const void* defaultValue + , [[maybe_unused]] const Uuid& valueTypeId + , JsonSerializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(valueTypeId == azrtti_typeid(), "RuntimeVariable Store against value typeID that was not RuntimeVariable"); + AZ_Assert(inputValue, "RuntimeVariable Store against null inputValue pointer "); + + auto inputScriptDataPtr = reinterpret_cast(inputValue); + auto defaultScriptDataPtr = reinterpret_cast(defaultValue); + auto inputAnyPtr = &inputScriptDataPtr->value; + auto defaultAnyPtr = defaultScriptDataPtr ? &defaultScriptDataPtr->value : nullptr; + + if (defaultAnyPtr) + { + ScriptCanvas::Datum inputDatum(ScriptCanvas::Data::FromAZType(inputAnyPtr->type()), ScriptCanvas::Datum::eOriginality::Copy, AZStd::any_cast(inputAnyPtr), inputAnyPtr->type()); + ScriptCanvas::Datum defaultDatum(ScriptCanvas::Data::FromAZType(defaultAnyPtr->type()), ScriptCanvas::Datum::eOriginality::Copy, AZStd::any_cast(defaultAnyPtr), defaultAnyPtr->type()); + + if (inputDatum == defaultDatum) + { + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "ScriptUserDataSerializer Store used defaults for RuntimeVariable"); + } + } + + JSR::ResultCode result(JSR::Tasks::WriteValue); + outputValue.SetObject(); + + { + auto azTypeString = inputAnyPtr->type().ToString(); + rapidjson::Value typeValue; + typeValue.SetString(azTypeString.begin(), azTypeString.length(), context.GetJsonAllocator()); + result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context)); + outputValue.AddMember("$type", typeValue, context.GetJsonAllocator()); + } + + result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast(inputAnyPtr), AZStd::any_cast(defaultAnyPtr), inputAnyPtr->type(), context)); + + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "ScriptUserDataSerializer Store finished saving RuntimeVariable" + : "ScriptUserDataSerializer Store failed to save RuntimeVariable"); + } + +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h new file mode 100644 index 0000000000..781a3b74fe --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + class ScriptUserDataSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(ScriptUserDataSerializer, "{7E5FC193-8CDB-4251-A68B-F337027381DF}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + + private: + JsonSerializationResult::Result Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) override; + + JsonSerializationResult::Result Store + ( rapidjson::Value& outputValue + , const void* inputValue + , const void* defaultValue + , const Uuid& valueTypeId, JsonSerializerContext& context) override; + }; +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp index f95ed75be8..ade98042a0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToX.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -75,7 +75,7 @@ namespace ScriptCanvas { return m_model.GetSource().m_name; } - + AZStd::string_view GraphToX::GetFullPath() const { return m_model.GetSource().m_path; @@ -120,7 +120,7 @@ namespace ScriptCanvas resolution += Grammar::ToIdentifier(namespaces[index]); } } - + return resolution; } @@ -128,13 +128,13 @@ namespace ScriptCanvas { writer.Write(m_configuration.m_singleLineComment); } - + void GraphToX::OpenBlockComment(Writer& writer) { writer.WriteIndent(); writer.WriteLine(m_configuration.m_blockCommentOpen); } - + void GraphToX::OpenFunctionBlock(Writer& writer) { writer.WriteLineIndented(m_configuration.m_functionBlockOpen); @@ -162,7 +162,7 @@ namespace ScriptCanvas void GraphToX::WriteCopyright(Writer& writer) { OpenBlockComment(writer); - writer.WriteLine(GetAmazonCopyright()); + writer.WriteLine(GetCopyright()); CloseBlockComment(writer); } @@ -206,5 +206,5 @@ namespace ScriptCanvas writer.Write("Last written: "); writer.WriteLine(buffer); } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp index 96cf4c4ce0..b44e438ba0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -30,7 +30,6 @@ namespace TranslationCPP 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()) { @@ -48,13 +47,11 @@ namespace TranslationCPP { 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 @@ -96,16 +93,28 @@ namespace ScriptCanvas { namespace Translation { - Result ParseGraph(const Grammar::Request& request) + AZ::Outcome ParseGraph(const Grammar::Request& request) { AZ::Outcome sourceOutcome = Grammar::Source::Construct(request); if (!sourceOutcome.IsSuccess()) { - return Result(sourceOutcome.TakeError()); + return AZ::Failure(sourceOutcome.TakeError()); } - + Grammar::AbstractCodeModelConstPtr model = Grammar::AbstractCodeModel::Parse(sourceOutcome.TakeValue()); + return AZ::Success(model); + } + + Result ParseAndTranslateGraph(const Grammar::Request& request) + { + auto parseOutcome = ParseGraph(request); + if (!parseOutcome.IsSuccess()) + { + return Result(parseOutcome.TakeError()); + } + + Grammar::AbstractCodeModelConstPtr model = parseOutcome.TakeValue(); Translations translations; Errors errors; @@ -124,61 +133,52 @@ namespace ScriptCanvas } } -// if (targetFlags & (TargetFlags::Cpp | TargetFlags::Hpp)) -// { -// auto outcomeCPP = TranslationCPP::ToCPlusPlus(*model.get(), rawSave); -// if (outcomeCPP.IsSuccess()) -// { -// auto hppAndCpp = outcomeCPP.TakeValue(); -// -// TargetResult cppResult; -// cppResult.m_text = AZStd::move(hppAndCpp.first); -// translations.emplace(TargetFlags::Hpp, AZStd::move(cppResult)); -// TargetResult hppResult; -// hppResult.m_text = AZStd::move(hppAndCpp.second); -// translations.emplace(TargetFlags::Cpp, AZStd::move(hppResult)); -// } -// else -// { -// auto hppAndCpp = outcomeCPP.TakeError(); -// errors.emplace(TargetFlags::Hpp, AZStd::move(hppAndCpp.first)); -// errors.emplace(TargetFlags::Cpp, AZStd::move(hppAndCpp.second)); -// } -// } + // if (targetFlags & (TargetFlags::Cpp | TargetFlags::Hpp)) + // { + // auto outcomeCPP = TranslationCPP::ToCPlusPlus(*model.get(), rawSave); + // if (outcomeCPP.IsSuccess()) + // { + // auto hppAndCpp = outcomeCPP.TakeValue(); + // + // TargetResult cppResult; + // cppResult.m_text = AZStd::move(hppAndCpp.first); + // translations.emplace(TargetFlags::Hpp, AZStd::move(cppResult)); + // TargetResult hppResult; + // hppResult.m_text = AZStd::move(hppAndCpp.second); + // translations.emplace(TargetFlags::Cpp, AZStd::move(hppResult)); + // } + // else + // { + // auto hppAndCpp = outcomeCPP.TakeError(); + // errors.emplace(TargetFlags::Hpp, AZStd::move(hppAndCpp.first)); + // errors.emplace(TargetFlags::Cpp, AZStd::move(hppAndCpp.second)); + // } + // } } - else - { - ValidationResults results; - for (auto& test : model->GetValidationEvents()) - { - results.AddValidationEvent(test.get()); - } - } return Result(model, AZStd::move(translations), AZStd::move(errors)); - } + } Result ToCPlusPlusAndLua(const Grammar::Request& request) { Grammar::Request toBoth = request; toBoth.translationTargetFlags = TargetFlags::Lua | TargetFlags::Cpp; - return ParseGraph(toBoth); + return ParseAndTranslateGraph(toBoth); } Result ToCPlusPlus(const Grammar::Request& request) { Grammar::Request toCpp = request; toCpp.translationTargetFlags = TargetFlags::Cpp; - return ParseGraph(toCpp); + return ParseAndTranslateGraph(toCpp); } Result ToLua(const Grammar::Request& request) { Grammar::Request toLua = request; toLua.translationTargetFlags = TargetFlags::Lua; - return ParseGraph(toLua); + return ParseAndTranslateGraph(toLua); } - - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h index 4c59b46280..58123c4d0c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -18,14 +18,15 @@ namespace ScriptCanvas namespace Translation { - Result ParseGraph(const Grammar::Request& request); + AZ::Outcome ParseGraph(const Grammar::Request& request); + + Result ParseAndTranslateGraph(const Grammar::Request& request); Result ToCPlusPlus(const Grammar::Request& request); Result ToCPlusPlusAndLua(const Grammar::Request& request); - + Result ToLua(const Grammar::Request& request); - - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h index 951518de72..0f98a7ed06 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationResult.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -41,7 +41,7 @@ namespace ScriptCanvas Cpp = 1 << 1, Hpp = 1 << 2, }; - + // information required at runtime begin execution of the compiled graph from the host struct RuntimeInputs { @@ -51,10 +51,13 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* reflectContext); Grammar::ExecutionStateSelection m_executionSelection = Grammar::ExecutionStateSelection::InterpretedPure; + AZStd::vector m_nodeables; AZStd::vector> m_variables; + // either the entityId was a (member) variable in the source graph, or it got promoted to one during parsing AZStd::vector> m_entityIds; + // Statics required for internal, local values that need non-code constructible initialization, // when the system can't pass in the input from C++. AZStd::vector> m_staticVariables; @@ -84,7 +87,7 @@ namespace ScriptCanvas using ErrorList = AZStd::vector; using Errors = AZStd::unordered_map; using Translations = AZStd::unordered_map; - + AZStd::sys_time_t SumDurations(const Translations& translation); class Result @@ -98,6 +101,7 @@ namespace ScriptCanvas const AZStd::sys_time_t m_translationDuration; Result(AZStd::string invalidSourceInfo); + Result(Result&& source); Result(Grammar::AbstractCodeModelConstPtr model); Result(Grammar::AbstractCodeModelConstPtr model, Translations&& translations, Errors&& errors); @@ -107,7 +111,7 @@ namespace ScriptCanvas AZ::Outcome IsSuccess(TargetFlags flag) const; bool TranslationSucceed(TargetFlags flag) const; }; - + struct LuaAssetResult { AZ::Data::Asset m_scriptAsset; @@ -117,7 +121,5 @@ namespace ScriptCanvas AZStd::sys_time_t m_parseDuration; AZStd::sys_time_t m_translationDuration; }; - - } - -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp index d2e3a8378f..7a26aed338 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.cpp @@ -166,7 +166,7 @@ namespace ScriptCanvas return TranslationUtilitiesCPP::k_namespaceNameNative; } - AZStd::string_view GetAmazonCopyright() + AZStd::string_view GetCopyright() { return "* Copyright (c) Contributors to the Open 3D Engine Project\n" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h index 9e2b9090dd..64c2793e28 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationUtilities.h @@ -34,7 +34,7 @@ namespace ScriptCanvas AZStd::string EntityIdValueToString(const AZ::EntityId& entityId, const Configuration& config); - AZStd::string_view GetAmazonCopyright(); + AZStd::string_view GetCopyright(); AZStd::string_view GetAutoNativeNamespace(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 43ad3c43f2..aa340f55b9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -104,43 +104,43 @@ namespace ScriptCanvas } } else - if (classElement.GetVersion() < 3) - { - bool exposeAsInputField = false; - classElement.GetChildData(AZ_CRC("ExposeAsInput", 0x0f7879f0), exposeAsInputField); - - if (exposeAsInputField) - { - classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); - classElement.AddElementWithData(context, "Scope", VariableFlags::Scope::Graph); - } - else + if (classElement.GetVersion() < 3) { - AZ::u8 exposureType = VariableFlags::Deprecated::Exposure::Exp_Local; - classElement.GetChildData(AZ_CRC("Exposure", 0x398f29cd), exposureType); + bool exposeAsInputField = false; + classElement.GetChildData(AZ_CRC("ExposeAsInput", 0x0f7879f0), exposeAsInputField); - VariableFlags::Scope scope = VariableFlags::Scope::Graph; - - if ((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) - { - scope = VariableFlags::Scope::Graph; - } - else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) + if (exposeAsInputField) { - scope = VariableFlags::Scope::Graph; + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); + classElement.AddElementWithData(context, "Scope", VariableFlags::Scope::Graph); } - else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Output) + else { - scope = VariableFlags::Scope::Function; + AZ::u8 exposureType = VariableFlags::Deprecated::Exposure::Exp_Local; + classElement.GetChildData(AZ_CRC("Exposure", 0x398f29cd), exposureType); + + VariableFlags::Scope scope = VariableFlags::Scope::Graph; + + if ((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) + { + scope = VariableFlags::Scope::Graph; + } + else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) + { + scope = VariableFlags::Scope::Graph; + } + else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Output) + { + scope = VariableFlags::Scope::Function; + } + + classElement.AddElementWithData(context, "Scope", scope); } - classElement.AddElementWithData(context, "Scope", scope); + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); + classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); } - classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); - classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); - } - return true; } @@ -203,8 +203,8 @@ namespace ScriptCanvas editContext->Class("Variable", "Represents a Variable field within a Script Canvas Graph") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, &GraphVariable::GetVisibility) - ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &GraphVariable::GetDisplayName) - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &GraphVariable::GetDisplayName) + ->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &GraphVariable::GetVariableName) + ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &GraphVariable::GetVariableName) ->Attribute(AZ::Edit::Attributes::DescriptionTextOverride, &GraphVariable::GetDescriptionOverride) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &GraphVariable::m_InitialValueSource, "Initial Value Source", "Variables can get their values from within the graph or through component properties.") diff --git a/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp index 2ba32fb5c9..7d41ce930a 100644 --- a/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Source/SystemComponent.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -9,10 +9,11 @@ #include #include +#include #include #include - #include +#include #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include @@ -53,7 +55,6 @@ namespace ScriptCanvasSystemComponentCpp namespace ScriptCanvas { - void SystemComponent::Reflect(AZ::ReflectContext* context) { Nodeable::Reflect(context); @@ -83,11 +84,16 @@ namespace ScriptCanvas } } + if (AZ::JsonRegistrationContext* jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer() + ->HandlesType(); + } + #if defined(SC_EXECUTION_TRACE_ENABLED) ExecutionLogData::Reflect(context); ExecutionLogAsset::Reflect(context); #endif//defined(SC_EXECUTION_TRACE_ENABLED) - } void SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) @@ -144,7 +150,7 @@ namespace ScriptCanvas ModPerformanceTracker()->CalculateReports(); Execution::PerformanceTrackingReport report = ModPerformanceTracker()->GetGlobalReport(); - + const double ready = aznumeric_caster(report.timing.initializationTime); const double instant = aznumeric_caster(report.timing.executionTime); const double latent = aznumeric_caster(report.timing.latentTime); @@ -357,11 +363,11 @@ namespace ScriptCanvas auto dataRegistry = ScriptCanvas::GetDataRegistry(); for (const auto& classIter : behaviorContext->m_classes) { - auto createability = GetCreatibility(serializeContext, classIter.second); - if (createability.first != DataRegistry::Createability::None) - { - dataRegistry->RegisterType(classIter.second->m_typeId, createability.second, createability.first); - } + auto createability = GetCreatibility(serializeContext, classIter.second); + if (createability.first != DataRegistry::Createability::None) + { + dataRegistry->RegisterType(classIter.second->m_typeId, createability.second, createability.first); + } } } diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index aef1803e25..8e7a8c0411 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -588,6 +588,8 @@ set(FILES Include/ScriptCanvas/Profiler/Aggregator.cpp Include/ScriptCanvas/Profiler/DrillerEvents.h Include/ScriptCanvas/Profiler/DrillerEvents.cpp + Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h + Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp Include/ScriptCanvas/Data/DataTrait.cpp Include/ScriptCanvas/Data/DataTrait.h Include/ScriptCanvas/Data/PropertyTraits.cpp @@ -621,4 +623,4 @@ set(SKIP_UNITY_BUILD_INCLUSION_FILES Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.h Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.cpp -) +) \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index a3bb843473..0841137435 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -7,10 +7,12 @@ set(FILES Builder/BuilderSystemComponent.h + Builder/ScriptCanvasBuilder.cpp + Builder/ScriptCanvasBuilder.h Builder/ScriptCanvasBuilderComponent.cpp Builder/ScriptCanvasBuilderComponent.h Builder/ScriptCanvasBuilderWorker.cpp Builder/ScriptCanvasBuilderWorker.h Builder/ScriptCanvasBuilderWorkerUtility.cpp Builder/ScriptCanvasFunctionBuilderWorker.cpp -) +) \ No newline at end of file From fb448124e2f15821c930f6bd3d4871b329ea5baf Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:11:22 -0700 Subject: [PATCH 002/156] removed uneccessary prefab senstive code Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Execution/ExecutionContext.cpp | 63 ++++--------------- 1 file changed, 11 insertions(+), 52 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp index 292a9490b8..ebf06f3513 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp @@ -92,60 +92,19 @@ namespace ScriptCanvas // (always overridden) EntityIds { - bool prefabSystemEnabled = false; - AzFramework::ApplicationRequests::Bus::BroadcastResult(prefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs + + runtimeData.m_activationInputRange.nodeableCount + + runtimeData.m_activationInputRange.variableCount; - if (prefabSystemEnabled) - { - AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs - + runtimeData.m_activationInputRange.nodeableCount - + runtimeData.m_activationInputRange.variableCount; - - const auto entityIdTypeId = azrtti_typeid(); - - for (auto& entityId : activationData.variableOverrides.m_entityIds) - { - destVariableIter->m_typeId = entityIdTypeId; - destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); - auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); - *entityIdValuePtr = entityId; - ++destVariableIter; - } - } - else + const auto entityIdTypeId = azrtti_typeid(); + + for (auto& entityId : activationData.variableOverrides.m_entityIds) { - AZ::SliceComponent::EntityIdToEntityIdMap loadedEntityIdMap; - AzFramework::EntityContextId owningContextId = AzFramework::EntityContextId::CreateNull(); - AzFramework::EntityIdContextQueryBus::EventResult(owningContextId, forSliceSupportOnly, &AzFramework::EntityIdContextQueries::GetOwningContextId); - if (!owningContextId.IsNull()) - { - AzFramework::SliceEntityOwnershipServiceRequestBus::EventResult(loadedEntityIdMap, owningContextId, &AzFramework::SliceEntityOwnershipServiceRequestBus::Events::GetLoadedEntityIdMap); - } - - AZ::BehaviorValueParameter* destVariableIter = rangeOut.inputs - + runtimeData.m_activationInputRange.nodeableCount - + runtimeData.m_activationInputRange.variableCount; - - const auto entityIdTypeId = azrtti_typeid(); - for (auto& entityId : activationData.variableOverrides.m_entityIds) - { - destVariableIter->m_typeId = entityIdTypeId; - destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); - auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); - - auto iter = loadedEntityIdMap.find(entityId); - if (iter != loadedEntityIdMap.end()) - { - *entityIdValuePtr = iter->second; - } - else - { - *entityIdValuePtr = Data::EntityIDType(); - } - - *entityIdValuePtr = entityId; - ++destVariableIter; - } + destVariableIter->m_typeId = entityIdTypeId; + destVariableIter->m_value = destVariableIter->m_tempData.allocate(sizeof(Data::EntityIDType), AZStd::alignment_of::value, 0); + auto entityIdValuePtr = reinterpret_cast*>(destVariableIter->m_value); + *entityIdValuePtr = entityId; + ++destVariableIter; } } From 355776d3a96a8b2f1d8dde0b02559464d7995929 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 29 Jun 2021 17:25:23 -0700 Subject: [PATCH 003/156] Add versioning updates for prefab conversion, and PR clean up & nitpicks Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 8 +- .../Code/Builder/ScriptCanvasBuilderWorker.h | 2 + .../EditorScriptCanvasComponent.cpp | 88 +++++++++++++++---- .../Code/Include/ScriptCanvas/Core/Datum.cpp | 30 +++---- .../Grammar/AbstractCodeModel.cpp | 8 +- .../ScriptUserDataSerializer.cpp | 17 ++-- .../ScriptCanvas/Variable/GraphVariable.cpp | 3 + 7 files changed, 111 insertions(+), 45 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index ff0fdf6273..d6ee28af9e 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -200,7 +200,11 @@ namespace ScriptCanvasBuilder for (size_t index = 0; index != buildOverrides.m_variables.size(); ++index) { auto& variable = buildOverrides.m_variables[index]; - auto iter = AZStd::find_if(buildOverrides.m_overrides.begin(), buildOverrides.m_overrides.end(), [&variable](auto& candidate) { return candidate.GetVariableId() == variable.GetVariableId(); }); + auto iter = AZStd::find_if + ( buildOverrides.m_overrides.begin() + , buildOverrides.m_overrides.end() + , [&variable](auto& candidate) { return candidate.GetVariableId() == variable.GetVariableId(); }); + if (iter != buildOverrides.m_overrides.end()) { if (iter->GetDatum()) @@ -265,7 +269,7 @@ namespace ScriptCanvasBuilder } AzToolsFramework::AssetSystemRequestBus::BroadcastResult - (resultFound + ( resultFound , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourceUUID , editorAssetId.m_guid , assetInfo diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 90dfb843b9..465be7760b 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -55,6 +55,8 @@ namespace ScriptCanvasBuilder DependencyArguments, DependencyRequirementsData, AddAssetDependencySearch, + PrefabIntegration, + CorrectGraphVariableVersion, // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 56a170f851..a1d90839f8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -31,6 +31,18 @@ #include #include + +namespace EditorScriptCanvasComponentCpp +{ + enum Version + { + PrefabIntegration = 10, + + // add description above + Current + }; +} + namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) @@ -73,6 +85,63 @@ namespace ScriptCanvasEditor rootElement.RemoveElementByName(AZ_CRC("m_variableEntityIdMap", 0xdc6c75a8)); } + if (rootElement.GetVersion() <= EditorScriptCanvasComponentCpp::Version::PrefabIntegration) + { + auto variableDataElementIndex = rootElement.FindElement(AZ_CRC_CE("m_variableData")); + if (variableDataElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: 'm_variableData' index was missing"); + return false; + } + + auto& variableDataElement = rootElement.GetSubElement(variableDataElementIndex); + + ScriptCanvas::EditableVariableData editableData; + if (!variableDataElement.GetData(editableData)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_variableData'"); + return false; + } + + auto scriptCanvasAssetHolderElementIndex = rootElement.FindElement(AZ_CRC_CE("m_assetHolder")); + if (scriptCanvasAssetHolderElementIndex == -1) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: 'm_assetHolder' index was missing"); + return false; + } + + auto& scriptCanvasAssetHolderElement = rootElement.GetSubElement(scriptCanvasAssetHolderElementIndex); + + ScriptCanvasAssetHolder assetHolder; + if (!scriptCanvasAssetHolderElement.GetData(assetHolder)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); + return false; + } + + rootElement.RemoveElement(variableDataElementIndex); + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataIsValid", true)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataIsValid'"); + return false; + } + + ScriptCanvasBuilder::BuildVariableOverrides overrides; + overrides.m_source = AZ::Data::Asset(assetHolder.GetAssetId(), assetHolder.GetAssetType(), assetHolder.GetAssetHint());; + + for (auto& variable : editableData.GetVariables()) + { + overrides.m_overrides.push_back(variable.m_graphVariable); + } + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); + return false; + } + } + return true; } @@ -82,7 +151,7 @@ namespace ScriptCanvasEditor if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(10, &EditorScriptCanvasComponentVersionConverter) + ->Version(EditorScriptCanvasComponentCpp::Version::Current, &EditorScriptCanvasComponentVersionConverter) ->Field("m_name", &EditorScriptCanvasComponent::m_name) ->Field("m_assetHolder", &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder) ->Field("runtimeDataIsValid", &EditorScriptCanvasComponent::m_runtimeDataIsValid) @@ -213,18 +282,7 @@ namespace ScriptCanvasEditor if (fileAssetId.IsValid()) { AssetTrackerNotificationBus::Handler::BusConnect(fileAssetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, fileAssetId); - - if (memoryAsset && memoryAsset->GetAsset().GetStatus() == AZ::Data::AssetData::AssetStatus::Ready) - { - OnScriptCanvasAssetReady(memoryAsset); - } - else - { - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetType(), nullptr); - } + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } } @@ -251,7 +309,7 @@ namespace ScriptCanvasEditor auto assetTreeOutcome = LoadEditorAssetTree(m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetHint()); if (!assetTreeOutcome.IsSuccess()) { - AZ_Warning("ScriptCanvas", false, AZStd::string::format("EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()).c_str()); + AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); return; } @@ -260,7 +318,7 @@ namespace ScriptCanvasEditor auto parseOutcome = ParseEditorAssetTree(editorAssetTree); if (!parseOutcome.IsSuccess()) { - AZ_Warning("ScriptCanvas", false, AZStd::string::format("EditorScriptCanvasComponent::BuildGameEntityData failed: %s", parseOutcome.GetError().c_str()).c_str()); + AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", parseOutcome.GetError().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp index 3c70031af0..9a785dceba 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp @@ -209,7 +209,7 @@ namespace DatumHelpers } else if (typeID == azrtti_typeid()) { - target = BehaviorContextObject::Create(AZ::Vector2(static_cast(sourceVector.GetX()), static_cast(sourceVector.GetY())), behaviorClass); + target = BehaviorContextObject::Create(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass); } else if (typeID == azrtti_typeid()) { @@ -264,7 +264,7 @@ namespace DatumHelpers } else if (typeID == azrtti_typeid()) { - target = BehaviorContextObject::Create(AZ::Vector2(static_cast(sourceVector.GetX()), static_cast(sourceVector.GetY())), behaviorClass); + target = BehaviorContextObject::Create(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass); } else if (typeID == azrtti_typeid()) { @@ -2478,7 +2478,7 @@ namespace ScriptCanvas AZStd::string Datum::ToStringColor(const Data::ColorType& c) const { - return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", static_cast(c.GetR()), static_cast(c.GetG()), static_cast(c.GetB()), static_cast(c.GetA())); + return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", (c.GetR()), (c.GetG()), (c.GetB()), (c.GetA())); } bool Datum::ToStringBehaviorClassObject(Data::StringType& stringOut) const @@ -2555,9 +2555,9 @@ namespace ScriptCanvas AZ::Vector3 eulerRotation = AZ::ConvertTransformToEulerDegrees(AZ::Transform::CreateFromQuaternion(source)); return AZStd::string::format ("(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)" - , static_cast(eulerRotation.GetX()) - , static_cast(eulerRotation.GetY()) - , static_cast(eulerRotation.GetZ())); + , (eulerRotation.GetX()) + , (eulerRotation.GetY()) + , (eulerRotation.GetZ())); } AZStd::string Datum::ToStringTransform(const Data::TransformType& source) const @@ -2570,8 +2570,8 @@ namespace ScriptCanvas ("(Position: X: %f, Y: %f, Z: %f," " Rotation: X: %f, Y: %f, Z: %f," " Scale: %f)" - , static_cast(pos.GetX()), static_cast(pos.GetY()), static_cast(pos.GetZ()) - , static_cast(rotation.GetX()), static_cast(rotation.GetY()), static_cast(rotation.GetZ()) + , (pos.GetX()), (pos.GetY()), (pos.GetZ()) + , (rotation.GetX()), (rotation.GetY()), (rotation.GetZ()) , scale); } @@ -2587,19 +2587,19 @@ namespace ScriptCanvas { return AZStd::string::format ("(X: %f, Y: %f, Z: %f)" - , static_cast(source.GetX()) - , static_cast(source.GetY()) - , static_cast(source.GetZ())); + , (source.GetX()) + , (source.GetY()) + , (source.GetZ())); } AZStd::string Datum::ToStringVector4(const AZ::Vector4& source) const { return AZStd::string::format ("(X: %f, Y: %f, Z: %f, W: %f)" - , static_cast(source.GetX()) - , static_cast(source.GetY()) - , static_cast(source.GetZ()) - , static_cast(source.GetW())); + , (source.GetX()) + , (source.GetY()) + , (source.GetZ()) + , (source.GetW())); } AZ::Outcome Datum::CallBehaviorContextMethod(const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* params, unsigned int numExpectedArgs) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 1851b5e65d..a42f624f01 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -1226,8 +1226,8 @@ namespace ScriptCanvas (nodeling->GetEntityId() , nullptr , AZStd::string::format - ("%s is the name of multiple In Nodelings in a subgraph,\n" - "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data())); + ( "%s is the name of multiple In Nodelings in a subgraph,\n" + "this will result in a difficult or impossible to use Function Node when used in another graph", displayName.c_str())); return; } else @@ -1355,8 +1355,8 @@ namespace ScriptCanvas if (ExecutionContainsCycles(node, outSlot)) { AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format - ("Execution cycle detected (see connections to %s-%s. Use a looping node like While or For" - , node.GetDebugName().data(), outSlot.GetName().data()).data())); + ( "Execution cycle detected (see connections to %s-%s. Use a looping node like While or For" + , node.GetDebugName().c_str(), outSlot.GetName().c_str()).c_str())); return true; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index 207acafd82..f626cb1da2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -5,10 +5,9 @@ * */ -#include "ScriptUserDataSerializer.h" - #include #include +#include using namespace ScriptCanvas; @@ -31,10 +30,10 @@ namespace AZ JsonSerializationResult::ResultCode result(JSR::Tasks::ReadField); AZ::Uuid typeId = AZ::Uuid::CreateNull(); - auto typeIdMember = inputValue.FindMember("$type"); + auto typeIdMember = inputValue.FindMember(JsonSerialization::TypeIdFieldIdentifier); if (typeIdMember == inputValue.MemberEnd()) { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load the $type member"); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier).c_str()); } result.Combine(LoadTypeId(typeId, typeIdMember->value, context)); @@ -46,13 +45,13 @@ namespace AZ outputVariable->value = context.GetSerializeContext()->CreateAny(typeId); if (outputVariable->value.empty() || outputVariable->value.type() != typeId) { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); } result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast(&outputVariable->value), typeId, inputValue, "value", context)); return context.Report(result, result.GetProcessing() != JSR::Processing::Halted - ? "ScriptUserDataSerializer Store finished loading RuntimeVariable" - : "ScriptUserDataSerializer Store failed to load RuntimeVariable"); + ? "ScriptUserDataSerializer Load finished loading RuntimeVariable" + : "ScriptUserDataSerializer Load failed to load RuntimeVariable"); } JsonSerializationResult::Result ScriptUserDataSerializer::Store @@ -91,7 +90,7 @@ namespace AZ rapidjson::Value typeValue; typeValue.SetString(azTypeString.begin(), azTypeString.length(), context.GetJsonAllocator()); result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context)); - outputValue.AddMember("$type", typeValue, context.GetJsonAllocator()); + outputValue.AddMember("$type", AZStd::move(typeValue), context.GetJsonAllocator()); } result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast(inputAnyPtr), AZStd::any_cast(defaultAnyPtr), inputAnyPtr->type(), context)); @@ -101,4 +100,4 @@ namespace AZ : "ScriptUserDataSerializer Store failed to save RuntimeVariable"); } -} \ No newline at end of file +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index aa340f55b9..57c40111a6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -102,6 +102,9 @@ namespace ScriptCanvas classElement.RemoveElementByName(AZ_CRC_CE("Scope")); classElement.AddElementWithData(context, "InitialValueSource", VariableFlags::InitialValueSource::Component); } + + classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); + classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); } else if (classElement.GetVersion() < 3) From 9d9205d067bfb88bc9969f6a242d7d7eb8b904a7 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 29 Jun 2021 18:42:32 -0700 Subject: [PATCH 004/156] SC user nodeables now use __index method does not report error on (allowable) nil table entries LYN-3664 Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/AzCore/Script/ScriptContext.cpp | 116 ++++++++++++++---- .../AzCore/Script/ScriptContextAttributes.h | 1 + .../Include/ScriptCanvas/Core/Nodeable.cpp | 1 + 3 files changed, 91 insertions(+), 27 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 0dd24261b8..d3d95b3078 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -689,6 +689,81 @@ namespace AZ return 1; } + int Class__IndexAllowNil(lua_State* l) + { + LSV_BEGIN(l, 1); + + // calling format __index(table,key) + lua_getmetatable(l, -2); // load the userdata metatable + int metaTableIndex = lua_gettop(l); + + // Check if the key is string, if so we expect it to be a function or property name + // otherwise we allow users to provide custom index handlers + // Technically we can allow strings too, but it will clash with function/property names and it be hard to figure + // out what is going on from with in the system. + if (lua_type(l, -2) == LUA_TSTRING) + { + lua_pushvalue(l, -2); // duplicate the key + lua_rawget(l, -2); // load the value at this index + } + else + { + lua_pushliteral(l, "__AZ_Index"); + lua_rawget(l, -2); // check if the user provided custom Index method in the class metatable + if (lua_isnil(l, -1)) // if not report an error + { + lua_rawgeti(l, -2, AZ_LUA_CLASS_METATABLE_NAME_INDEX); // load the class name for a better error + if (!lua_isstring(l, -1)) // if we failed it means we are the base metatable + { + lua_pop(l, 1); + lua_rawgeti(l, 1, AZ_LUA_CLASS_METATABLE_NAME_INDEX); + } + ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning, true, "Invalid index type [], should be string! '%s:%s'!", lua_tostring(l, -1), lua_tostring(l, -4)); + } + else + { + // if we have custom index handler + lua_pushvalue(l, -4); // duplicate the table (class pointer) + lua_pushvalue(l, -4); // duplicate the index value for the call + lua_call(l, 2, 1); // call the function + } + + lua_remove(l, metaTableIndex); // remove the metatable + return 1; + } + + if (!lua_isnil(l, -1)) + { + if (lua_tocfunction(l, -1) == &Internal::LuaPropertyTagHelper) // if it's a property + { + lua_getupvalue(l, -1, 1); // push on the stack the getter function + lua_remove(l, -2); // remove property object + + if (lua_isnil(l, -1)) + { + lua_rawgeti(l, -2, AZ_LUA_CLASS_METATABLE_NAME_INDEX); // load the class name for a better error + if (!lua_isstring(l, -1)) // if we failed it means we are the base metatable + { + lua_pop(l, 1); + lua_rawgeti(l, 1, AZ_LUA_CLASS_METATABLE_NAME_INDEX); + } + + ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning, true, "Property '%s:%s' is write only", lua_tostring(l, -1), lua_tostring(l, -4)); + lua_pop(l, 1); // pop class name + } + else + { + lua_pushvalue(l, -4); // copy the user data to be passed as a this pointer. + lua_call(l, 1, 1); // call a function with one argument (this pointer) and 1 result + } + } + } + + lua_remove(l, metaTableIndex); // remove the metatable + return 1; + } + + //========================================================================= // Class__NewIndex // [3/22/2012] @@ -826,30 +901,6 @@ namespace AZ return 1; } - //========================================================================= - // ClassMetatable__Index - // [3/24/2012] - //========================================================================= - int ClassMetatable__Index(lua_State* l) - { - // since the Class__Index is generic function (ask for the class metatable) - // we can reuse the code for the base metatable (which is a metatable - // of the class metatable) - return Class__Index(l); - } - - //========================================================================= - // ClassMetatable__NewIndex - // [3/30/2012] - //========================================================================= - int ClassMetatable__NewIndex(lua_State* l) - { - // since the Class__NewIndex is generic function (ask for the class metatable) - // we can reuse the code for the base metatable (which is a metatable - // of the class metatable) - return Class__NewIndex(l); - } - inline size_t BufferStringCopy(const char* source, char* destination, size_t destinationSize) { size_t srcLen = strlen(source); @@ -5053,9 +5104,20 @@ LUA_API const Node* lua_getDummyNode() lua_pushcclosure(m_lua, &DefaultBehaviorCaller::Destroy, 0); lua_rawset(m_lua, -3); - lua_pushliteral(m_lua, "__index"); - lua_pushcclosure(m_lua, &Internal::Class__Index, 0); - lua_rawset(m_lua, -3); + { + lua_pushliteral(m_lua, "__index"); + + if (FindAttribute(Script::Attributes::UseClassIndexAllowNil, behaviorClass->m_attributes)) + { + lua_pushcclosure(m_lua, &Internal::Class__IndexAllowNil, 0); + } + else + { + lua_pushcclosure(m_lua, &Internal::Class__Index, 0); + } + + lua_rawset(m_lua, -3); + } lua_pushliteral(m_lua, "__newindex"); lua_pushcclosure(m_lua, &Internal::Class__NewIndex, 0); diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h index 2970ee2e67..76018f3ed0 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h @@ -29,6 +29,7 @@ namespace AZ const static AZ::Crc32 Deprecated = AZ_CRC("Deprecated", 0xfe49a138); ///< Marks a reflected class, method, EBus or property as deprecated. const static AZ::Crc32 DisallowBroadcast = AZ_CRC("DisallowBroadcast", 0x389b0ac7); ///< Marks a reflected EBus as not allowing Broadcasts, only Events. const static AZ::Crc32 ClassConstantValue = AZ_CRC_CE("ClassConstantValue"); ///< Indicates the property is backed by a constant value + const static AZ::Crc32 UseClassIndexAllowNil = AZ_CRC_CE("UseClassIndexAllowNil"); ///< Use the Class__IndexAllowNil method, which will not report an error on accessing undeclared values (allows for nil) //! Attribute which stores BehaviorAzEventDescription structure which contains //! the script name of an AZ::Event and the name of it's parameter arguments diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index bdb8576d8f..868751d2a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -79,6 +79,7 @@ namespace ScriptCanvas behaviorContext->Class() ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::Script::Attributes::UseClassIndexAllowNil, AZ::AttributeIsValid::IfPresent) ->Constructor() ->Method("Deactivate", &Nodeable::Deactivate) ->Method("InitializeExecutionState", &Nodeable::InitializeExecutionState) From 7bb4e0562b1f33bc3b1e1b7d7cafce98b6ca580a Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:45:12 +0100 Subject: [PATCH 005/156] Update AssetBrowserTreeView.cpp Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../AssetBrowser/Views/AssetBrowserTreeView.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp index 8a676a8d00..b631908a9a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp @@ -210,6 +210,21 @@ namespace AzToolsFramework void AssetBrowserTreeView::UpdateAfterFilter(bool hasFilter, bool selectFirstValidEntry) { + const QModelIndexList& selectedIndexes = selectionModel()->selectedRows(); + + // If we've cleared the filter but had something selected, ensure it stays selected and visible. + if (!hasFilter && !selectedIndexes.isEmpty()) + { + QModelIndex curIndex = selectedIndexes[0]; + m_expandToEntriesByDefault = true; + m_treeStateSaver->ApplySnapshot(); + + setCurrentIndex(curIndex); + scrollTo(curIndex); + + return; + } + // Flag our default expansion state so that we expand down to source entries after filtering m_expandToEntriesByDefault = hasFilter; // Then ask our state saver to apply its current snapshot again, falling back on asking us if entries should be expanded or not From 5b7b9897335f379c2844cc7f7572f3ef63bf3d72 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 11:44:25 -0700 Subject: [PATCH 006/156] use more constexpr in ScriptCanvasAttributes.h, remove superfluous string use in SC user data serialization Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/Script/ScriptContextAttributes.h | 48 +++++++++---------- .../ScriptUserDataSerializer.cpp | 6 +-- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h index 76018f3ed0..734b5e3bae 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h @@ -16,20 +16,20 @@ namespace AZ { namespace Attributes { - const static AZ::Crc32 Ignore = AZ_CRC("ScriptIgnore", 0xeb7615e1); ///< Don't use the element in the script reflection - const static AZ::Crc32 ClassNameOverride = AZ_CRC("ScriptClassNameOverride", 0x891238a3); ///< Provide a custom name for script reflection, that doesn't match the behavior Context name - const static AZ::Crc32 MethodOverride = AZ_CRC("ScriptFunctionOverride", 0xf89a7882); ///< Use a custom function in the attribute instead of the function - const static AZ::Crc32 ConstructorOverride = AZ_CRC("ConstructorOverride", 0xef5ce4aa); ///< You can provide a custom constructor to be called when created from Lua script - const static AZ::Crc32 EventHandlerCreationFunction = AZ_CRC_CE("EventHandlerCreationFunction"); ///< helps create a handler for any script target so that script functions can be used for AZ::Event signals - const static AZ::Crc32 GenericConstructorOverride = AZ_CRC("GenericConstructorOverride", 0xe6a1698e); ///< You can provide a custom constructor to be called when creating a script - const static AZ::Crc32 ReaderWriterOverride = AZ_CRC("ReaderWriterOverride", 0x1ad9ce2a); ///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM - const static AZ::Crc32 ConstructibleFromNil = AZ_CRC("ConstructibleFromNil", 0x23908169); ///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided. - const static AZ::Crc32 ToolTip = AZ_CRC("ToolTip", 0xa1b95fb0); ///< Add a tooltip for a method/event/property - const static AZ::Crc32 Category = AZ_CRC("Category", 0x064c19c1); ///< Provide a category to allow for partitioning/sorting/ordering of the element - const static AZ::Crc32 Deprecated = AZ_CRC("Deprecated", 0xfe49a138); ///< Marks a reflected class, method, EBus or property as deprecated. - const static AZ::Crc32 DisallowBroadcast = AZ_CRC("DisallowBroadcast", 0x389b0ac7); ///< Marks a reflected EBus as not allowing Broadcasts, only Events. - const static AZ::Crc32 ClassConstantValue = AZ_CRC_CE("ClassConstantValue"); ///< Indicates the property is backed by a constant value - const static AZ::Crc32 UseClassIndexAllowNil = AZ_CRC_CE("UseClassIndexAllowNil"); ///< Use the Class__IndexAllowNil method, which will not report an error on accessing undeclared values (allows for nil) + static constexpr AZ::Crc32 Ignore = AZ_CRC_CE("ScriptIgnore"); ///< Don't use the element in the script reflection + static constexpr AZ::Crc32 ClassNameOverride = AZ_CRC_CE("ScriptClassNameOverride"); ///< Provide a custom name for script reflection, that doesn't match the behavior Context name + static constexpr AZ::Crc32 MethodOverride = AZ_CRC_CE("ScriptFunctionOverride"); ///< Use a custom function in the attribute instead of the function + static constexpr AZ::Crc32 ConstructorOverride = AZ_CRC_CE("ConstructorOverride"); ///< You can provide a custom constructor to be called when created from Lua script + static constexpr AZ::Crc32 EventHandlerCreationFunction = AZ_CRC_CE("EventHandlerCreationFunction"); ///< helps create a handler for any script target so that script functions can be used for AZ::Event signals + static constexpr AZ::Crc32 GenericConstructorOverride = AZ_CRC_CE("GenericConstructorOverride"); ///< You can provide a custom constructor to be called when creating a script + static constexpr AZ::Crc32 ReaderWriterOverride = AZ_CRC_CE("ReaderWriterOverride"); ///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM + static constexpr AZ::Crc32 ConstructibleFromNil = AZ_CRC_CE("ConstructibleFromNil"); ///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided. + static constexpr AZ::Crc32 ToolTip = AZ_CRC_CE("ToolTip"); ///< Add a tooltip for a method/event/property + static constexpr AZ::Crc32 Category = AZ_CRC_CE("Category"); ///< Provide a category to allow for partitioning/sorting/ordering of the element + static constexpr AZ::Crc32 Deprecated = AZ_CRC_CE("Deprecated"); ///< Marks a reflected class, method, EBus or property as deprecated. + static constexpr AZ::Crc32 DisallowBroadcast = AZ_CRC_CE("DisallowBroadcast"); ///< Marks a reflected EBus as not allowing Broadcasts, only Events. + static constexpr AZ::Crc32 ClassConstantValue = AZ_CRC_CE("ClassConstantValue"); ///< Indicates the property is backed by a constant value + static constexpr AZ::Crc32 UseClassIndexAllowNil = AZ_CRC_CE("UseClassIndexAllowNil"); ///< Use the Class__IndexAllowNil method, which will not report an error on accessing undeclared values (allows for nil) //! Attribute which stores BehaviorAzEventDescription structure which contains //! the script name of an AZ::Event and the name of it's parameter arguments @@ -40,11 +40,11 @@ namespace AZ static constexpr AZ::Crc32 EventParameterTypes = AZ_CRC_CE("EventParameterTypes"); ///< Recommends that the Lua runtime look up the member function in the meta table of the first argument, rather than in the original table - const static AZ::Crc32 TreatAsMemberFunction = AZ_CRC("TreatAsMemberFunction", 0x64be831a); + static constexpr AZ::Crc32 TreatAsMemberFunction = AZ_CRC_CE("TreatAsMemberFunction"); ///< This attribute can be attached to the EditContext Attribute of a reflected class, the BehaviorContext Attribute of a reflected class, method, ebus or property. ///< ExcludeFlags can be used to prevent elements from appearing in List, Documentation, etc... - const static AZ::Crc32 ExcludeFrom = AZ_CRC("ExcludeFrom", 0xa98972fe); + static constexpr AZ::Crc32 ExcludeFrom = AZ_CRC_CE("ExcludeFrom"); enum ExcludeFlags : AZ::u64 { List = 1 << 0, //< The reflected item will be excluded from any list (e.g. node palette) @@ -55,7 +55,7 @@ namespace AZ }; //! Used to specify the usage of a Behavior Context element (e.g. Class or EBus) designed for automation scripts - const static AZ::Crc32 Scope = AZ_CRC("Scope", 0x00af55d3); + static constexpr AZ::Crc32 Scope = AZ_CRC_CE("Scope"); enum class ScopeFlags : AZ::u64 { Launcher = 1 << 0, //< a type meant for game run-time Launcher client (default value) @@ -64,15 +64,15 @@ namespace AZ }; //! Provide a partition hierarchy in a string dotted notation to namespace a script element - const static AZ::Crc32 Module = AZ_CRC("Module", 0x0c242628); + static constexpr AZ::Crc32 Module = AZ_CRC_CE("Module"); //! Provide an alternate name for script elements such as helpful PEP8 Python methods and property aliases - const static AZ::Crc32 Alias = AZ_CRC("Alias", 0xe16c6b94); + static constexpr AZ::Crc32 Alias = AZ_CRC_CE("Alias"); - const static AZ::Crc32 EnableAsScriptEventParamType = AZ_CRC("ScriptEventParam", 0xa41e4cb0); - const static AZ::Crc32 EnableAsScriptEventReturnType = AZ_CRC("ScriptEventReturn", 0xf89b5337); + static constexpr AZ::Crc32 EnableAsScriptEventParamType = AZ_CRC_CE("ScriptEventParam"); + static constexpr AZ::Crc32 EnableAsScriptEventReturnType = AZ_CRC_CE("ScriptEventReturn"); - const static AZ::Crc32 Storage = AZ_CRC("ScriptStorage", 0xcd95b44d); + static constexpr AZ::Crc32 Storage = AZ_CRC_CE("ScriptStorage"); enum class StorageType { ScriptOwn, // default, Host allocated memory, Lua will destruct object, Lua will free host-memory via host-supplied function @@ -80,7 +80,7 @@ namespace AZ Value, // Object is Lua allocated memory, Lua will destruct object, Lua will free Lua-memory }; - const static AZ::Crc32 Operator = AZ_CRC("ScriptOperator", 0xfee681b6); + static constexpr AZ::Crc32 Operator = AZ_CRC_CE("ScriptOperator"); enum class OperatorType { // note storage policy can be T*,T (only if we store raw pointers), shared_ptr, intrusive pointer @@ -101,7 +101,7 @@ namespace AZ IndexWrite, // given a key/index and a value, you can store it in the class }; - const static AZ::Crc32 AssetType = AZ_CRC("AssetType", 0xabbf8d5f); ///< Provide an asset type for a generic AssetId method + static constexpr AZ::Crc32 AssetType = AZ_CRC_CE("AssetType"); ///< Provide an asset type for a generic AssetId method } // Attributes } // Script diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index f626cb1da2..62e361da93 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -33,7 +33,7 @@ namespace AZ auto typeIdMember = inputValue.FindMember(JsonSerialization::TypeIdFieldIdentifier); if (typeIdMember == inputValue.MemberEnd()) { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier).c_str()); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier)); } result.Combine(LoadTypeId(typeId, typeIdMember->value, context)); @@ -86,13 +86,11 @@ namespace AZ outputValue.SetObject(); { - auto azTypeString = inputAnyPtr->type().ToString(); rapidjson::Value typeValue; - typeValue.SetString(azTypeString.begin(), azTypeString.length(), context.GetJsonAllocator()); result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context)); outputValue.AddMember("$type", AZStd::move(typeValue), context.GetJsonAllocator()); } - + result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast(inputAnyPtr), AZStd::any_cast(defaultAnyPtr), inputAnyPtr->type(), context)); return context.Report(result, result.GetProcessing() != JSR::Processing::Halted From df02813cd4c84b9cd7505f06d6fcbbc70377f077 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 11:58:04 -0700 Subject: [PATCH 007/156] Hide ExecutionState methods from SC, Fixes LYN-4900 Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Include/ScriptCanvas/Execution/ExecutionState.cpp | 2 ++ .../Execution/Interpreted/ExecutionStateInterpreted.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp index aebb3ed20e..e60b4b1b82 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp @@ -92,6 +92,8 @@ namespace ScriptCanvas if (auto behaviorContext = azrtti_cast(reflectContext)) { behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) + ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ->Method("GetEntityId", &ExecutionState::GetEntityId) ->Method("GetScriptCanvasId", &ExecutionState::GetScriptCanvasId) ->Method("ToString", &ExecutionState::ToString) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index d7cc05cf1b..98e6f17d17 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -132,6 +132,8 @@ namespace ScriptCanvas if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflectContext)) { behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) + ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ; } } From 917dacb61e2e8560eb58d334f3c7be6253bb4301 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 12:10:51 -0700 Subject: [PATCH 008/156] Added comment explaining state of progress of SC --> C++ Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Include/ScriptCanvas/Translation/Translation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp index b44e438ba0..a1628a59af 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp @@ -133,6 +133,10 @@ namespace ScriptCanvas } } + // Translation to C++ (executed via BehaviorContext calls) has been demonstrated in the past and is partially in progress. + // These calls allow for users to execute multiple translations from the same abstract code model. + // More work is required to complete all the latest features of the ACM, and do integrate output files into the build. + // // if (targetFlags & (TargetFlags::Cpp | TargetFlags::Hpp)) // { // auto outcomeCPP = TranslationCPP::ToCPlusPlus(*model.get(), rawSave); From 20775b77454afce35f3c3e88f07e7e18896989a1 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 30 Jun 2021 15:26:27 -0500 Subject: [PATCH 009/156] [LYN-3195] Fixed fancy docking restore state to only touch dock tab containers that it created Signed-off-by: Chris Galvan --- .../AzQtComponents/Components/FancyDocking.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp index 9fe4ac29fb..8470cedce1 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp @@ -3288,16 +3288,16 @@ namespace AzQtComponents } // Untab tabbed dock widgets before restoring, as the restore only works on dock widgets parented directly to the main window - const QList dockWidgets = m_mainWindow->findChildren(); - for (QDockWidget* dockWidget : dockWidgets) + for (QDockWidget* dockWidget : m_mainWindow->findChildren( + QRegularExpression(QString("%1.*").arg(m_tabContainerIdentifierPrefix)), Qt::FindChildrenRecursively)) { - if (QStackedWidget* stackedWidget = qobject_cast(dockWidget->parentWidget())) + DockTabWidget* tabWidget = qobject_cast(dockWidget->widget()); + if (!tabWidget) { - if (AzQtComponents::DockTabWidget* tabWidget = qobject_cast(stackedWidget->parentWidget())) - { - tabWidget->removeTab(dockWidget); - } + continue; } + + tabWidget->closeTabs(); } // Restore the floating windows From 0136c924674d6eb1550d69e7b5c158f9adb78f21 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:55:26 -0700 Subject: [PATCH 010/156] PR white space feedback, better Lua print error message, fix ACM static variable culling Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/AzCore/Script/ScriptDebug.cpp | 5 +- .../Grammar/AbstractCodeModel.cpp | 67 +++++++++++++------ .../ScriptCanvas/Grammar/AbstractCodeModel.h | 2 + .../ScriptUserDataSerializer.cpp | 2 +- .../Code/scriptcanvasgem_common_files.cmake | 3 +- ...scriptcanvasgem_editor_builder_files.cmake | 2 +- 6 files changed, 52 insertions(+), 29 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp index 2f2ac5bdfa..c10f6d7826 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptDebug.cpp @@ -24,7 +24,6 @@ namespace AZ //========================================================================= AZStd::string ExtractUserMessage(const ScriptDataContext& dc) { - AZStd::string userMessage = "Condition failed"; const int argCount = dc.GetNumArguments(); if (argCount > 0 && dc.IsString(argCount - 1)) { @@ -33,12 +32,12 @@ namespace AZ { if (value) { - userMessage = value; + return value; } } } - return userMessage; + return "ExtractUserMessage from print/Debug.Log/Warn/Error/Assert failed. Consider wrapping your argument in tostring()."; } //========================================================================= diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index a42f624f01..e971375e15 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -2258,12 +2258,16 @@ namespace ScriptCanvas m_variableScopeMeaning = VariableScopeMeaning_LegacyFunctions::ValueInitialization; } #endif + // The Order Matters: begin + + // add all data to the ACM for easy look up in input/output processing for ACM nodes AddAllVariablesPreParse(); if (!IsErrorFree()) { return; } + // parse basic editor nodes as they may add implicit variables for (auto& nodeEntity : m_source.m_graphData->m_nodes) { if (nodeEntity) @@ -2296,18 +2300,27 @@ namespace ScriptCanvas return; } + // parse the implicit variables added by ebus handling syntax sugar ParseAutoConnectedEBusHandlerVariables(); + // all possible data is available, now parse execution, starting with "main", currently keyed to RuntimeComponent::Activate Parse(m_startNodes); - + // parse any function introduced by nodes other than On Graph Start/"main" for (auto node : m_possibleExecutionRoots) { ParseExecutionTreeRoots(*node); } - + // parse functions introduced by variable change events ParseVariableHandling(); + // parse all user function and function object signatures ParseUserFunctionTopology(); - ParseConstructionInputVariables(); + // culls unused variables, and determine whether the the graph defines an object or static functionality ParseExecutionCharacteristics(); + // now that variables have been culled, determined what data needs to be initialized by an external source + ParseConstructionInputVariables(); + // now that externally initialized data has been identified, associate local, static initializers with individual functions + ParseFunctionLocalStaticUseage(); + + // The Order Matters: end // from here on, nothing more needs to happen during simple parsing // for example, in the editor, to get validation on syntax based effects for the view @@ -2315,7 +2328,10 @@ namespace ScriptCanvas if (IsErrorFree()) { + // the graph could have used several user graphs which required construction, and maybe multiple instances of the same user asset + // this will create indices for those nodes to be able to pass in the proper entry in the construction argument tree at translation and runtime ParseDependenciesAssetIndicies(); + // protect all names against keyword collision and language naming violations ConvertNamesToIdentifiers(); if (m_source.m_addDebugInfo) @@ -4189,6 +4205,32 @@ namespace ScriptCanvas ParseExecutionLoop(execution); } + void AbstractCodeModel::ParseFunctionLocalStaticUseage() + { + for (auto execution : ModAllExecutionRoots()) + { + if (auto localVariables = GetLocalVariables(execution)) + { + for (auto variable : *localVariables) + { + if (const AZStd::pair* pair = FindStaticVariable(variable)) + { + auto& localStatics = ModStaticVariablesNames(execution); + auto iter = AZStd::find_if + ( localStatics.begin() + , localStatics.end() + , [&](const auto& candidate) { return candidate.first == variable; }); + + if (iter == localStatics.end()) + { + localStatics.push_back(*pair); + } + } + } + } + } + } + void AbstractCodeModel::ParseImplicitVariables(const Node& node) { if (IsCycle(node)) @@ -5232,27 +5274,8 @@ namespace ScriptCanvas TraverseTree(execution, listener); const auto& usage = listener.GetUsedVariables(); const bool usesOnlyLocalVariables = usage.memberVariables.empty() && usage.implicitMemberVariables.empty(); - m_variableUse.localVariables.insert(usage.localVariables.begin(), usage.localVariables.end()); m_variableUse.memberVariables.insert(usage.memberVariables.begin(), usage.memberVariables.end()); - - for (auto variable : m_variableUse.localVariables) - { - if (const AZStd::pair* pair = FindStaticVariable(variable)) - { - auto& localStatics = ModStaticVariablesNames(execution); - auto iter = AZStd::find_if - (localStatics.begin() - , localStatics.end() - , [&](const auto& candidate) { return candidate.first == variable; }); - - if (iter == localStatics.end()) - { - localStatics.push_back(*pair); - } - } - } - m_variableUseByExecution.emplace(execution, listener.MoveUsedVariables()); return (!usage.usesExternallyInitializedVariables) && usesOnlyLocalVariables && listener.IsPure(); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h index f87913d47a..a5c55a7c4f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h @@ -366,6 +366,8 @@ namespace ScriptCanvas void ParseExecutionWhileLoop(ExecutionTreePtr execution); + void ParseFunctionLocalStaticUseage(); + void ParseImplicitVariables(const Node& node); void ParseInputData(ExecutionTreePtr execution); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index 62e361da93..73e16024c9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -88,7 +88,7 @@ namespace AZ { rapidjson::Value typeValue; result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context)); - outputValue.AddMember("$type", AZStd::move(typeValue), context.GetJsonAllocator()); + outputValue.AddMember(rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), AZStd::move(typeValue), context.GetJsonAllocator()); } result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast(inputAnyPtr), AZStd::any_cast(defaultAnyPtr), inputAnyPtr->type(), context)); diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 8e7a8c0411..f980301485 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -622,5 +622,4 @@ set(SKIP_UNITY_BUILD_INCLUSION_FILES Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.h Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.cpp - -) \ No newline at end of file +) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index 0841137435..12cb1a242e 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -15,4 +15,4 @@ set(FILES Builder/ScriptCanvasBuilderWorker.h Builder/ScriptCanvasBuilderWorkerUtility.cpp Builder/ScriptCanvasFunctionBuilderWorker.cpp -) \ No newline at end of file +) From 66a935dfa49ab5b464e00786201005e717287950 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 18:04:06 -0700 Subject: [PATCH 011/156] Fix missing icon issue leading to failed nightly test: LYN-4926 SPEC-6982 Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 +- .../Code/Editor/View/Windows/Resources/create_graph.png | 3 +++ .../Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 0572c929eb..0130191d5d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -523,7 +523,7 @@ namespace ScriptCanvasEditor // Creation Actions { m_createScriptCanvas = new QToolButton(); - m_createScriptCanvas->setIcon(QIcon(ScriptCanvas::AssetDescription::GetIconPath())); + m_createScriptCanvas->setIcon(QIcon(":/ScriptCanvasEditorResources/Resources/create_graph.png")); m_createScriptCanvas->setToolTip("Creates a new Script Canvas Graph"); QObject::connect(m_createScriptCanvas, &QToolButton::clicked, this, &MainWindow::OnFileNew); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png b/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png new file mode 100644 index 0000000000..dea268cd1d --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/create_graph.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f920ea2cd388c6db572344e33ccbf96f65ee6d391ae1880cfe16eff58d0da381 +size 4016 diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc index c9f2ff5fa3..be90d229dc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc @@ -12,6 +12,7 @@ Resources/capture_offline.png Resources/create_function_input.png Resources/create_function_output.png + Resources/create_graph.png Resources/CollapseAll_Icon.png Resources/edit_icon.png Resources/error_icon.png From 3948497f853f589d1922e42e0c0501ed5061750d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 18:05:39 -0700 Subject: [PATCH 012/156] remove unused icon Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png diff --git a/Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png b/Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png deleted file mode 100644 index dea268cd1d..0000000000 --- a/Assets/Editor/Icons/ScriptCanvas/Viewport/ScriptCanvas.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f920ea2cd388c6db572344e33ccbf96f65ee6d391ae1880cfe16eff58d0da381 -size 4016 From fe829bfbd4c009d1d9c7348f27631a650f7d421a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 18:10:17 -0700 Subject: [PATCH 013/156] Use 'missing' vs 'catastrophic' of missing $type field in user script variable json serializer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index 73e16024c9..4a73b55646 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -33,7 +33,7 @@ namespace AZ auto typeIdMember = inputValue.FindMember(JsonSerialization::TypeIdFieldIdentifier); if (typeIdMember == inputValue.MemberEnd()) { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier)); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Missing, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier)); } result.Combine(LoadTypeId(typeId, typeIdMember->value, context)); From 7b149e6f90799d2a693480b8a7f8a77ea89d877e Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 18:14:05 -0700 Subject: [PATCH 014/156] remove unnecessary reporting values from user script variable json serializer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index 4a73b55646..7738c9154d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -45,7 +45,7 @@ namespace AZ outputVariable->value = context.GetSerializeContext()->CreateAny(typeId); if (outputVariable->value.empty() || outputVariable->value.type() != typeId) { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); + return context.Report(result, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed."); } result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast(&outputVariable->value), typeId, inputValue, "value", context)); From 59f4e865a4e51b3ae6fd9c6ecb0adf62f7485a33 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 18:59:11 -0700 Subject: [PATCH 015/156] whitespace and string_view fixes Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp | 2 +- .../Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp | 3 ++- .../Code/Include/ScriptCanvas/Variable/GraphVariable.cpp | 7 ++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index d6ee28af9e..3431165d98 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -277,7 +277,7 @@ namespace ScriptCanvasBuilder if (!resultFound) { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%s.", editorAssetId.ToString().c_str(), assetHint.data())); + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.", editorAssetId.ToString().c_str(), assetHint.size(), assetHint.data())); } AZStd::vector dependentAssets; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index e971375e15..83f686305d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -1454,7 +1454,8 @@ namespace ScriptCanvas { result.m_mostParent = outputSource; } - } while (childSequenceIndex); + } + while (childSequenceIndex); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 57c40111a6..6a91f01518 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -124,11 +124,8 @@ namespace ScriptCanvas VariableFlags::Scope scope = VariableFlags::Scope::Graph; - if ((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) - { - scope = VariableFlags::Scope::Graph; - } - else if (exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) + if (((exposureType & VariableFlags::Deprecated::Exposure::Exp_InOut) == VariableFlags::Deprecated::Exposure::Exp_InOut) + || exposureType & VariableFlags::Deprecated::Exposure::Exp_Input) { scope = VariableFlags::Scope::Graph; } From dcea6f47fa70bf1543ea86013456e27793c25730 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 30 Jun 2021 19:23:21 -0700 Subject: [PATCH 016/156] linux build fix Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 3431165d98..7a22695935 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -277,7 +277,7 @@ namespace ScriptCanvasBuilder if (!resultFound) { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.", editorAssetId.ToString().c_str(), assetHint.size(), assetHint.data())); + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.", editorAssetId.ToString().c_str(), aznumeric_cast(assetHint.size()), assetHint.data())); } AZStd::vector dependentAssets; From 8cd07c6f4b30d438f2055a004f9391ce1d4e6860 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 1 Jul 2021 05:33:59 -0700 Subject: [PATCH 017/156] update license on new files Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp | 2 +- Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h | 2 +- .../ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp | 4 ++-- .../ScriptCanvas/Serialization/ScriptUserDataSerializer.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 7a22695935..dbd36b3641 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project + * Copyright (c) Contributors to the Open 3D Engine Project. 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/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index ea77b4c9b0..7cbc6c029e 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project + * Copyright (c) Contributors to the Open 3D Engine Project. 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/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp index 7738c9154d..158e1fb562 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project - * + * Copyright (c) Contributors to the Open 3D Engine Project. 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/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h index 781a3b74fe..1e627f5acb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Serialization/ScriptUserDataSerializer.h @@ -1,6 +1,6 @@ /* - * Copyright (c) Contributors to the Open 3D Engine Project - * + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -33,4 +33,4 @@ namespace AZ , const void* defaultValue , const Uuid& valueTypeId, JsonSerializerContext& context) override; }; -} \ No newline at end of file +} From 346e294f600c972954e2f56d03113081178ffeac Mon Sep 17 00:00:00 2001 From: mriegger Date: Thu, 1 Jul 2021 09:02:02 -0700 Subject: [PATCH 018/156] Switch directional light to use the same reformulation as projected shadow and reduce to 16 bit float RT for perf --- .../Common/Assets/Passes/DepthExponentiation.pass | 2 +- .../Common/Assets/Passes/FilterDepthVertical.pass | 2 +- .../Atom/Features/Shadow/DirectionalLightShadow.azsli | 10 ++++++---- .../Assets/Shaders/Shadow/DepthExponentiation.azsl | 7 +------ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass b/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass index c08f5c9e4a..82dd13935a 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DepthExponentiation.pass @@ -54,7 +54,7 @@ "Attachment": "Depth" }, "ImageDescriptor": { - "Format": "R32_FLOAT" + "Format": "R16_FLOAT" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass b/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass index 321d0abf4a..5d8a4de21b 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/FilterDepthVertical.pass @@ -54,7 +54,7 @@ "Attachment": "Input" }, "ImageDescriptor": { - "Format": "R32_FLOAT" + "Format": "R16_FLOAT" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 7b592d6458..30fab2d2a6 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -356,8 +356,9 @@ float DirectionalLightShadow::GetVisibilityFromLightEsm() { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); const float3 coord = float3(shadowCoord.xy, indexOfCascade); - const float expDepthInShadowmap = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; - const float ratio = exp(-EsmExponentialShift * distanceWithinCameraView) * expDepthInShadowmap; + const float occluder = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; + const float exponent = -EsmExponentialShift * (distanceWithinCameraView - occluder); + const float ratio = exp(exponent); m_debugInfo.m_cascadeIndex = indexOfCascade; return saturate(ratio); @@ -385,8 +386,9 @@ float DirectionalLightShadow::GetVisibilityFromLightEsmPcf() { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); const float3 coord = float3(shadowCoord.xy, indexOfCascade); - const float expDepthInShadowmap = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; - float ratio = exp(-EsmExponentialShift * distanceWithinCameraView) * expDepthInShadowmap; + const float occluder = expShadowmap.Sample(PassSrg::LinearSampler, coord).r; + const float exponent = -EsmExponentialShift * (distanceWithinCameraView - occluder); + float ratio = exp(exponent); static const float pcfFallbackThreshold = 1.04; if (ratio > pcfFallbackThreshold) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl index ba2a4aaf92..c620047d52 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/DepthExponentiation.azsl @@ -63,12 +63,7 @@ void MainCS(uint3 dispatchId: SV_DispatchThreadID) // So this converts it to "depth" to emphasize the difference // within the frustum. const float depth = (depthInClip - distanceMin) / (1. - distanceMin); - - // Todo: Expose Esm exponent slider for directional lights - // This would remove the exp calculation below, collapsing it into a subtraction in DirectionalLightShadow.azsli - // ATOM-15775 - const float outValue = exp(EsmExponentialShift * depth); - PassSrg::m_outputShadowmap[dispatchId].r = outValue; + PassSrg::m_outputShadowmap[dispatchId].r = depth; break; } case ShadowmapLightType::Spot: From 59ff74f559034379420379a82a8558a63e221a31 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 1 Jul 2021 09:57:36 -0700 Subject: [PATCH 019/156] The Great ScriptCanvas Purge. Part I. Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../GraphCanvas/Editor/GraphModelBus.h | 13 - .../GraphModel/Integration/GraphController.h | 2 - .../Source/Integration/GraphController.cpp | 8 - .../Code/Editor/Components/EditorGraph.cpp | 63 -- .../Framework/ScriptCanvasTraceUtilities.h | 2 - .../EntityRefNodeDescriptorComponent.cpp | 126 --- .../EntityRefNodeDescriptorComponent.h | 48 - .../ScriptCanvas/Components/EditorGraph.h | 6 +- .../Code/Editor/Nodes/NodeCreateUtils.cpp | 1 - .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 52 - .../Code/Editor/Nodes/NodeDisplayUtils.h | 1 - .../Code/Editor/Nodes/NodeUtils.cpp | 16 - .../Code/Editor/ScriptCanvasEditorGem.cpp | 2 - .../Widgets/NodePalette/NodePaletteModel.cpp | 7 - .../SpecializedNodePaletteTreeItemTypes.cpp | 1 - .../VariableNodePaletteTreeItemTypes.cpp | 1 - .../ScriptCanvasNodePaletteDockWidget.cpp | 1 - .../Include/ScriptCanvas/Core/Contracts.h | 1 - .../Contracts/ExclusivePureDataContract.cpp | 56 -- .../Contracts/ExclusivePureDataContract.h | 30 - .../Code/Include/ScriptCanvas/Core/Graph.cpp | 1 - .../ScriptCanvas/Core/NativeDatumNode.h | 133 --- .../Code/Include/ScriptCanvas/Core/Node.cpp | 30 +- .../ScriptCanvas/Core/NodeFunctionGeneric.h | 10 + .../Include/ScriptCanvas/Core/PureData.cpp | 230 ----- .../Code/Include/ScriptCanvas/Core/PureData.h | 111 --- .../Code/Include/ScriptCanvas/Core/Slot.cpp | 6 - .../ScriptCanvas/Libraries/Core/Assign.cpp | 88 -- .../ScriptCanvas/Libraries/Core/Assign.h | 39 - .../Core/BehaviorContextObjectNode.cpp | 216 ----- .../Core/BehaviorContextObjectNode.h | 73 -- .../Libraries/Core/BinaryOperator.h | 1 - .../ScriptCanvas/Libraries/Core/CoreNodes.cpp | 4 - .../ScriptCanvas/Libraries/Core/CoreNodes.h | 2 - .../Libraries/Core/ErrorHandler.cpp | 1 - .../Libraries/Core/ExtractProperty.cpp | 27 - .../Libraries/Core/ExtractProperty.h | 4 - .../ScriptCanvas/Libraries/Core/ForEach.cpp | 1 - .../ScriptCanvas/Libraries/Core/String.h | 47 - .../Libraries/Core/UnaryOperator.cpp | 30 - .../Libraries/Core/UnaryOperator.h | 19 +- .../ScriptCanvas/Libraries/Entity/Entity.cpp | 18 +- .../ScriptCanvas/Libraries/Entity/Entity.h | 3 - .../Libraries/Entity/EntityIDNode.h | 47 - .../ScriptCanvas/Libraries/Entity/EntityRef.h | 79 -- .../Entity/Rotate.ScriptCanvasGrammar.xml | 29 - .../ScriptCanvas/Libraries/Entity/Rotate.cpp | 56 -- .../ScriptCanvas/Libraries/Entity/Rotate.h | 44 - .../ScriptCanvas/Libraries/Logic/Boolean.h | 48 - .../ScriptCanvas/Libraries/Logic/Gate.cpp | 17 - .../ScriptCanvas/Libraries/Logic/Gate.h | 15 +- .../ScriptCanvas/Libraries/Logic/Logic.cpp | 2 - .../ScriptCanvas/Libraries/Logic/Logic.h | 1 - .../ScriptCanvas/Libraries/Logic/Not.h | 9 - .../ScriptCanvas/Libraries/Logic/Once.h | 5 +- .../ScriptCanvas/Libraries/Logic/While.h | 5 +- .../ScriptCanvas/Libraries/Math/AABBNode.h | 48 - .../ScriptCanvas/Libraries/Math/CRCNode.h | 48 - .../ScriptCanvas/Libraries/Math/ColorNode.h | 48 - .../ScriptCanvas/Libraries/Math/Math.cpp | 55 +- .../ScriptCanvas/Libraries/Math/Math.h | 12 - .../Libraries/Math/Matrix3x3Node.h | 49 - .../Libraries/Math/Matrix4x4Node.h | 48 - .../ScriptCanvas/Libraries/Math/Number.h | 46 - .../ScriptCanvas/Libraries/Math/OBBNode.h | 48 - .../ScriptCanvas/Libraries/Math/PlaneNode.h | 48 - .../Math/Random.ScriptCanvasGrammar.xml | 34 - .../ScriptCanvas/Libraries/Math/Random.cpp | 42 - .../ScriptCanvas/Libraries/Math/Random.h | 36 - .../ScriptCanvas/Libraries/Math/Rotation.h | 46 - .../ScriptCanvas/Libraries/Math/Transform.h | 45 - .../ScriptCanvas/Libraries/Math/Vector.h | 106 --- .../Code/Source/ScriptCanvasCommonGem.cpp | 2 - .../Code/scriptcanvasgem_common_files.cmake | 28 - .../Code/scriptcanvasgem_editor_files.cmake | 2 - .../Framework/ScriptCanvasTestUtilities.cpp | 95 -- .../Framework/ScriptCanvasTestUtilities.h | 1 - .../Tests/ScriptCanvas_BehaviorContext.cpp | 43 - .../Code/Tests/ScriptCanvas_Core.cpp | 157 +-- .../Code/Tests/ScriptCanvas_Math.cpp | 70 -- .../Code/Tests/ScriptCanvas_NodeGenerics.cpp | 901 ------------------ 81 files changed, 40 insertions(+), 3906 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NativeDatumNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/String.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityRef.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.ScriptCanvasGrammar.xml delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Boolean.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/AABBNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/CRCNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/ColorNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix3x3Node.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix4x4Node.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Number.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/OBBNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/PlaneNode.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.ScriptCanvasGrammar.xml delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Rotation.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Transform.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h index b59a4162d1..e7a05c5ee9 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h @@ -90,19 +90,6 @@ namespace GraphCanvas return result; } - //! This is sent to confirm whether or not a variable assignment can take place. - virtual bool IsValidVariableAssignment(const AZ::EntityId& variableId, const Endpoint& targetPoint) const = 0; - - //! This will return the structure needed to display why a variable could not be assigned to a specific reference inside of GraphCanvas. - virtual ConnectionValidationTooltip GetVariableAssignmentValidityTooltip(const AZ::EntityId& variableId, const Endpoint& targetPoint) const - { - ConnectionValidationTooltip result; - - result.m_isValid = IsValidVariableAssignment(variableId, targetPoint); - - return result; - } - //! Get the Display Type name for the given AZ type virtual AZStd::string GetDataTypeString(const AZ::Uuid& typeId) = 0; diff --git a/Gems/GraphModel/Code/Include/GraphModel/Integration/GraphController.h b/Gems/GraphModel/Code/Include/GraphModel/Integration/GraphController.h index 84e54ea6bf..817b709b70 100644 --- a/Gems/GraphModel/Code/Include/GraphModel/Integration/GraphController.h +++ b/Gems/GraphModel/Code/Include/GraphModel/Integration/GraphController.h @@ -147,8 +147,6 @@ namespace GraphModelIntegration bool CreateConnection(const AZ::EntityId& connectionUiId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) override; bool IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const override; - bool IsValidVariableAssignment(const AZ::EntityId& variableId, const GraphCanvas::Endpoint& targetPoint) const override; - //////////////////////////////////////////////////////////////////////////////////// // GraphCanvas::GraphModelRequestBus, undo diff --git a/Gems/GraphModel/Code/Source/Integration/GraphController.cpp b/Gems/GraphModel/Code/Source/Integration/GraphController.cpp index dff224b03d..e61cd7671e 100644 --- a/Gems/GraphModel/Code/Source/Integration/GraphController.cpp +++ b/Gems/GraphModel/Code/Source/Integration/GraphController.cpp @@ -1187,14 +1187,6 @@ namespace GraphModelIntegration return dataTypesMatch && !CheckForLoopback(sourceSlot->GetParentNode(), targetSlot->GetParentNode()); } - - bool GraphController::IsValidVariableAssignment([[maybe_unused]] const AZ::EntityId& variableId, [[maybe_unused]] const GraphCanvas::Endpoint& targetPoint) const - { - AZ_Assert(false, "This Graph Canvas does not support graph variables"); - return false; - } - - //! Helper function to create a GraphCanvas::NodePropertyDisplay and a data interface for editing input pin values //! \typename DataInterfaceType One of the data interface types. Ex: BooleanDataInterface //! \typename CreateDisplayFunctionType Function pointer type should be filled automatically diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index f1b4af88d8..a8dd5904fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -38,9 +38,6 @@ AZ_POP_DISABLE_WARNING #include #include #include - -#include - #include #include #include @@ -1087,66 +1084,6 @@ namespace ScriptCanvasEditor return CanCreateConnectionBetween(scSourceEndpoint, scTargetEndpoint).IsSuccess(); } - GraphCanvas::ConnectionValidationTooltip Graph::GetConnectionValidityTooltip(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const - { - ScriptCanvas::Endpoint scSourceEndpoint = ConvertToScriptCanvasEndpoint(sourcePoint); - ScriptCanvas::Endpoint scTargetEndpoint = ConvertToScriptCanvasEndpoint(targetPoint); - - AZ::Outcome connectionResult = CanCreateConnectionBetween(scSourceEndpoint, scTargetEndpoint); - - GraphCanvas::ConnectionValidationTooltip validationTooltip; - - validationTooltip.m_isValid = connectionResult.IsSuccess(); - - if (!connectionResult) - { - validationTooltip.m_failureReason = connectionResult.GetError(); - } - - return validationTooltip; - } - - bool Graph::IsValidVariableAssignment(const AZ::EntityId& variableId, const GraphCanvas::Endpoint& targetPoint) const - { - AZStd::any* userData = nullptr; - GraphCanvas::NodeRequestBus::EventResult(userData, variableId, &GraphCanvas::NodeRequests::GetUserData); - AZ::EntityId variableNodeId = (userData && userData->is()) ? *AZStd::any_cast(userData) : AZ::EntityId(); - - ScriptCanvas::SlotId variableSlotId; - ScriptCanvas::NodeRequestBus::EventResult(variableSlotId, variableNodeId, &ScriptCanvas::NodeRequests::GetSlotId, ScriptCanvas::PureData::k_getThis); - - ScriptCanvas::Endpoint variableSourceEndpoint(variableNodeId, variableSlotId); - ScriptCanvas::Endpoint targetEndpoint = ConvertToScriptCanvasEndpoint(targetPoint); - - return CanCreateConnectionBetween(variableSourceEndpoint, targetEndpoint).IsSuccess(); - } - - GraphCanvas::ConnectionValidationTooltip Graph::GetVariableAssignmentValidityTooltip(const AZ::EntityId& variableId, const GraphCanvas::Endpoint& targetPoint) const - { - AZStd::any* userData = nullptr; - GraphCanvas::NodeRequestBus::EventResult(userData, variableId, &GraphCanvas::NodeRequests::GetUserData); - AZ::EntityId variableNodeId = (userData && userData->is()) ? *AZStd::any_cast(userData) : AZ::EntityId(); - - ScriptCanvas::SlotId variableSlotId; - ScriptCanvas::NodeRequestBus::EventResult(variableSlotId, variableNodeId, &ScriptCanvas::NodeRequests::GetSlotId, ScriptCanvas::PureData::k_getThis); - - ScriptCanvas::Endpoint variableSourceEndpoint(variableNodeId, variableSlotId); - ScriptCanvas::Endpoint targetEndpoint = ConvertToScriptCanvasEndpoint(targetPoint); - - AZ::Outcome connectionResult = CanCreateConnectionBetween(variableSourceEndpoint, targetEndpoint); - - GraphCanvas::ConnectionValidationTooltip validationTooltip; - - validationTooltip.m_isValid = connectionResult.IsSuccess(); - - if (!connectionResult) - { - validationTooltip.m_failureReason = connectionResult.GetError(); - } - - return validationTooltip; - } - AZStd::string Graph::GetDataTypeString(const AZ::Uuid& typeId) { return TranslationHelper::GetSafeTypeName(ScriptCanvas::Data::FromAZType(typeId)); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 381e7c78ea..62050980b6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -20,10 +20,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.cpp deleted file mode 100644 index d49b776963..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "precompiled.h" - -#include - -#include "EntityRefNodeDescriptorComponent.h" - -#include "ScriptCanvas/Core/Datum.h" -#include "ScriptCanvas/Core/PureData.h" -#include "ScriptCanvas/Core/Slot.h" - -namespace ScriptCanvasEditor -{ - ///////////////////////////////////// - // EntityRefNodeDescriptorComponent - ///////////////////////////////////// - - void EntityRefNodeDescriptorComponent::Reflect(AZ::ReflectContext* reflectContext) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext); - if (serializeContext) - { - serializeContext->Class() - ->Version(1) - ; - } - } - - EntityRefNodeDescriptorComponent::EntityRefNodeDescriptorComponent() - : NodeDescriptorComponent(NodeDescriptorType::EntityRef) - { - } - - void EntityRefNodeDescriptorComponent::OnEntityNameChanged([[maybe_unused]] const AZStd::string& name) - { - UpdateNodeTitle(); - } - - void EntityRefNodeDescriptorComponent::OnSlotInputChanged(const ScriptCanvas::SlotId& slotId) - { - if (slotId == m_endpoint.GetSlotId()) - { - AZ::EntityBus::Handler::BusDisconnect(); - - AZ::EntityId referencedId = GetReferencedEntityId(); - - if (referencedId.IsValid()) - { - AZ::EntityBus::Handler::BusConnect(referencedId); - } - - UpdateNodeTitle(); - } - } - - void EntityRefNodeDescriptorComponent::OnAddedToGraphCanvasGraph([[maybe_unused]] const GraphCanvas::GraphId& sceneId, const AZ::EntityId& scriptCanvasNodeId) - { - ScriptCanvas::SlotId scriptCanvasSlotId; - ScriptCanvas::NodeRequestBus::EventResult(scriptCanvasSlotId, scriptCanvasNodeId, &ScriptCanvas::NodeRequests::GetSlotId, ScriptCanvas::PureData::k_setThis); - - m_endpoint = ScriptCanvas::Endpoint(scriptCanvasNodeId, scriptCanvasSlotId); - - if (m_endpoint.IsValid()) - { - AZ::EntityId referencedId = GetReferencedEntityId(); - - if (referencedId.IsValid()) - { - AZ::EntityBus::Handler::BusConnect(referencedId); - } - } - - UpdateNodeTitle(); - } - - AZ::EntityId EntityRefNodeDescriptorComponent::GetReferencedEntityId() const - { - AZ::EntityId retVal; - - const ScriptCanvas::Datum* object = nullptr; - ScriptCanvas::NodeRequestBus::EventResult(object, m_endpoint.GetNodeId(), &ScriptCanvas::NodeRequests::FindDatum, m_endpoint.GetSlotId()); - - if (object && object->IS_A()) - { - retVal = (*object->GetAs()); - } - - return retVal; - } - - void EntityRefNodeDescriptorComponent::UpdateNodeTitle() - { - bool needsTitle = true; - - if (m_endpoint.IsValid()) - { - AZ::EntityId referencedId = GetReferencedEntityId(); - - AZStd::string entityName; - AZ::ComponentApplicationBus::BroadcastResult(entityName, &AZ::ComponentApplicationRequests::GetEntityName, referencedId); - - if (!entityName.empty()) - { - needsTitle = false; - GraphCanvas::NodeTitleRequestBus::Event(GetEntityId(), &GraphCanvas::NodeTitleRequests::SetTitle, entityName.c_str()); - } - else if (referencedId.IsValid()) - { - needsTitle = false; - GraphCanvas::NodeTitleRequestBus::Event(GetEntityId(), &GraphCanvas::NodeTitleRequests::SetTitle, referencedId.ToString().c_str()); - } - } - - if (needsTitle) - { - GraphCanvas::NodeTitleRequestBus::Event(GetEntityId(), &GraphCanvas::NodeTitleRequests::SetTitle, ""); - } - - GraphCanvas::NodeTitleRequestBus::Event(GetEntityId(), &GraphCanvas::NodeTitleRequests::SetSubTitle, "EntityRef"); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.h deleted file mode 100644 index af8b55a69d..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.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 "Editor/GraphCanvas/Components/NodeDescriptors/NodeDescriptorComponent.h" - -#include "ScriptCanvas/Core/NodeBus.h" -#include "ScriptCanvas/Core/Endpoint.h" - -namespace ScriptCanvasEditor -{ - class EntityRefNodeDescriptorComponent - : public NodeDescriptorComponent - , public AZ::EntityBus::Handler - { - public: - AZ_COMPONENT(EntityRefNodeDescriptorComponent, "{887AE9AC-C793-4FE5-BAE2-AF6A7F70A374}", NodeDescriptorComponent); - static void Reflect(AZ::ReflectContext* reflectContext); - - EntityRefNodeDescriptorComponent(); - ~EntityRefNodeDescriptorComponent() = default; - - // AZ::EntityBus - void OnEntityNameChanged(const AZStd::string& name) override; - //// - - // ScriptCanvas::NodeNotificationsBus - void OnSlotInputChanged(const ScriptCanvas::SlotId& slotId) override; - //// - - private: - - void OnAddedToGraphCanvasGraph(const GraphCanvas::GraphId& graphId, const AZ::EntityId& scriptCanvasNodeId) override; - - AZ::EntityId GetReferencedEntityId() const; - void UpdateNodeTitle(); - - ScriptCanvas::Endpoint m_endpoint; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index a32333e5ce..777a84c4fa 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -160,11 +160,7 @@ namespace ScriptCanvasEditor bool CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) override; bool IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const override; - GraphCanvas::ConnectionValidationTooltip GetConnectionValidityTooltip(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const override; - - bool IsValidVariableAssignment(const AZ::EntityId& variableId, const GraphCanvas::Endpoint& targetPoint) const override; - GraphCanvas::ConnectionValidationTooltip GetVariableAssignmentValidityTooltip(const AZ::EntityId& variableId, const GraphCanvas::Endpoint& targetPoint) const override; - + AZStd::string GetDataTypeString(const AZ::Uuid& typeId) override; void OnRemoveUnusedNodes() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp index a7282f85b0..1ad27566d9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp @@ -26,7 +26,6 @@ #include #include #include -#include namespace ScriptCanvasEditor::Nodes { diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index ba87796161..0c210441fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -231,57 +230,6 @@ namespace ScriptCanvasEditor::Nodes return DisplayGeneralScriptCanvasNode(graphCanvasGraphId, node, nodeConfiguration); } - AZ::EntityId DisplayEntityNode(AZ::EntityId, const ScriptCanvas::Nodes::Entity::EntityRef* entityNode) - { - AZ::EntityId graphCanvasNodeId; - - AZ::Entity* graphCanvasEntity = nullptr; - GraphCanvas::GraphCanvasRequestBus::BroadcastResult(graphCanvasEntity, &GraphCanvas::GraphCanvasRequests::CreateGeneralNode, ".entity"); - AZ_Assert(graphCanvasEntity, "Unable to create GraphCanvas Bus Node"); - - graphCanvasNodeId = graphCanvasEntity->GetId(); - - // Add the icon component - graphCanvasEntity->CreateComponent(ScriptCanvas::Nodes::Entity::EntityRef::RTTI_Type()); - graphCanvasEntity->CreateComponent(); - graphCanvasEntity->CreateComponent(entityNode->GetEntityId()); - graphCanvasEntity->CreateComponent(entityNode->GetEntityId()); - - graphCanvasEntity->Init(); - graphCanvasEntity->Activate(); - - // Set the user data on the GraphCanvas node to be the EntityId of the ScriptCanvas node - AZStd::any* graphCanvasUserData = nullptr; - GraphCanvas::NodeRequestBus::EventResult(graphCanvasUserData, graphCanvasNodeId, &GraphCanvas::NodeRequests::GetUserData); - if (graphCanvasUserData) - { - *graphCanvasUserData = entityNode->GetEntityId(); - } - - // Create the GraphCanvas slots - for (const auto& slot : entityNode->GetSlots()) - { - if (slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataOut() && slot.IsVisible()) - { - DisplayScriptCanvasSlot(graphCanvasNodeId, slot); - } - } - - AZ::Entity* sourceEntity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(sourceEntity, &AZ::ComponentApplicationRequests::FindEntity, entityNode->GetEntityRef()); - - if (sourceEntity) - { - graphCanvasEntity->SetName(AZStd::string::format("GC-EntityRef(%s)", sourceEntity->GetName().data())); - } - else - { - graphCanvasEntity->SetName(AZStd::string::format("GC-EntityRef(%s)", entityNode->GetEntityRef().ToString().c_str())); - } - - return graphCanvasNodeId; - } - static void ConfigureGeneralScriptCanvasEntity(const ScriptCanvas::Node* node, AZ::Entity* graphCanvasEntity, const GraphCanvas::SlotGroup& slotGroup = GraphCanvas::SlotGroups::Invalid) { if (node->RequiresDynamicSlotOrdering()) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h index 2ac38d86ed..59c69ea662 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h @@ -45,7 +45,6 @@ namespace ScriptCanvasEditor::Nodes AZ::EntityId DisplayScriptCanvasNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Node* node); // Core Node - AZ::EntityId DisplayEntityNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Entity::EntityRef* entityNode); AZ::EntityId DisplayEbusEventNode(AZ::EntityId graphCanvasGraphId, const AZStd::string& busName, const AZStd::string& eventName, const ScriptCanvas::EBusEventId& eventId); AZ::EntityId DisplayEbusWrapperNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::EBusEventHandler* busNode); AZ::EntityId DisplayGetVariableNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::GetVariableNode* variableNode); diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeUtils.cpp index a0d79f28a3..b3feb37671 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeUtils.cpp @@ -11,26 +11,10 @@ #include #include -#include #include namespace { - void CopyTranslationKeyedNameToDatumLabel(ScriptCanvas::PureData* node, - const GraphCanvas::TranslationKeyedString& name) - { - ScriptCanvas::SlotId slotId = node->GetSlotId(ScriptCanvas::PureData::k_setThis); - if (!slotId.IsValid()) - { - return; - } - - ScriptCanvas::ModifiableDatumView datumView; - node->FindModifiableDatumView(slotId, datumView); - - datumView.RelabelDatum(name.GetDisplayString()); - } - ScriptCanvas::ConnectionType ToScriptCanvasConnectionType(GraphCanvas::ConnectionType connectionType) { ScriptCanvas::ConnectionType scriptCanvasConnectionType = ScriptCanvas::ConnectionType::Unknown; diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index 7a9d917c52..a9aa8cd0e9 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -108,7 +107,6 @@ namespace ScriptCanvas ScriptCanvasEditor::ScriptEventReceiverNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::ScriptEventSenderNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::EBusSenderNodeDescriptorComponent::CreateDescriptor(), - ScriptCanvasEditor::EntityRefNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::VariableNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::GetVariableNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::SetVariableNodeDescriptorComponent::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp index 787d881318..9c9a19cd9c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -342,12 +341,6 @@ namespace continue; } - // Detect primitive types os we avoid making nodes out of them. - // Or anything that is 'pure data' and should be populated through a different mechanism. - if (nodeClassData->m_azRtti && nodeClassData->m_azRtti->IsTypeOf()) - { - continue; - } // Skip over some of our more dynamic nodes that we want to populate using different means else if (nodeClassData->m_azRtti && nodeClassData->m_azRtti->IsTypeOf()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp index f0290eef10..a214bb7ab8 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp @@ -24,7 +24,6 @@ #include "Editor/GraphCanvas/GraphCanvasEditorNotificationBusId.h" #include -#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp index 3c37de8386..c7649174bb 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index cfe719114f..3d6c9012cc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts.h index 8e2a748f0f..77ec030fec 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts.h @@ -11,7 +11,6 @@ #include "Contracts/DisallowReentrantExecutionContract.h" #include "Contracts/DisplayGroupConnectedSlotLimitContract.h" #include "Contracts/DynamicTypeContract.h" -#include "Contracts/ExclusivePureDataContract.h" #include "Contracts/IsReferenceTypeContract.h" #include "Contracts/MathOperatorContract.h" #include "Contracts/MethodOverloadContract.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.cpp deleted file mode 100644 index b546a4364d..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.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 "ExclusivePureDataContract.h" -#include -#include -#include -#include -#include - -namespace ScriptCanvas -{ - AZ::Outcome ExclusivePureDataContract::HasNoPureDataConnection(const Slot& dataInputSlot) const - { - bool isOnPureDataThread(true); - NodeRequestBus::EventResult(isOnPureDataThread, dataInputSlot.GetNodeId(), &NodeRequests::IsOnPureDataThread, dataInputSlot.GetId()); - - if (!isOnPureDataThread) - { - return AZ::Success(); - } - - return AZ::Failure(AZStd::string("There is already a pure data input into this slot")); - } - - AZ::Outcome ExclusivePureDataContract::OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const - { - if (sourceSlot.GetDescriptor().CanConnectTo(targetSlot.GetDescriptor())) - { - if (sourceSlot.GetDescriptor().IsInput()) - { - return HasNoPureDataConnection(sourceSlot); - } - else if (targetSlot.GetDescriptor().IsInput()) - { - return HasNoPureDataConnection(targetSlot); - } - } - - return AZ::Failure(AZStd::string("invalid data connection attempted")); - } - - void ExclusivePureDataContract::Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.h deleted file mode 100644 index 5e5865fb06..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.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 ExclusivePureDataContract - : public Contract - { - public: - AZ_CLASS_ALLOCATOR(ExclusivePureDataContract, AZ::SystemAllocator, 0); - AZ_RTTI(ExclusivePureDataContract, "{E48A0B26-B6B7-4AF3-9341-9E5C5C1F0DE8}", Contract); - - // no multiple literals, variables, defaults, gets, or any other new form of data that can be routed without getting pushed by execution - ~ExclusivePureDataContract() override = default; - - static void Reflect(AZ::ReflectContext* reflection); - - protected: - AZ::Outcome OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const override; - - AZ::Outcome HasNoPureDataConnection(const Slot& dataInputSlot) const; - }; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index a1791509b0..16edeaff5d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NativeDatumNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NativeDatumNode.h deleted file mode 100644 index 70c30198d5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NativeDatumNode.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 - -#include -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - template - class NativeDatumNode - : public PureData - { - public: - using t_ThisType = NativeDatumNode; - - AZ_RTTI(((NativeDatumNode), "{B7D8D8D6-B2F1-481A-A712-B07D1C19555F}", t_Node, t_Datum), PureData, AZ::Component); - AZ_COMPONENT_INTRUSIVE_DESCRIPTOR_TYPE(NativeDatumNode); - AZ_COMPONENT_BASE(NativeDatumNode, PureData); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("NativeDatumNode", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ; - } - } - } - - ~NativeDatumNode() override = default; - - protected: - virtual void ConfigureSetters() - { - Data::SetterContainer setterWrappers = Data::ExplodeToSetters(Data::FromAZType(Data::Traits::GetAZType())); - for (const auto& setterWrapperPair : setterWrappers) - { - SlotId setterSlotId; - const Data::SetterWrapper& setterWrapper = setterWrapperPair.second; - const AZStd::string argName = AZStd::string::format("%s: %s", Data::GetName(setterWrapper.m_propertyType).data(), setterWrapper.m_propertyName.data()); - AZStd::string_view argumentTooltip; - // Add the slot if it doesn't exist - setterSlotId = FindSlotIdForDescriptor(argName, SlotDescriptors::DataIn()); - - if (!setterSlotId.IsValid()) - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = argName; - slotConfiguration.m_toolTip = argumentTooltip; - slotConfiguration.SetType(setterWrapper.m_propertyType); - slotConfiguration.SetConnectionType(ConnectionType::Input); - - setterSlotId = AddSlot(slotConfiguration); - } - - if (setterSlotId.IsValid()) - { - m_propertyAccount.m_getterSetterIdPairs[setterWrapperPair.first].second = setterSlotId; - m_propertyAccount.m_settersByInputSlot.emplace(setterSlotId, setterWrapperPair.second); - } - } - } - - virtual void ConfigureGetters() - { - Data::GetterContainer getterWrappers = Data::ExplodeToGetters(Data::FromAZType(Data::Traits::GetAZType())); - for (const auto& getterWrapperPair : getterWrappers) - { - SlotId getterSlotId; - - const Data::GetterWrapper& getterWrapper = getterWrapperPair.second; - const AZStd::string resultSlotName(AZStd::string::format("%s: %s", getterWrapper.m_propertyName.data(), Data::GetName(getterWrapper.m_propertyType).data())); - // Add the slot if it doesn't exist - - getterSlotId = FindSlotIdForDescriptor(resultSlotName, SlotDescriptors::DataOut()); - - if (!getterSlotId.IsValid()) - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = resultSlotName; - slotConfiguration.SetType(getterWrapper.m_propertyType); - slotConfiguration.SetConnectionType(ConnectionType::Output); - - getterSlotId = AddSlot(slotConfiguration); - } - - if (getterSlotId.IsValid()) - { - m_propertyAccount.m_getterSetterIdPairs[getterWrapperPair.first].first = getterSlotId; - m_propertyAccount.m_gettersByInputSlot.emplace(getterSlotId, getterWrapperPair.second); - } - } - } - - virtual void ConfigureProperties() - { - if (IsConfigured()) - { - return; - } - - ConfigureGetters(); - ConfigureSetters(); - m_configured = true; - } - - void OnInit() override - { - AddInputAndOutputTypeSlot(Data::FromAZType()); - ConfigureProperties(); - } - }; - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index f0faf324c1..8d61eef3a0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -19,11 +19,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -48,9 +46,7 @@ namespace NodeCpp // add your named version above Current, - }; - - + }; } namespace ScriptCanvas @@ -397,7 +393,6 @@ namespace ScriptCanvas void Node::Reflect(AZ::ReflectContext* context) { Slot::Reflect(context); - ExclusivePureDataContract::Reflect(context); Nodes::NodeableNode::Reflect(context); // Version Conversion Reflection @@ -730,26 +725,11 @@ namespace ScriptCanvas // for each output slot... // for each connected node... // remove the ability to default it... - // ...and until a more viable solution is available, variable get input in another node must be exclusive - + EndpointsResolved connections = GetConnectedNodes(inputSlot); if (!connections.empty()) { - bool isConnectedToPureData = false; - - for (auto& nodePtrSlotId : connections) - { - if (azrtti_cast(nodePtrSlotId.first)) - { - isConnectedToPureData = true; - break; - } - } - - if (!isConnectedToPureData) - { - m_possiblyStaleInput.insert(slotId); - } + m_possiblyStaleInput.insert(slotId); } } } @@ -804,9 +784,7 @@ namespace ScriptCanvas bool Node::IsTargetInDataFlowPath(const Node* targetNode) const { AZStd::unordered_set path; - return azrtti_cast(this) - || azrtti_cast(targetNode) - || (targetNode && IsTargetInDataFlowPath(targetNode->GetEntityId(), path)); + return (targetNode && IsTargetInDataFlowPath(targetNode->GetEntityId(), path)); } bool Node::IsTargetInDataFlowPath(const ID& targetNodeId, AZStd::unordered_set& path) const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h index 95fc23c5d5..ca88c5179a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h @@ -316,6 +316,9 @@ namespace ScriptCanvas #define SCRIPT_CANVAS_GENERICS_TO_VM(GenericClass, ReflectClass, BehaviorContext, CategoryName)\ GenericClass::Reflect(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str()); +#define SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(GenericClass, BehaviorContext, CategoryName)\ + GenericClass::Reflect(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str()); + template class RegistrarGeneric { @@ -332,6 +335,13 @@ namespace ScriptCanvas SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(nodes.push_back({ azrtti_typeid(), AZ::AzTypeInfo::Name() })); } + static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName) + { + auto reflection = behaviorContext->Class>(libraryName); + reflection->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent)->Attribute(AZ::ScriptCanvasAttributes::Internal::ImplementedAsNodeGeneric, true); + SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(reflection->Method(t_Node::GetNodeFunctionName(), t_Node::GetFunction())->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List | AZ::Script::Attributes::ExcludeFlags::Documentation)); + } + template static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.cpp deleted file mode 100644 index 44d087e8a5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "PureData.h" - -namespace ScriptCanvas -{ - const char* PureData::k_getThis("Get"); - const char* PureData::k_setThis("Set"); - - PureData::~PureData() - { - - } - - const AZStd::unordered_map>& PureData::GetPropertyNameSlotMap() const - { - return m_propertyAccount.m_getterSetterIdPairs; - } - - void PureData::AddInputAndOutputTypeSlot(const Data::Type& type, const void* source) - { - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = k_setThis; - slotConfiguration.SetConnectionType(ConnectionType::Input); - slotConfiguration.ConfigureDatum(AZStd::move(Datum(type, Datum::eOriginality::Original, source, AZ::Uuid::CreateNull()))); - - AddSlot(slotConfiguration); - } - - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = k_getThis; - slotConfiguration.SetConnectionType(ConnectionType::Output); - slotConfiguration.SetType(type); - - AddSlot(slotConfiguration); - } - } - - void PureData::AddInputTypeAndOutputTypeSlot(const Data::Type& type) - { - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = k_setThis; - slotConfiguration.SetConnectionType(ConnectionType::Input); - slotConfiguration.SetType(type); - - AddSlot(slotConfiguration); - } - - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = k_getThis; - slotConfiguration.SetConnectionType(ConnectionType::Output); - slotConfiguration.SetType(type); - - AddSlot(slotConfiguration); - } - } - - void PureData::OnActivate() - { - PushThis(); - - for (const auto& propertySlotIdsPair : m_propertyAccount.m_getterSetterIdPairs) - { - const SlotId& getterSlotId = propertySlotIdsPair.second.first; - CallGetter(getterSlotId); - } - } - - void PureData::OnInputChanged(const Datum& input, [[maybe_unused]] const SlotId& id) - { - if (IsActivated()) - { - OnOutputChanged(input); - } - } - - AZStd::string_view PureData::GetInputDataName() const - { - return k_setThis; - } - - AZStd::string_view PureData::GetOutputDataName() const - { - return k_getThis; - } - - void PureData::CallGetter(const SlotId& getterSlotId) - { - auto getterFuncIt = m_propertyAccount.m_gettersByInputSlot.find(getterSlotId); - Slot* getterSlot = GetSlot(getterSlotId); - if (getterSlot && getterFuncIt != m_propertyAccount.m_gettersByInputSlot.end()) - { - AZStd::vector> outputNodes(ModConnectedNodes(*getterSlot)); - - if (!outputNodes.empty()) - { - auto getterOutcome = getterFuncIt->second.m_getterFunction((*FindDatum(GetSlotId(k_setThis)))); - if (!getterOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), getterOutcome.GetError().data()); - return; - } - - - for (auto& nodePtrSlot : outputNodes) - { - if (nodePtrSlot.first) - { - Node::SetInput(*nodePtrSlot.first, nodePtrSlot.second, getterOutcome.GetValue()); - } - } - } - } - } - - void PureData::SetInput(const Datum& input, const SlotId& id) - { - if (id == FindSlotIdForDescriptor(GetInputDataName(), SlotDescriptors::DataIn())) - { - // push this value, as usual - Node::SetInput(input, id); - - // now, call every getter, as every property has (presumably) been changed - for (const auto& propertyNameSlotIdsPair : m_propertyAccount.m_getterSetterIdPairs) - { - const SlotId& getterSlotId = propertyNameSlotIdsPair.second.first; - CallGetter(getterSlotId); - } - } - else - { - SetProperty(input, id); - } - } - - void PureData::SetInput(Datum&& input, const SlotId& id) - { - if (id == FindSlotIdForDescriptor(GetInputDataName(), SlotDescriptors::DataIn())) - { - // push this value, as usual - Node::SetInput(AZStd::move(input), id); - - if (IsActivated()) - { - // now, call every getter, as every property has (presumably) been changed - for (const auto& propertyNameSlotIdsPair : m_propertyAccount.m_getterSetterIdPairs) - { - const SlotId& getterSlotId = propertyNameSlotIdsPair.second.first; - CallGetter(getterSlotId); - } - } - } - else - { - SetProperty(AZStd::move(input), id); - } - } - - void PureData::SetProperty(const Datum& input, const SlotId& setterId) - { - auto methodBySlotIter = m_propertyAccount.m_settersByInputSlot.find(setterId); - if (methodBySlotIter == m_propertyAccount.m_settersByInputSlot.end()) - { - AZ_Error("Script Canvas", false, "BehaviorContextObject SlotId %s did not route to a setter", setterId.m_id.ToString().data()); - return; - } - if (!methodBySlotIter->second.m_setterFunction) - { - AZ_Error("Script Canvas", false, "BehaviorContextObject setter is not invocable for SlotId %s is nullptr", setterId.m_id.ToString().data()); - return; - } - - ModifiableDatumView datumView; - FindModifiableDatumView(GetSlotId(k_setThis), datumView); - - Datum* datum = datumView.ModifyDatum(); - - auto setterOutcome = methodBySlotIter->second.m_setterFunction((*datum), input); - - if (!setterOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), setterOutcome.TakeError().data()); - return; - } - - datumView.SignalModification(); - - PushThis(); - - auto getterSetterIt = m_propertyAccount.m_getterSetterIdPairs.find(methodBySlotIter->second.m_propertyName); - - if (getterSetterIt != m_propertyAccount.m_getterSetterIdPairs.end()) - { - CallGetter(getterSetterIt->second.first); - } - } - - - void PureData::Reflect(AZ::ReflectContext* reflectContext) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext); - if (serializeContext) - { - serializeContext->Class() - ->Version(0) - ; - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("PureData", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ; - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h deleted file mode 100644 index 01c52d7378..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.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 - * - */ - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - class BehaviorClass; - struct BehaviorValueParameter; - class ReflectContext; -} - -namespace ScriptCanvas -{ - struct PropertyAccount - { - AZStd::unordered_map m_gettersByInputSlot; - AZStd::unordered_map m_settersByInputSlot; - // The first slot id of the pair is the Getter SlotId, the second slot id of the pair is the Setter SlotID - AZStd::unordered_map> m_getterSetterIdPairs; - }; - - class PureData - : public Node - { - public: - AZ_COMPONENT(PureData, "{8B80FF54-0786-4FEE-B4A3-12907EBF8B75}", Node); - - static void Reflect(AZ::ReflectContext* reflectContext); - static const char* k_getThis; - static const char* k_setThis; - - const AZStd::unordered_map>& GetPropertyNameSlotMap() const; - - AZ_INLINE AZ::Outcome GetDependencies() const override { return AZ::Success(DependencyReport{}); } - - ~PureData() override; - - protected: - void AddInputAndOutputTypeSlot(const Data::Type& type, const void* defaultValue = nullptr); - template - void AddDefaultInputAndOutputTypeSlot(DatumType&& defaultValue); - void AddInputTypeAndOutputTypeSlot(const Data::Type& type); - - bool IsDeprecated() const override { return true; } - - void OnActivate() override; - void OnInputChanged(const Datum& input, const SlotId& id) override; - void MarkDefaultableInput() override {} - - AZ_INLINE void OnOutputChanged(const Datum& output) const - { - Slot* slot = GetSlotByName(GetOutputDataName()); - if (slot) - { - OnOutputChanged(output, (*slot)); - } - } - - AZ_INLINE void OnOutputChanged(const Datum& output, const Slot& outputSlot) const - { - PushOutput(output, outputSlot); - } - - // push data out - AZ_INLINE void PushThis() - { - auto slotId = GetSlotId(GetInputDataName()); - - if (auto setDatum = FindDatum(slotId)) - { - OnInputChanged(*setDatum, slotId); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), "No input datum in a PureData class %s. You must push your data manually in OnActivate() if no input is connected!"); - } - } - - AZStd::string_view GetInputDataName() const; - AZStd::string_view GetOutputDataName() const; - - void SetInput(const Datum& input, const SlotId& id) override; - void SetInput(Datum&& input, const SlotId& id) override; - void SetProperty(const Datum& input, const SlotId& id); - void CallGetter(const SlotId& getterSlotId); - bool IsConfigured() { return m_configured; } - - PropertyAccount m_propertyAccount; - bool m_configured = false; - }; - - template - void PureData::AddDefaultInputAndOutputTypeSlot(DatumType&& defaultValue) - { - AddInputDatumSlot(GetInputDataName(), "", Datum::eOriginality::Original, AZStd::forward(defaultValue)); - AddOutputTypeSlot(GetOutputDataName(), "", Data::FromAZType(azrtti_typeid>()), OutputStorage::Optional); - } - - template<> - void PureData::AddDefaultInputAndOutputTypeSlot(Data::Type&&) = delete; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index 5b117dc4a9..2517c0c7ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -231,12 +231,6 @@ namespace ScriptCanvas // Add the slot type contract by default, It is used for filtering input/output slots and flow/data slots m_contracts.emplace_back(AZStd::make_unique()); - // Every DataIn slot has a contract validating that only 1 connection from any PureData node is allowed - if (IsData() && IsInput()) - { - AddContract({ []() { return aznew ExclusivePureDataContract(); } }); - } - for (const auto& contractDesc : slotConfiguration.m_contractDescs) { AddContract(contractDesc); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.cpp deleted file mode 100644 index 39faae9f0a..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.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 - * - */ - -#include "Assign.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - void Assign::OnInit() - { - AddSlot("In", "", SlotType::ExecutionIn); - AddSlot("Out", "", SlotType::ExecutionOut); - AddInputDatumDynamicTypedSlot("Source"); - AddSlot("Target", "", SlotType::DataOut); - } - - Data::Type Assign::GetSlotDataType(const SlotId& slotId) const - { - if (Slot* sourceSlot = GetSlot(GetSlotId("Source"))) - { - auto inputs = GetConnectedNodes(*sourceSlot); - // contracts should enforce this, but in case it breaks... - if (inputs.size() == 1) - { - auto input = *inputs.begin(); - return input.first->GetSlotDataType(input.second); - } - else - { - AZ_Error("ScriptCanvas", (inputs.size() == 0), "Multiple inputs to 'Assign' are forbidden"); - } - } - - return Data::Type::Invalid(); - } - - void Assign::OnInputSignal(const SlotId&) - { - if (auto input = GetDatumByIndex(k_sourceInputIndex)) - { - PushOutput(*input, *GetSlotByIndex(k_targetSlotIndex)); - } - - SignalOutput(GetSlotId("Out")); - } - - AZStd::Outcome Assign::SlotAcceptsType(const SlotId& slotID, const Data::Type& type) const - { - Slot* sourceSlot = GetSlot(GetSlotId("Source")); - Slot* targetSlot = GetSlot(GetSlotId("Target")); - - if (sourceSlot == nullptr - || targetSlot == nullptr) - { - return AZ::Failure(AZStd::string("Unable to find all necessary slots on node");) - } - - return DynamicSlotAcceptsType(slotID, type, Node::DynamicTypeArity::Single, *targetSlot, AZStd::vector{sourceSlot}); - } - - void Assign::Reflect(AZ::ReflectContext* reflectContext) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Assign", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/ScriptCanvas/Placeholder.png") - ; - } - } - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.h deleted file mode 100644 index 89d164f3d2..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Assign.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 ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - class Assign - : public Node - { - public: - AZ_COMPONENT(Assign, "{E734ADCE-D822-4487-9681-5A80D8E4D263}", Node); - - static void Reflect(AZ::ReflectContext* reflectContext); - - protected: - static const int k_sourceInputIndex = 0; - static const int k_targetSlotIndex = 3; - - Data::Type GetSlotDataType(const SlotId& slotId) const override; - void OnInit() override; - void OnInputSignal(const SlotId&) override; - AZ::Outcome SlotAcceptsType(const SlotId&, const Data::Type&) const override; - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.cpp deleted file mode 100644 index c4d3b6f302..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "BehaviorContextObjectNode.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - namespace Internal - { - static const AZ::u32 k_thisParamIndex(0); - static const AZ::u32 k_setValueParamIndex(1); - static const AZ::u32 k_firstFirstPropertyDataSlotIndex(2); - static const AZ::u32 k_valueArgumentIndex(1); - static const char* k_setThis("Set"); - } - - AZStd::string BehaviorContextObjectNode::GetDebugName() const - { - if (auto input = FindDatum(GetSlotId(Internal::k_setThis))) - { - return Data::GetName(input->GetType()); - } - - return "Invalid"; - } - - void BehaviorContextObjectNode::InitializeObject(const AZ::Uuid& azType) - { - // \todo this works with basic types, and it probably shouldn't - if (auto bcClass = AZ::BehaviorContextHelper::GetClass(azType)) - { - InitializeObject(*bcClass); - } - else - { - const void* defaultValue = nullptr; - if (Data::IsEntityID(azType)) - { - defaultValue = &ScriptCanvas::GraphOwnerId; - } - AddInputAndOutputTypeSlot(Data::FromAZType(azType), defaultValue); - } - } - - void BehaviorContextObjectNode::InitializeObject(const AZStd::string& classNameString) - { - if (auto bcClass = AZ::BehaviorContextHelper::GetClass(classNameString)) - { - InitializeObject(*bcClass); - } - } - - void BehaviorContextObjectNode::InitializeObject(const AZ::BehaviorClass& behaviorClass) - { - m_className = behaviorClass.m_name; - const void* defaultValue = nullptr; - if (Data::IsEntityID(behaviorClass.m_typeId)) - { - defaultValue = &ScriptCanvas::GraphOwnerId; - } - AddInputAndOutputTypeSlot(Data::FromAZType(behaviorClass.m_typeId), defaultValue); - ConfigureProperties(behaviorClass); - } - - void BehaviorContextObjectNode::InitializeObject(const Data::Type& type) - { - if (auto bcClass = AZ::BehaviorContextHelper::GetClass(type.GetAZType())) - { - InitializeObject(*bcClass); - } - } - - void BehaviorContextObjectNode::ConfigureSetters(const AZ::BehaviorClass& behaviorClass) - { - Data::SetterContainer setterWrappers = Data::ExplodeToSetters(Data::FromAZType(behaviorClass.m_typeId)); - for (const auto& setterWrapperPair : setterWrappers) - { - SlotId setterSlotId; - auto propertyIt = behaviorClass.m_properties.find(setterWrapperPair.first); - if (propertyIt != behaviorClass.m_properties.end()) - { - const Data::SetterWrapper& setterWrapper = setterWrapperPair.second; - const AZStd::string argName = AZStd::string::format("%s: %s", Data::GetName(setterWrapper.m_propertyType).data(), setterWrapper.m_propertyName.data()); - const AZStd::string* argumentTooltipPtr = propertyIt->second->m_setter->GetArgumentToolTip(Internal::k_setValueParamIndex); - AZStd::string_view argumentTooltip = argumentTooltipPtr ? AZStd::string_view(*argumentTooltipPtr) : AZStd::string_view{}; - - // Add the slot if it doesn't exist - setterSlotId = FindSlotIdForDescriptor(argName, SlotDescriptors::DataIn()); - - if (!setterSlotId.IsValid()) - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = argName; - slotConfiguration.m_toolTip = argumentTooltip; - slotConfiguration.SetType(setterWrapper.m_propertyType); - slotConfiguration.SetConnectionType(ConnectionType::Input); - - setterSlotId = AddSlot(slotConfiguration); - } - - } - if (setterSlotId.IsValid()) - { - m_propertyAccount.m_getterSetterIdPairs[setterWrapperPair.first].second = setterSlotId; - m_propertyAccount.m_settersByInputSlot.emplace(setterSlotId, setterWrapperPair.second); - } - } - } - - void BehaviorContextObjectNode::ConfigureGetters(const AZ::BehaviorClass& behaviorClass) - { - Data::GetterContainer getterWrappers = Data::ExplodeToGetters(Data::FromAZType(behaviorClass.m_typeId)); - for (const auto& getterWrapperPair : getterWrappers) - { - SlotId getterSlotId; - auto propertyIt = behaviorClass.m_properties.find(getterWrapperPair.first); - if (propertyIt != behaviorClass.m_properties.end()) - { - const Data::GetterWrapper& getterWrapper = getterWrapperPair.second; - const AZStd::string resultSlotName(AZStd::string::format("%s: %s", getterWrapper.m_propertyName.data(), Data::GetName(getterWrapper.m_propertyType).data())); - - // Add the slot if it doesn't exist - getterSlotId = FindSlotIdForDescriptor(resultSlotName, SlotDescriptors::DataOut()); - - if (!getterSlotId.IsValid()) - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = resultSlotName; - slotConfiguration.SetType(getterWrapper.m_propertyType); - slotConfiguration.SetConnectionType(ConnectionType::Output); - - getterSlotId = AddSlot(slotConfiguration); - } - - } - if (getterSlotId.IsValid()) - { - m_propertyAccount.m_getterSetterIdPairs[getterWrapperPair.first].first = getterSlotId; - m_propertyAccount.m_gettersByInputSlot.emplace(getterSlotId, getterWrapperPair.second); - } - } - } - - void BehaviorContextObjectNode::ConfigureProperties(const AZ::BehaviorClass& behaviorClass) - { - if (IsConfigured()) - { - return; - } - - ConfigureGetters(behaviorClass); - ConfigureSetters(behaviorClass); - m_configured = true; - } - - void BehaviorContextObjectNode::OnInit() - { - if (auto input = FindDatum(GetSlotId(k_setThis))) - { - if (!input->Empty()) - { - AddInputTypeAndOutputTypeSlot(input->GetType()); - } - } - } - - void BehaviorContextObjectNode::OnWriteEnd() - { - AZStd::lock_guard lock(m_mutex); - - auto bcClass = !m_className.empty() ? AZ::BehaviorContextHelper::GetClass(m_className) : nullptr; - - if (bcClass) - { - ConfigureProperties(*bcClass); - } - } - - - void BehaviorContextObjectNode::Reflect(AZ::ReflectContext* reflectContext) - { - if (auto serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(1) - ->EventHandler>() - ->Field("m_className", &BehaviorContextObjectNode::m_className) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("BehaviorContextObjectNode", "BehaviorContextObjectNode") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) - ; - } - } - } - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.h deleted file mode 100644 index 88680fd0a3..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.h +++ /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 - * - */ - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - class BehaviorClass; - struct BehaviorValueParameter; - class ReflectContext; -} - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - class BehaviorContextObjectNode - : public PureData - { - public: - //\todo move to behavior context - enum ParameterCount - { - Getter = 1, - Setter = 2, - }; - - AZ_COMPONENT(BehaviorContextObjectNode, "{4344869D-2543-4FA3-BCD0-B6DB1E815928}", PureData); - - static void Reflect(AZ::ReflectContext* reflectContext); - - BehaviorContextObjectNode() = default; - - ~BehaviorContextObjectNode() override = default; - - AZStd::string GetDebugName() const override; - - void InitializeObject(const AZ::Uuid& azType); - - void InitializeObject(const AZStd::string& classNameString); - - void InitializeObject(const Data::Type& type); - - void OnWriteEnd(); - - protected: - void InitializeObject(const AZ::BehaviorClass& behaviorClass); - void OnInit() override; - - virtual void ConfigureSetters(const AZ::BehaviorClass& behaviorClass); - virtual void ConfigureGetters(const AZ::BehaviorClass& behaviorClass); - void ConfigureProperties(const AZ::BehaviorClass& behaviorClass); - - private: - AZStd::recursive_mutex m_mutex; // post-serialization - AZStd::string m_className; - - BehaviorContextObjectNode(const BehaviorContextObjectNode&) = delete; - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h index 92890b2842..eb44ce5db1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp index f5a9148231..3c02099403 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp @@ -103,9 +103,7 @@ namespace ScriptCanvas AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); @@ -128,9 +126,7 @@ namespace ScriptCanvas ScriptCanvas::Nodes::Core::ErrorHandler::CreateDescriptor(), ScriptCanvas::Nodes::Core::Method::CreateDescriptor(), ScriptCanvas::Nodes::Core::MethodOverloaded::CreateDescriptor(), - ScriptCanvas::Nodes::Core::BehaviorContextObjectNode::CreateDescriptor(), ScriptCanvas::Nodes::Core::Start::CreateDescriptor(), - ScriptCanvas::Nodes::Core::String::CreateDescriptor(), ScriptCanvas::Nodes::Core::EBusEventHandler::CreateDescriptor(), ScriptCanvas::Nodes::Core::AzEventHandler::CreateDescriptor(), ScriptCanvas::Nodes::Core::ExtractProperty::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h index 2551dfb4b1..567304ee37 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h @@ -10,7 +10,6 @@ // This header is only meant to include the nodes and should not contain // shared code -#include "BehaviorContextObjectNode.h" #include "EBusEventHandler.h" #include "Error.h" #include "ErrorHandler.h" @@ -28,4 +27,3 @@ #include "SendScriptEvent.h" #include "SetVariable.h" #include "Start.h" -#include "String.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp index a53eb18cbb..06485f5e0a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp @@ -9,7 +9,6 @@ #include #include -#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp index c97654c1d8..574ccaeecb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp @@ -5,8 +5,6 @@ * */ #include -#include - #include namespace ScriptCanvas @@ -64,31 +62,6 @@ namespace ScriptCanvas return m_dataType; } - void ExtractProperty::OnInputSignal(const SlotId& slotID) - { - if (slotID == GetSlotId(GetInputSlotName())) - { - if (auto input = FindDatum(ExtractPropertyProperty::GetSourceSlotId(this))) - { - for(auto&& propertyAccount : m_propertyAccounts) - { - Slot* propertySlot = GetSlot(propertyAccount.m_propertySlotId); - if (propertySlot && propertyAccount.m_getterFunction) - { - auto outputOutcome = propertyAccount.m_getterFunction(*input); - if (!outputOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), outputOutcome.TakeError().data()); - return; - } - PushOutput(outputOutcome.TakeValue(), *propertySlot); - } - } - } - SignalOutput(GetSlotId(GetOutputSlotName())); - } - } - void ExtractProperty::AddPropertySlots(const Data::Type& type) { AZStd::unordered_map versionedInfo; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h index eb255c8f09..7cde7401db 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h @@ -47,14 +47,10 @@ namespace ScriptCanvas protected: - bool IsPropertySlot(const SlotId& slotId) const; - void OnInit() override; UpdateResult OnUpdateNode() override; - void OnInputSignal(const SlotId&) override; - void OnSlotDisplayTypeChanged(const SlotId& slotId, const Data::Type& dataType) override; void AddPropertySlots(const Data::Type& type); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp index 6584f795b8..496b164726 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/String.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/String.h deleted file mode 100644 index 712d3d808f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/String.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - - class String - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(String, "{9C9B9D96-1838-4493-A14D-40C77B4DB5DD}", ParentType); - - static void Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(3) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("String", "Holds a string value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/String.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp index 43d84f0e28..1695c1d4d3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp @@ -18,17 +18,6 @@ namespace ScriptCanvas const char* UnaryOperator::k_valueName = "Value"; const char* UnaryOperator::k_resultName = "Result"; - Datum UnaryOperator::Evaluate([[maybe_unused]] const Datum& value) - { - AZ_Assert(false, "Evaluate must be overridden"); - return Datum(); - }; - - void UnaryOperator::OnInputSignal([[maybe_unused]] const SlotId& slot) - { - AZ_Assert(false, "OnInputSignal must be overridden"); - } - void UnaryOperator::ConfigureSlots() { { @@ -68,25 +57,6 @@ namespace ScriptCanvas { } - void UnaryExpression::OnInputSignal(const SlotId&) - { - const Datum output = Evaluate(*FindDatumByIndex(k_datumIndex)); - if (auto slot = GetSlot(GetOutputSlotId())) - { - PushOutput(output, *slot); - } - - const bool* value = output.GetAs(); - if (value && *value) - { - SignalOutput(GetSlotId(k_onTrue)); - } - else - { - SignalOutput(GetSlotId(k_onFalse)); - } - } - void UnaryExpression::ConfigureSlots() { { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h index d2188f0b3c..9805c6d9ef 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace ScriptCanvas @@ -32,8 +31,6 @@ namespace ScriptCanvas static const char* k_onTrue; static const char* k_onFalse; - - protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot*) const override { @@ -45,15 +42,7 @@ namespace ScriptCanvas void ConfigureSlots() override; - // must be overridden with the binary operations - virtual Datum Evaluate(const Datum& value); - - // Triggered by the execution signal - void OnInputSignal(const SlotId& slot) override; - - SlotId GetOutputSlotId() const; - - + SlotId GetOutputSlotId() const; }; class UnaryExpression : public UnaryOperator @@ -67,11 +56,7 @@ namespace ScriptCanvas void ConfigureSlots() override; - void OnInputSignal(const SlotId& slot) override; - - virtual void InitializeUnaryExpression(); - - + virtual void InitializeUnaryExpression(); }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp index 79a89ab1bf..d55de9be45 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp @@ -11,8 +11,6 @@ namespace ScriptCanvas { - - static bool OldEntityIdIsValidNodeVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootNodeElement) { int nodeElementIndex = rootNodeElement.FindElement(AZ_CRC("BaseClass1", 0xd4925735)); @@ -72,9 +70,7 @@ namespace ScriptCanvas } if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) { - using namespace ScriptCanvas::Nodes::Entity; - SCRIPT_CANVAS_GENERICS_TO_VM(EntityIDNodes::Registrar, EntityID, behaviorContext, EntityIDNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(EntityNodes::Registrar, Entity, behaviorContext, EntityNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(EntityNodes::Registrar, behaviorContext, EntityNodes::k_categoryName); } ScriptCanvas::Entity::RotateMethod::Reflect(reflection); @@ -82,25 +78,15 @@ namespace ScriptCanvas void Entity::InitNodeRegistry(NodeRegistry& nodeRegistry) { - using namespace ScriptCanvas::Nodes::Entity; - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); EntityIDNodes::Registrar::AddToRegistry(nodeRegistry); EntityNodes::Registrar::AddToRegistry(nodeRegistry); } AZStd::vector Entity::GetComponentDescriptors() { - AZStd::vector descriptors = { - ScriptCanvas::Nodes::Entity::Rotate::CreateDescriptor(), - ScriptCanvas::Nodes::Entity::EntityID::CreateDescriptor(), - ScriptCanvas::Nodes::Entity::EntityRef::CreateDescriptor() - }; - + AZStd::vector descriptors; EntityIDNodes::Registrar::AddDescriptors(descriptors); EntityNodes::Registrar::AddDescriptors(descriptors); - return descriptors; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h index 0bd54f4194..be746e65f0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h @@ -10,9 +10,6 @@ // This header is only meant to include the nodes and should not contain // shared code -#include "Rotate.h" #include "RotateMethod.h" -#include "EntityIDNode.h" #include "EntityIDNodes.h" -#include "EntityRef.h" #include "EntityNodes.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNode.h deleted file mode 100644 index 5b60c0cea8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - class EntityID - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(EntityID, "{37F26070-F29B-412A-9228-86D8D10F3C32}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("EntityID", "Stores a reference to an entity") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/EntityID.png") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityRef.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityRef.h deleted file mode 100644 index 720205a158..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityRef.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - class EntityRef - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(EntityRef, "{0EE5782F-B241-4127-AE53-E6746B00447F}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(2) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - // EntityRef node is special in that it's only created when we drag in an entity from the main scene. - // And is unmodifiable(essentially an external constant). As such, we hide it from the node palette. - editContext->Class("EntityID", "Stores a reference to an entity") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/EntityRef.png") - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) - ; - } - } - } - - AZ_INLINE void SetEntityRef(const AZ::EntityId& id) - { - ModifiableDatumView datumView; - FindModifiableDatumView(GetSlotId(k_setThis), datumView); - - if (datumView.IsValid()) - { - // only called on edit time creation, so no need to push out the data, consider cutting this function if possible - datumView.SetAs(id); - OnOutputChanged((*datumView.GetDatum())); - } - } - - AZ_INLINE AZ::EntityId GetEntityRef() const - { - AZ::EntityId retVal; - if (auto input = FindDatum(GetSlotId(k_setThis))) - { - const AZ::EntityId* inputId = input->GetAs(); - - if (inputId) - { - retVal = (*inputId); - } - } - - return retVal; - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.ScriptCanvasGrammar.xml b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.ScriptCanvasGrammar.xml deleted file mode 100644 index 0b2c5714d7..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.ScriptCanvasGrammar.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp deleted file mode 100644 index b1df21ea52..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.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 - -#include - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - void Rotate::OnInputSignal(const SlotId&) - { - AZ::EntityId targetEntity = RotateProperty::GetEntity(this); - - if (!targetEntity.IsValid()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Invalid entity specified"); - return; - } - - AZ::Entity* entity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, targetEntity); - if (entity) - { - AZ::Vector3 angles = AZ::Vector3::CreateZero(); - if (entity->GetState() == AZ::Entity::State::Active) - { - angles = RotateProperty::GetEulerAngles(this); - - AZ::Quaternion rotation = AZ::ConvertEulerDegreesToQuaternion(angles); - - AZ::Transform currentTransform = AZ::Transform::CreateIdentity(); - AZ::TransformBus::EventResult(currentTransform, targetEntity, &AZ::TransformInterface::GetWorldTM); - - currentTransform.SetRotation((rotation * currentTransform.GetRotation().GetNormalized())); - - AZ::TransformBus::Event(targetEntity, &AZ::TransformInterface::SetWorldTM, currentTransform); - } - } - - SignalOutput(RotateProperty::GetOutSlotId(this)); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.h deleted file mode 100644 index cf6c19c417..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.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 - -// LY-103055 Temporary workaround to fix compile error when building Android NDK 19 and above due to AzCodeGenerator -// not receiving the correct clang system includes -namespace AZ -{ - class EntityId; - class Vector3; -} - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - //! Deprecated: see Entity Transform class' reflection of method "Rotate" - class Rotate - : public Node - { - - public: - - SCRIPTCANVAS_NODE(Rotate); - - void OnInputSignal(const SlotId&) override; - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Boolean.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Boolean.h deleted file mode 100644 index 5a118d9374..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Boolean.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Logic - { - class Boolean - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Boolean, "{263E8CAE-9F20-4198-A937-14761A46D996}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(4) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Boolean", "A boolean value (true/false)") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Boolean.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.cpp index 3a36a265c2..a0462ae69a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.cpp @@ -17,29 +17,12 @@ namespace ScriptCanvas { Gate::Gate() : Node() - , m_condition(false) {} AZ::Outcome Gate::GetDependencies() const { return AZ::Success(DependencyReport{}); } - - void Gate::OnInputSignal(const SlotId&) - { - SlotId trueSlot = GateProperty::GetTrueSlotId(this); - SlotId falseSlot = GateProperty::GetFalseSlotId(this); - - m_condition = GateProperty::GetCondition(this); - if (m_condition) - { - SignalOutput(trueSlot); - } - else - { - SignalOutput(falseSlot); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h index 0480db1f32..a8e04489d0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h @@ -9,7 +9,6 @@ #include #include -#include #include @@ -24,7 +23,6 @@ namespace ScriptCanvas : public Node { public: - SCRIPTCANVAS_NODE(Gate); Gate(); @@ -34,24 +32,13 @@ namespace ScriptCanvas AZ::Outcome GetDependencies() const override; - bool IsIfBranch() const override { return true; } - - + bool IsIfBranch() const override { return true; } protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override { return AZ::Success(GetSlotsByType(targetSlotType)); } - - ////////////////////////////////////////////////////////////////////////// - - void OnInputSignal(const SlotId&) override; - - private: - - bool m_condition; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp index 8bd587ee4b..444a312edc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp @@ -43,7 +43,6 @@ namespace ScriptCanvas using namespace ScriptCanvas::Nodes::Logic; AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); @@ -65,7 +64,6 @@ namespace ScriptCanvas return AZStd::vector({ ScriptCanvas::Nodes::Logic::And::CreateDescriptor(), ScriptCanvas::Nodes::Logic::Any::CreateDescriptor(), - ScriptCanvas::Nodes::Logic::Boolean::CreateDescriptor(), ScriptCanvas::Nodes::Logic::Break::CreateDescriptor(), ScriptCanvas::Nodes::Logic::Cycle::CreateDescriptor(), ScriptCanvas::Nodes::Logic::Gate::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.h index a59a4e4a88..26fa846885 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.h @@ -12,7 +12,6 @@ #include "And.h" #include "Any.h" -#include "Boolean.h" #include "Break.h" #include "Cycle.h" #include "Gate.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h index 58e0d747c7..ee61c6637a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h @@ -8,7 +8,6 @@ #pragma once #include -#include namespace ScriptCanvas { @@ -64,14 +63,6 @@ namespace ScriptCanvas } // Translation ////////////////////////////////////////////////////////////////////////// - - protected: - - Datum Evaluate(const Datum& value) override - { - const bool* boolValue = value.GetAs(); - return Datum(boolValue && (!(*boolValue))); - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h index e216b7e793..31bcf9a158 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h @@ -9,7 +9,6 @@ #include #include -#include #include @@ -30,9 +29,7 @@ namespace ScriptCanvas Once(); - AZ::Outcome GetDependencies() const override; - - + AZ::Outcome GetDependencies() const override; protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h index 68a6b9fdfc..bb0ed3088b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h @@ -32,16 +32,13 @@ namespace ScriptCanvas SlotId GetLoopSlotId() const override; - bool IsFormalLoop() const override; - - + bool IsFormalLoop() const override; protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override { return AZ::Success(GetSlotsByType(targetSlotType)); } - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/AABBNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/AABBNode.h deleted file mode 100644 index fb138194c5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/AABBNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class AABB - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(AABB, "{AB0C2753-680E-47AD-8277-66B3AC01C659}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("AABB", "An axis-aligned bounding box value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/AABB.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/CRCNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/CRCNode.h deleted file mode 100644 index b1824d0e70..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/CRCNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class CRC - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(CRC, "{AC47D631-38C3-4B03-A987-425189D1D165}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("CRC", "A CRC value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/CRC.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/ColorNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/ColorNode.h deleted file mode 100644 index 84b9b38b69..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/ColorNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Color - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Color, "{26FBE6FF-C4B4-4D62-9474-3B2EE1B3E165}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Color", "A four channel color value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Color.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp index 6fa228c3b9..b287453f0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp @@ -37,20 +37,22 @@ namespace ScriptCanvas if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) { using namespace ScriptCanvas::Nodes::Math; - SCRIPT_CANVAS_GENERICS_TO_VM(AABBNodes::Registrar, AABB, behaviorContext, AABBNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(CRCNodes::Registrar, CRC, behaviorContext, CRCNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(ColorNodes::Registrar, Color, behaviorContext, ColorNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(MathNodes::Registrar, Math, behaviorContext, MathNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(Matrix3x3Nodes::Registrar, Matrix3x3, behaviorContext, Matrix3x3Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(Matrix4x4Nodes::Registrar, Matrix4x4, behaviorContext, Matrix4x4Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(OBBNodes::Registrar, OBB, behaviorContext, OBBNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(PlaneNodes::Registrar, Plane, behaviorContext, PlaneNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(QuaternionNodes::Registrar, Quaternion, behaviorContext, QuaternionNodes::k_categoryName); SCRIPT_CANVAS_GENERICS_TO_VM(RandomNodes::Registrar, Random, behaviorContext, RandomNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(TransformNodes::Registrar, Transform, behaviorContext, TransformNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(Vector2Nodes::Registrar, Vector2, behaviorContext, Vector2Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(Vector3Nodes::Registrar, Vector3, behaviorContext, Vector3Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM(Vector4Nodes::Registrar, Vector4, behaviorContext, Vector4Nodes::k_categoryName); + + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(AABBNodes::Registrar, behaviorContext, AABBNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(CRCNodes::Registrar, behaviorContext, CRCNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(ColorNodes::Registrar, behaviorContext, ColorNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix3x3Nodes::Registrar, behaviorContext, Matrix3x3Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix4x4Nodes::Registrar, behaviorContext, Matrix4x4Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(OBBNodes::Registrar, behaviorContext, OBBNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(PlaneNodes::Registrar, behaviorContext, PlaneNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(QuaternionNodes::Registrar, behaviorContext, QuaternionNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(TransformNodes::Registrar, behaviorContext, TransformNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector2Nodes::Registrar, behaviorContext, Vector2Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector3Nodes::Registrar, behaviorContext, Vector3Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector4Nodes::Registrar, behaviorContext, Vector4Nodes::k_categoryName); } Nodes::Internal::ExpressionNodeBase::Reflect(reflection); @@ -59,25 +61,12 @@ namespace ScriptCanvas void Math::InitNodeRegistry(NodeRegistry& nodeRegistry) { using namespace ScriptCanvas::Nodes::Math; - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); + AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AABBNodes::Registrar::AddToRegistry(nodeRegistry); ColorNodes::Registrar::AddToRegistry(nodeRegistry); @@ -98,25 +87,11 @@ namespace ScriptCanvas AZStd::vector Math::GetComponentDescriptors() { AZStd::vector descriptors = { - ScriptCanvas::Nodes::Math::AABB::CreateDescriptor(), - ScriptCanvas::Nodes::Math::CRC::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Color::CreateDescriptor(), ScriptCanvas::Nodes::Math::Divide::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Matrix3x3::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Matrix4x4::CreateDescriptor(), ScriptCanvas::Nodes::Math::MathExpression::CreateDescriptor(), ScriptCanvas::Nodes::Math::Multiply::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Number::CreateDescriptor(), - ScriptCanvas::Nodes::Math::OBB::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Plane::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Random::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Quaternion::CreateDescriptor(), ScriptCanvas::Nodes::Math::Subtract::CreateDescriptor(), ScriptCanvas::Nodes::Math::Sum::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Transform::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Vector2::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Vector3::CreateDescriptor(), - ScriptCanvas::Nodes::Math::Vector4::CreateDescriptor(), }; AABBNodes::Registrar::AddDescriptors(descriptors); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.h index e9b39c582f..cc4795498a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.h @@ -10,34 +10,22 @@ // This header is only meant to include the nodes and should not contain // shared code -#include "AABBNode.h" #include "AABBNodes.h" -#include "ColorNode.h" #include "ColorNodes.h" -#include "CRCNode.h" #include "CRCNodes.h" #include "Divide.h" #include "MathGenerics.h" #include "MathRandom.h" -#include "Matrix3x3Node.h" #include "Matrix3x3Nodes.h" -#include "Matrix4x4Node.h" #include "Matrix4x4Nodes.h" #include "MathExpression.h" #include "Multiply.h" -#include "Number.h" -#include "OBBNode.h" #include "OBBNodes.h" -#include "PlaneNode.h" #include "PlaneNodes.h" -#include "Random.h" -#include "Rotation.h" #include "RotationNodes.h" #include "Subtract.h" #include "Sum.h" -#include "Transform.h" #include "TransformNodes.h" -#include "Vector.h" #include "Vector2Nodes.h" #include "Vector3Nodes.h" #include "Vector4Nodes.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix3x3Node.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix3x3Node.h deleted file mode 100644 index 4417413567..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix3x3Node.h +++ /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 - * - */ - -#pragma once - -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Matrix3x3 - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Matrix3x3, "{9FDA1949-A74F-4D27-BBD0-8E6F165291FE}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Matrix3x3", "A 3x3 matrix value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Matrix3x3.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix4x4Node.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix4x4Node.h deleted file mode 100644 index da7d5983f4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Matrix4x4Node.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Matrix4x4 - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Matrix4x4, "{CF059648-8BE5-4CC6-B909-4D3EBD945071}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Matrix4x4", "A 4x4 matrix value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Matrix4x4.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Number.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Number.h deleted file mode 100644 index 9639f1fce7..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Number.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 -{ - namespace Nodes - { - namespace Math - { - class Number - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Number, "{E1E746E9-2761-431E-9D06-717381F9822D}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(3) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Number", "A numeric value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Number.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/OBBNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/OBBNode.h deleted file mode 100644 index 24718c82f4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/OBBNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class OBB - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(OBB, "{C63E8C27-412B-4CEE-959B-3D97E1D17370}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("OBB", "An oriented bounding box value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/OBB.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/PlaneNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/PlaneNode.h deleted file mode 100644 index c429eb1dc3..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/PlaneNode.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Plane - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Plane, "{A756E230-B4DC-42E7-A160-20A803CC8FA1}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Plane", "A plane value according to the equation: Ax + By + Cz + D = 0") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Plane.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.ScriptCanvasGrammar.xml b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.ScriptCanvasGrammar.xml deleted file mode 100644 index d2f3aede03..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.ScriptCanvasGrammar.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.cpp deleted file mode 100644 index dba370fa7c..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.cpp +++ /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 - * - */ - -#include "Random.h" -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - - void Random::OnInputSignal(const SlotId& slotId) - { - if (slotId == RandomProperty::GetInSlotId(this)) - { - const SlotId resultSlotId = RandomProperty::GetResultSlotId(this); - - if (Slot* resultSlot = GetSlot(resultSlotId)) - { - float minValue = RandomProperty::GetMin(this); - float maxValue = RandomProperty::GetMax(this); - - auto randVal = MathNodeUtilities::GetRandom(minValue, maxValue); - - Datum o(Data::Type::Number(), Datum::eOriginality::Copy); - o.Set(randVal); - PushOutput(o, *resultSlot); - } - } - - SignalOutput(RandomProperty::GetOutSlotId(this)); - } - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.h deleted file mode 100644 index a5cc7d1aa9..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Random.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 - - -#include - -#include - - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - //! Provides a random value within the specified range, uses std::uniform_real_distribution and std::mt19937 - class Random - : public Node - { - public: - - SCRIPTCANVAS_NODE(Random); - - void OnInputSignal(const SlotId& slotId); - - }; - } - } -} - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Rotation.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Rotation.h deleted file mode 100644 index 9e23a206a1..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Rotation.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 -{ - namespace Nodes - { - namespace Math - { - class Quaternion - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Quaternion, "{E17FE11D-69F2-4746-B582-778B48D0BF47}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Quaternion", "imaginary(X, Y, Z), real W") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Quaternion.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Transform.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Transform.h deleted file mode 100644 index e4260966a9..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Transform.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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Transform - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Transform, "{B74F127B-72E0-486B-86FF-2233767C2804}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Transform", "A 3D transform value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Transform.png") - ; - } - } - } - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector.h deleted file mode 100644 index af5054c45e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector.h +++ /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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - class Vector2 - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Vector2, "{EB647398-7F56-4727-9C7C-277593DB1F11}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Vector2", "A 2D vector value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Vector.png") - ; - } - } - } - - }; - - class Vector3 - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Vector3, "{95A12BDE-D4B4-47E8-A917-3E42F678E7FA}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Vector3", "A 3D vector value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Vector.png") - ; - } - } - } - - }; - - class Vector4 - : public NativeDatumNode - { - public: - using ParentType = NativeDatumNode; - AZ_COMPONENT(Vector4, "{9CAE50A1-C575-4DFC-95C5-FA0A12DABCBD}", ParentType); - - static void Reflect(AZ::ReflectContext* reflection) - { - ParentType::Reflect(reflection); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Vector4", "A 4D vector value") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Vector.png") - ; - } - } - } - - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp b/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp index 1c614dc5bc..792c72b3f6 100644 --- a/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp +++ b/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -43,7 +42,6 @@ namespace ScriptCanvas ScriptCanvas::Debugger::ServiceComponent::CreateDescriptor(), ScriptCanvas::Graph::CreateDescriptor(), ScriptCanvasEditor::ScriptCanvasFunctionDataComponent::CreateDescriptor(), - ScriptCanvas::PureData::CreateDescriptor(), ScriptCanvas::GraphVariableManagerComponent::CreateDescriptor(), ScriptCanvas::RuntimeComponent::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index d1d7606b4f..8d5f43c3bc 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -66,7 +66,6 @@ set(FILES Include/ScriptCanvas/Core/MethodConfiguration.cpp Include/ScriptCanvas/Core/ModifiableDatumView.cpp Include/ScriptCanvas/Core/ModifiableDatumView.h - Include/ScriptCanvas/Core/NativeDatumNode.h Include/ScriptCanvas/Core/Node.cpp Include/ScriptCanvas/Core/Node.h Include/ScriptCanvas/Core/Nodeable.cpp @@ -76,8 +75,6 @@ set(FILES Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp Include/ScriptCanvas/Core/NodeableNodeOverloaded.h Include/ScriptCanvas/Core/NodeFunctionGeneric.h - Include/ScriptCanvas/Core/PureData.cpp - Include/ScriptCanvas/Core/PureData.h Include/ScriptCanvas/Core/Slot.cpp Include/ScriptCanvas/Core/Slot.h Include/ScriptCanvas/Core/SlotConfigurationDefaults.h @@ -131,8 +128,6 @@ set(FILES Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.h Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.h - Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.cpp - Include/ScriptCanvas/Core/Contracts/ExclusivePureDataContract.h Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.h Include/ScriptCanvas/Core/Contracts/MathOperatorContract.cpp @@ -250,8 +245,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/AzEventHandler.cpp Include/ScriptCanvas/Libraries/Core/AzEventHandler.h Include/ScriptCanvas/Libraries/Core/AzEventHandler.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.cpp - Include/ScriptCanvas/Libraries/Core/BehaviorContextObjectNode.h Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp Include/ScriptCanvas/Libraries/Core/BinaryOperator.h Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp @@ -314,25 +307,18 @@ set(FILES Include/ScriptCanvas/Libraries/Core/Start.cpp Include/ScriptCanvas/Libraries/Core/Start.h Include/ScriptCanvas/Libraries/Core/Start.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Core/String.h Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp Include/ScriptCanvas/Libraries/Core/UnaryOperator.h Include/ScriptCanvas/Libraries/Entity/Entity.cpp Include/ScriptCanvas/Libraries/Entity/Entity.h - Include/ScriptCanvas/Libraries/Entity/EntityIDNode.h Include/ScriptCanvas/Libraries/Entity/EntityIDNodes.h Include/ScriptCanvas/Libraries/Entity/EntityNodes.h - Include/ScriptCanvas/Libraries/Entity/EntityRef.h - Include/ScriptCanvas/Libraries/Entity/Rotate.cpp - Include/ScriptCanvas/Libraries/Entity/Rotate.h - Include/ScriptCanvas/Libraries/Entity/Rotate.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp Include/ScriptCanvas/Libraries/Entity/RotateMethod.h Include/ScriptCanvas/Libraries/Logic/And.h Include/ScriptCanvas/Libraries/Logic/Any.cpp Include/ScriptCanvas/Libraries/Logic/Any.h Include/ScriptCanvas/Libraries/Logic/Any.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Logic/Boolean.h Include/ScriptCanvas/Libraries/Logic/Break.h Include/ScriptCanvas/Libraries/Logic/Break.cpp Include/ScriptCanvas/Libraries/Logic/Break.ScriptCanvasGrammar.xml @@ -373,11 +359,8 @@ set(FILES Include/ScriptCanvas/Libraries/Logic/While.cpp Include/ScriptCanvas/Libraries/Logic/While.h Include/ScriptCanvas/Libraries/Logic/While.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Math/AABBNode.h Include/ScriptCanvas/Libraries/Math/AABBNodes.h - Include/ScriptCanvas/Libraries/Math/ColorNode.h Include/ScriptCanvas/Libraries/Math/ColorNodes.h - Include/ScriptCanvas/Libraries/Math/CRCNode.h Include/ScriptCanvas/Libraries/Math/CRCNodes.h Include/ScriptCanvas/Libraries/Math/Divide.h Include/ScriptCanvas/Libraries/Math/Math.cpp @@ -389,26 +372,15 @@ set(FILES Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.h Include/ScriptCanvas/Libraries/Math/MathGenerics.h Include/ScriptCanvas/Libraries/Math/MathRandom.h - Include/ScriptCanvas/Libraries/Math/Matrix3x3Node.h Include/ScriptCanvas/Libraries/Math/Matrix3x3Nodes.h - Include/ScriptCanvas/Libraries/Math/Matrix4x4Node.h Include/ScriptCanvas/Libraries/Math/Matrix4x4Nodes.h Include/ScriptCanvas/Libraries/Math/Multiply.h - Include/ScriptCanvas/Libraries/Math/Number.h - Include/ScriptCanvas/Libraries/Math/OBBNode.h Include/ScriptCanvas/Libraries/Math/OBBNodes.h - Include/ScriptCanvas/Libraries/Math/PlaneNode.h Include/ScriptCanvas/Libraries/Math/PlaneNodes.h - Include/ScriptCanvas/Libraries/Math/Random.cpp - Include/ScriptCanvas/Libraries/Math/Random.h - Include/ScriptCanvas/Libraries/Math/Random.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Math/Rotation.h Include/ScriptCanvas/Libraries/Math/RotationNodes.h Include/ScriptCanvas/Libraries/Math/Subtract.h Include/ScriptCanvas/Libraries/Math/Sum.h - Include/ScriptCanvas/Libraries/Math/Transform.h Include/ScriptCanvas/Libraries/Math/TransformNodes.h - Include/ScriptCanvas/Libraries/Math/Vector.h Include/ScriptCanvas/Libraries/Math/Vector2Nodes.h Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index daa2a599ce..ba84163d64 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -84,8 +84,6 @@ set(FILES Editor/GraphCanvas/Components/NodeDescriptors/EBusHandlerNodeDescriptorComponent.h Editor/GraphCanvas/Components/NodeDescriptors/EBusSenderNodeDescriptorComponent.cpp Editor/GraphCanvas/Components/NodeDescriptors/EBusSenderNodeDescriptorComponent.h - Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.cpp - Editor/GraphCanvas/Components/NodeDescriptors/EntityRefNodeDescriptorComponent.h Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.h Editor/GraphCanvas/Components/NodeDescriptors/FunctionDefinitionNodeDescriptorComponent.h diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp index 8f769aefa4..03ecba29be 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp @@ -470,14 +470,6 @@ namespace ScriptCanvasTests AZ::u32 TestBehaviorContextObject::s_createdCount = 0; AZ::u32 TestBehaviorContextObject::s_destroyedCount = 0; - ScriptCanvas::Nodes::Core::BehaviorContextObjectNode* CreateTestObjectNode(const AZ::EntityId& graphUniqueId, AZ::EntityId& entityOut, const AZ::Uuid& objectTypeID) - { - ScriptCanvas::Nodes::Core::BehaviorContextObjectNode* node = CreateTestNode(graphUniqueId, entityOut); - EXPECT_TRUE(node != nullptr); - node->InitializeObject(objectTypeID); - return node; - } - AZ::EntityId CreateClassFunctionNode(const ScriptCanvasId& scriptCanvasId, AZStd::string_view className, AZStd::string_view methodName) { using namespace ScriptCanvas; @@ -495,93 +487,6 @@ namespace ScriptCanvasTests return methodNodeID; } - ScriptCanvas::Node* CreateDataNodeByType(const ScriptCanvasId& scriptCanvasId, const ScriptCanvas::Data::Type& type, AZ::EntityId& nodeIDout) - { - using namespace ScriptCanvas; - - Node* node(nullptr); - - switch (type.GetType()) - { - case Data::eType::AABB: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::BehaviorContextObject: - { - auto objectNode = CreateTestNode(scriptCanvasId, nodeIDout); - objectNode->InitializeObject(type); - node = objectNode; - } - break; - - case Data::eType::Boolean: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Color: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::CRC: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::EntityID: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Matrix3x3: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Matrix4x4: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Number: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::OBB: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Plane: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Quaternion: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::String: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Transform: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Vector2: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Vector3: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - case Data::eType::Vector4: - node = CreateTestNode(scriptCanvasId, nodeIDout); - break; - - default: - AZ_Error("ScriptCanvas", false, "unsupported data type"); - } - - return node; - } - AZStd::string SlotDescriptorToString(ScriptCanvas::SlotDescriptor descriptor) { AZStd::string name; diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h index e1879f6038..dcc4d2eb3f 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h @@ -101,7 +101,6 @@ namespace ScriptCanvasTests return addVariableOutcome.TakeValue(); } - ScriptCanvas::Nodes::Core::BehaviorContextObjectNode* CreateTestObjectNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, AZ::EntityId& entityOut, const AZ::Uuid& objectTypeID); AZ::EntityId CreateClassFunctionNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, AZStd::string_view className, AZStd::string_view methodName); AZStd::string SlotDescriptorToString(ScriptCanvas::SlotDescriptor type); void DumpSlots(const ScriptCanvas::Node& node); diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp index be0f57665a..c602bde1f2 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -20,48 +19,6 @@ using namespace ScriptCanvasTests; using namespace ScriptCanvasEditor; using namespace TestNodes; -TEST_F(ScriptCanvasTestFixture, BehaviorContextObjectGenericConstructor) -{ - using namespace ScriptCanvas; - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - - AZ::Entity* graphEntity = aznew AZ::Entity("Graph"); - graphEntity->Init(); - SystemRequestBus::Broadcast(&SystemRequests::CreateGraphOnEntity, graphEntity); - auto graph = graphEntity->FindComponent(); - EXPECT_NE(nullptr, graph); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - //Validates the GenericConstructorOverride attribute is being used to construct types that are normally not initialized in C++ - AZ::EntityId vector3IdA; - ScriptCanvas::Nodes::Core::BehaviorContextObjectNode* vector3NodeA = CreateTestNode(graphUniqueId, vector3IdA); - vector3NodeA->InitializeObject(azrtti_typeid()); - - ReportErrors(graph); - - if (auto result = vector3NodeA->GetInput_UNIT_TEST("Set")) - { - EXPECT_EQ(0, result->GetValue()); - } - else - { - ADD_FAILURE(); - } - - delete graphEntity; - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - // Tests the basic footprint of the ebus node both before and after graph activation to make sure all internal bookeeping is correct. TEST_F(ScriptCanvasTestFixture, BehaviorContext_BusHandlerNodeFootPrint) { diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp index b365a939e8..d5f4c221c8 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp @@ -407,38 +407,6 @@ TEST_F(ScriptCanvasTestFixture, ValueTypes) GTEST_SUCCEED(); } - -namespace -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - bool GraphHasVectorWithValue(const ScriptCanvas::Graph& graph, const AZ::Vector3& vector) - { - for (auto nodeId : graph.GetNodes()) - { - AZ::Entity* entity{}; - AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, nodeId); - - if (entity) - { - if (auto node = AZ::EntityUtils::FindFirstDerivedComponent(entity)) - { - if (auto candidate = node->GetInput_UNIT_TEST("Set")) - { - if (*candidate == vector) - { - return true; - } - } - } - } - } - - return false; - } -} - TEST_F(ScriptCanvasTestFixture, Contracts) { using namespace ScriptCanvas; @@ -666,126 +634,6 @@ TEST_F(ScriptCanvasTestFixture, Contracts) // m_behaviorContext->DisableRemoveReflection(); // } -TEST_F(ScriptCanvasTestFixture, EntityRefTest) -{ - - - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - // Fake "world" entities - AZ::Entity first("First"); - first.CreateComponent(); - first.Init(); - first.Activate(); - - AZ::Entity second("Second"); - second.CreateComponent(); - second.Init(); - second.Activate(); - - // Script Canvas ScriptCanvas::Graph - ScriptCanvas::Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - - m_entityContext.AddEntity(first.GetId()); - m_entityContext.AddEntity(second.GetId()); - m_entityContext.AddEntity(graph->GetEntityId()); - - graph->GetEntity()->SetName("ScriptCanvas::Graph Owner Entity"); - - graph->GetEntity()->CreateComponent(); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - // EntityRef node to some specific entity #1 - AZ::EntityId selfEntityIdNode; - auto selfEntityRef = CreateTestNode(graphUniqueId, selfEntityIdNode); - selfEntityRef->SetEntityRef(first.GetId()); - - // EntityRef node to some specific entity #2 - AZ::EntityId otherEntityIdNode; - auto otherEntityRef = CreateTestNode(graphUniqueId, otherEntityIdNode); - otherEntityRef->SetEntityRef(second.GetId()); - - // Explicitly set an EntityRef node with this graph's entity Id. - AZ::EntityId graphEntityIdNode; - auto graphEntityRef = CreateTestNode(graphUniqueId, graphEntityIdNode); - graphEntityRef->SetEntityRef(graph->GetEntity()->GetId()); - - // First test: directly set an entity Id on the EntityID: 0 slot - AZ::EntityId eventAid; - ScriptCanvas::Nodes::Core::Method* nodeA = CreateTestNode(graphUniqueId, eventAid); - nodeA->InitializeEvent({ {} }, "EntityRefTestEventBus", "TestEvent"); - if (auto entityId = nodeA->ModInput_UNIT_TEST("EntityID: 0")) - { - *entityId = first.GetId(); - } - - // Second test: Will connect the slot to an EntityRef node - AZ::EntityId eventBid; - ScriptCanvas::Nodes::Core::Method* nodeB = CreateTestNode(graphUniqueId, eventBid); - nodeB->InitializeEvent({ {} }, "EntityRefTestEventBus", "TestEvent"); - - // Third test: Set the slot's EntityId: 0 to SelfReferenceId, this should result in the same Id as graph->GetEntityId() - AZ::EntityId eventCid; - ScriptCanvas::Nodes::Core::Method* nodeC = CreateTestNode(graphUniqueId, eventCid); - nodeC->InitializeEvent({ {} }, "EntityRefTestEventBus", "TestEvent"); - if (auto entityId = nodeC->ModInput_UNIT_TEST("EntityID: 0")) - { - *entityId = ScriptCanvas::GraphOwnerId; - } - - // True - AZ::EntityId trueNodeId; - CreateDataNode(graphUniqueId, true, trueNodeId); - - // False - AZ::EntityId falseNodeId; - CreateDataNode(graphUniqueId, false, falseNodeId); - - // Start -> TestEvent - // O EntityId: 0 (not connected, it was set directly on the slot) - // EntityRef: first -O EntityId: 1 - // False -O Boolean: 2 - EXPECT_TRUE(Connect(*graph, startID, "Out", eventAid, "In")); - EXPECT_TRUE(Connect(*graph, eventAid, "EntityID: 1", selfEntityIdNode, "Get")); - EXPECT_TRUE(Connect(*graph, eventAid, "Boolean: 2", falseNodeId, "Get")); - - // Start -> TestEvent - // EntityRef: second -O EntityId: 0 - // EntityRef: second -O EntityId: 1 - // False -O Boolean: 2 - EXPECT_TRUE(Connect(*graph, startID, "Out", eventBid, "In")); - EXPECT_TRUE(Connect(*graph, eventBid, "EntityID: 0", otherEntityIdNode, "Get")); - EXPECT_TRUE(Connect(*graph, eventBid, "EntityID: 1", otherEntityIdNode, "Get")); - EXPECT_TRUE(Connect(*graph, eventBid, "Boolean: 2", falseNodeId, "Get")); - - // Start -> TestEvent - // -O EntityId: 0 (not connected, slot is set to SelfReferenceId) - // graphEntityIdNode -O EntityId: 1 - // True -O Boolean: 2 - EXPECT_TRUE(Connect(*graph, startID, "Out", eventCid, "In")); - EXPECT_TRUE(Connect(*graph, eventCid, "EntityID: 1", graphEntityIdNode, "Get")); - EXPECT_TRUE(Connect(*graph, eventCid, "Boolean: 2", trueNodeId, "Get")); - - // Execute the graph - - { - ScriptCanvasEditor::ScopedOutputSuppression suppressOutput; - graph->GetEntity()->Activate(); - } - - ReportErrors(graph); - delete graph->GetEntity(); - -} - const int k_executionCount = 998; TEST_F(ScriptCanvasTestFixture, ExecutionLength) @@ -828,10 +676,11 @@ TEST_F(ScriptCanvasTestFixture, ExecutionLength) TEST_F(ScriptCanvasTestFixture, While) { - RunUnitTestGraph("LY_SC_UnitTest_While", ExecutionMode::Interpreted); + + RunUnitTestGraph("LY_SC_UnitTest_While", ScriptCanvas::ExecutionMode::Interpreted); } TEST_F(ScriptCanvasTestFixture, WhileBreak) { - RunUnitTestGraph("LY_SC_UnitTest_WhileBreak", ExecutionMode::Interpreted); + RunUnitTestGraph("LY_SC_UnitTest_WhileBreak", ScriptCanvas::ExecutionMode::Interpreted); } diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Math.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Math.cpp index 65236a7c92..71f0a42b03 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Math.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Math.cpp @@ -17,76 +17,6 @@ using namespace ScriptCanvasTests; using namespace ScriptCanvas; -template -AZStd::vector TestMathFunction(std::initializer_list inputNamesList, std::initializer_list inputList, std::initializer_list outputNamesList, std::initializer_list outputList) -{ - AZStd::vector inputNames(inputNamesList); - AZStd::vector input(inputList); - AZStd::vector outputNames(outputNamesList); - AZStd::vector output(outputList); - - AZ_Assert(inputNames.size() == input.size(), "Size mismatch"); - AZ_Assert(outputNames.size() == output.size(), "Size mismatch"); - - AZ::Entity graphEntity("Graph"); - graphEntity.Init(); - SystemRequestBus::Broadcast(&SystemRequests::CreateGraphOnEntity, &graphEntity); - auto graph = graphEntity.FindComponent(); - EXPECT_NE(nullptr, graph); - - const AZ::EntityId& graphEntityId = graph->GetEntityId(); - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - AZ::EntityId functionID; - CreateTestNode(graphUniqueId, functionID); - EXPECT_TRUE(Connect(*graph, startID, "Out", functionID, "In")); - - AZStd::vector inputNodes; - AZStd::vector inputNodeIDs; - AZStd::vector outputNodes; - AZStd::vector outputNodeIDs; - - for (int i = 0; i < input.size(); ++i) - { - AZ::EntityId inputNodeID; - auto node = CreateDataNodeByType(graphUniqueId, input[i].GetType(), inputNodeID); - inputNodeIDs.push_back(inputNodeID); - inputNodes.push_back(node); - node->SetInput_UNIT_TEST(PureData::k_setThis, input[i]); - } - - for (int i = 0; i < output.size(); ++i) - { - AZ::EntityId outputNodeID; - auto node = CreateDataNodeByType(graphUniqueId, output[i].GetType(), outputNodeID); - outputNodeIDs.push_back(outputNodeID); - outputNodes.push_back(node); - } - - for (int i = 0; i < inputNames.size(); ++i) - { - EXPECT_TRUE(Connect(*graph, inputNodeIDs[i], "Get", functionID, inputNames[i].data())); - } - - for (int i = 0; i < output.size(); ++i) - { - EXPECT_TRUE(Connect(*graph, functionID, outputNames[i].data(), outputNodeIDs[i], PureData::k_setThis)); - } - - graph->GetEntity()->Activate(); - - for (int i = 0; i < output.size(); ++i) - { - output[i] = *outputNodes[i]->GetInput_UNIT_TEST(PureData::k_setThis); - } - - graph->GetEntity()->Deactivate(); - delete graph; - return output; -} - TEST_F(ScriptCanvasTestFixture, MathOperations_Graph) { RunUnitTestGraph("LY_SC_UnitTest_MathOperations", ExecutionMode::Interpreted); diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_NodeGenerics.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_NodeGenerics.cpp index a1e48a4637..e74aa8e641 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_NodeGenerics.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_NodeGenerics.cpp @@ -163,906 +163,5 @@ TEST_F(ScriptCanvasTestFixture, NodeGenerics) delete graph->GetEntity(); } -TEST_F(ScriptCanvasTestFixture, NodeGenericsByValue) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByPointer) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - // execution - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByValueID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByReference) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByValueInteger) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const AZ::EntityId graphEntityId = graph->GetEntityId(); - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Node* valueNode1 = CreateDataNode(graphUniqueId, 1, valueID1); - EXPECT_EQ(1, *valueNode1->GetInput_UNIT_TEST("Set")); - - Node* valueNode2 = CreateDataNode(graphUniqueId, 2, valueID2); - EXPECT_EQ(2, *valueNode2->GetInput_UNIT_TEST("Set")); - - Node* valueNode3 = CreateDataNode(graphUniqueId, 3, valueID3); - EXPECT_EQ(3, *valueNode3->GetInput_UNIT_TEST("Set")); - - Node* valueNode4 = CreateDataNode(graphUniqueId, 4, valueID4); - EXPECT_EQ(4, *valueNode4->GetInput_UNIT_TEST("Set")); - - Node* valueNode5 = CreateDataNode(graphUniqueId, 5, valueID5); - EXPECT_EQ(5, *valueNode5->GetInput_UNIT_TEST("Set")); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID5, "Set")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByPointerInteger) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Node* valueNode1 = CreateDataNode(graphUniqueId, 1, valueID1); - EXPECT_EQ(1, *valueNode1->GetInput_UNIT_TEST("Set")); - - Node* valueNode2 = CreateDataNode(graphUniqueId, 2, valueID2); - EXPECT_EQ(2, *valueNode2->GetInput_UNIT_TEST("Set")); - - Node* valueNode3 = CreateDataNode(graphUniqueId, 3, valueID3); - EXPECT_EQ(3, *valueNode3->GetInput_UNIT_TEST("Set")); - - Node* valueNode4 = CreateDataNode(graphUniqueId, 4, valueID4); - EXPECT_EQ(4, *valueNode4->GetInput_UNIT_TEST("Set")); - - Node* valueNode5 = CreateDataNode(graphUniqueId, 5, valueID5); - EXPECT_EQ(5, *valueNode5->GetInput_UNIT_TEST("Set")); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID5, "Set")); - - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByValueID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByReferenceInteger) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Node* valueNode1 = CreateDataNode(graphUniqueId, 1, valueID1); - EXPECT_EQ(1, *valueNode1->GetInput_UNIT_TEST("Set")); - - Node* valueNode2 = CreateDataNode(graphUniqueId, 2, valueID2); - EXPECT_EQ(2, *valueNode2->GetInput_UNIT_TEST("Set")); - - Node* valueNode3 = CreateDataNode(graphUniqueId, 3, valueID3); - EXPECT_EQ(3, *valueNode3->GetInput_UNIT_TEST("Set")); - - Node* valueNode4 = CreateDataNode(graphUniqueId, 4, valueID4); - EXPECT_EQ(4, *valueNode4->GetInput_UNIT_TEST("Set")); - - Node* valueNode5 = CreateDataNode(graphUniqueId, 5, valueID5); - EXPECT_EQ(5, *valueNode5->GetInput_UNIT_TEST("Set")); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueID5, "Set")); - - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByValueID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByValueMulti) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByValueID; - CreateTestNode(graphUniqueId, maxByValueID); - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - AZ::EntityId valueIntegerID1, valueIntegerID2, valueIntegerID3, valueIntegerID4, valueIntegerID5; - - Node* valueIntegerNode1 = CreateDataNode(graphUniqueId, 1, valueIntegerID1); - EXPECT_EQ(1, *valueIntegerNode1->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode2 = CreateDataNode(graphUniqueId, 2, valueIntegerID2); - EXPECT_EQ(2, *valueIntegerNode2->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode3 = CreateDataNode(graphUniqueId, 3, valueIntegerID3); - EXPECT_EQ(3, *valueIntegerNode3->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode4 = CreateDataNode(graphUniqueId, 4, valueIntegerID4); - EXPECT_EQ(4, *valueIntegerNode4->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode5 = CreateDataNode(graphUniqueId, 5, valueIntegerID5); - EXPECT_EQ(5, *valueIntegerNode5->GetInput_UNIT_TEST("Set")); - - auto valueInteger1 = valueIntegerNode1->GetInput_UNIT_TEST("Set"); - auto valueInteger2 = valueIntegerNode2->GetInput_UNIT_TEST("Set"); - auto valueInteger3 = valueIntegerNode3->GetInput_UNIT_TEST("Set"); - auto valueInteger4 = valueIntegerNode4->GetInput_UNIT_TEST("Set"); - auto valueInteger5 = valueIntegerNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(valueInteger1, valueInteger2); - EXPECT_NE(valueInteger1, valueInteger3); - EXPECT_NE(valueInteger1, valueInteger4); - EXPECT_NE(valueInteger1, valueInteger5); - EXPECT_NE(valueInteger2, valueInteger3); - EXPECT_NE(valueInteger2, valueInteger4); - EXPECT_NE(valueInteger2, valueInteger5); - EXPECT_NE(valueInteger3, valueInteger4); - EXPECT_NE(valueInteger3, valueInteger5); - EXPECT_NE(valueInteger4, valueInteger5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByValueID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByValueID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - EXPECT_TRUE(Connect(*graph, valueIntegerID1, "Get", maxByValueID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueIntegerID2, "Get", maxByValueID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueIntegerID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueIntegerID3, "Get", valueIntegerID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByValueID, "Result: Number", valueIntegerID5, "Set")); - - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByValueID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByReferenceMulti) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByReferenceID; - CreateTestNode(graphUniqueId, maxByReferenceID); - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - AZ::EntityId valueIntegerID1, valueIntegerID2, valueIntegerID3, valueIntegerID4, valueIntegerID5; - - Node* valueIntegerNode1 = CreateDataNode(graphUniqueId, 1, valueIntegerID1); - EXPECT_EQ(1, *valueIntegerNode1->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode2 = CreateDataNode(graphUniqueId, 2, valueIntegerID2); - EXPECT_EQ(2, *valueIntegerNode2->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode3 = CreateDataNode(graphUniqueId, 3, valueIntegerID3); - EXPECT_EQ(3, *valueIntegerNode3->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode4 = CreateDataNode(graphUniqueId, 4, valueIntegerID4); - EXPECT_EQ(4, *valueIntegerNode4->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode5 = CreateDataNode(graphUniqueId, 5, valueIntegerID5); - EXPECT_EQ(5, *valueIntegerNode5->GetInput_UNIT_TEST("Set")); - - auto valueInteger1 = valueIntegerNode1->GetInput_UNIT_TEST("Set"); - auto valueInteger2 = valueIntegerNode2->GetInput_UNIT_TEST("Set"); - auto valueInteger3 = valueIntegerNode3->GetInput_UNIT_TEST("Set"); - auto valueInteger4 = valueIntegerNode4->GetInput_UNIT_TEST("Set"); - auto valueInteger5 = valueIntegerNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(valueInteger1, valueInteger2); - EXPECT_NE(valueInteger1, valueInteger3); - EXPECT_NE(valueInteger1, valueInteger4); - EXPECT_NE(valueInteger1, valueInteger5); - EXPECT_NE(valueInteger2, valueInteger3); - EXPECT_NE(valueInteger2, valueInteger4); - EXPECT_NE(valueInteger2, valueInteger5); - EXPECT_NE(valueInteger3, valueInteger4); - EXPECT_NE(valueInteger3, valueInteger5); - EXPECT_NE(valueInteger4, valueInteger5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByReferenceID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByReferenceID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByReferenceID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByReferenceID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - EXPECT_TRUE(Connect(*graph, valueIntegerID1, "Get", maxByReferenceID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueIntegerID2, "Get", maxByReferenceID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByReferenceID, "Result: Number", valueIntegerID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueIntegerID3, "Get", valueIntegerID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByReferenceID, "Result: Number", valueIntegerID5, "Set")); - - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByReferenceID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - -TEST_F(ScriptCanvasTestFixture, NodeGenericsByPointerMulti) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Nodes; - - RegisterComponentDescriptor(); - - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - - TestBehaviorContextObject::ResetCounts(); - - UnitTestEventsHandler unitTestHandler; - unitTestHandler.BusConnect(); - - Graph* graph = nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId maxByPointerID; - CreateTestNode(graphUniqueId, maxByPointerID); - AZ::EntityId valueID1, valueID2, valueID3, valueID4, valueID5; - - Core::BehaviorContextObjectNode* valueNode1 = CreateTestNode(graphUniqueId, valueID1); - valueNode1->InitializeObject(azrtti_typeid()); - valueNode1->ModInput_UNIT_TEST("Set")->SetValue(1); - EXPECT_EQ(1, valueNode1->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode2 = CreateTestNode(graphUniqueId, valueID2); - valueNode2->InitializeObject(azrtti_typeid()); - valueNode2->ModInput_UNIT_TEST("Set")->SetValue(2); - EXPECT_EQ(2, valueNode2->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode3 = CreateTestNode(graphUniqueId, valueID3); - valueNode3->InitializeObject(azrtti_typeid()); - valueNode3->ModInput_UNIT_TEST("Set")->SetValue(3); - EXPECT_EQ(3, valueNode3->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode4 = CreateTestNode(graphUniqueId, valueID4); - valueNode4->InitializeObject(azrtti_typeid()); - valueNode4->ModInput_UNIT_TEST("Set")->SetValue(4); - EXPECT_EQ(4, valueNode4->GetInput_UNIT_TEST("Set")->GetValue()); - - Core::BehaviorContextObjectNode* valueNode5 = CreateTestNode(graphUniqueId, valueID5); - valueNode5->InitializeObject(azrtti_typeid()); - valueNode5->ModInput_UNIT_TEST("Set")->SetValue(5); - EXPECT_EQ(5, valueNode5->GetInput_UNIT_TEST("Set")->GetValue()); - - auto value1 = valueNode1->GetInput_UNIT_TEST("Set"); - auto value2 = valueNode2->GetInput_UNIT_TEST("Set"); - auto value3 = valueNode3->GetInput_UNIT_TEST("Set"); - auto value4 = valueNode4->GetInput_UNIT_TEST("Set"); - auto value5 = valueNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(value1, value2); - EXPECT_NE(value1, value3); - EXPECT_NE(value1, value4); - EXPECT_NE(value1, value5); - EXPECT_NE(value2, value3); - EXPECT_NE(value2, value4); - EXPECT_NE(value2, value5); - EXPECT_NE(value3, value4); - EXPECT_NE(value3, value5); - EXPECT_NE(value4, value5); - - AZ::EntityId valueIntegerID1, valueIntegerID2, valueIntegerID3, valueIntegerID4, valueIntegerID5; - - Node* valueIntegerNode1 = CreateDataNode(graphUniqueId, 1, valueIntegerID1); - EXPECT_EQ(1, *valueIntegerNode1->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode2 = CreateDataNode(graphUniqueId, 2, valueIntegerID2); - EXPECT_EQ(2, *valueIntegerNode2->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode3 = CreateDataNode(graphUniqueId, 3, valueIntegerID3); - EXPECT_EQ(3, *valueIntegerNode3->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode4 = CreateDataNode(graphUniqueId, 4, valueIntegerID4); - EXPECT_EQ(4, *valueIntegerNode4->GetInput_UNIT_TEST("Set")); - - Node* valueIntegerNode5 = CreateDataNode(graphUniqueId, 5, valueIntegerID5); - EXPECT_EQ(5, *valueIntegerNode5->GetInput_UNIT_TEST("Set")); - - auto valueInteger1 = valueIntegerNode1->GetInput_UNIT_TEST("Set"); - auto valueInteger2 = valueIntegerNode2->GetInput_UNIT_TEST("Set"); - auto valueInteger3 = valueIntegerNode3->GetInput_UNIT_TEST("Set"); - auto valueInteger4 = valueIntegerNode4->GetInput_UNIT_TEST("Set"); - auto valueInteger5 = valueIntegerNode5->GetInput_UNIT_TEST("Set"); - - EXPECT_NE(valueInteger1, valueInteger2); - EXPECT_NE(valueInteger1, valueInteger3); - EXPECT_NE(valueInteger1, valueInteger4); - EXPECT_NE(valueInteger1, valueInteger5); - EXPECT_NE(valueInteger2, valueInteger3); - EXPECT_NE(valueInteger2, valueInteger4); - EXPECT_NE(valueInteger2, valueInteger5); - EXPECT_NE(valueInteger3, valueInteger4); - EXPECT_NE(valueInteger3, valueInteger5); - EXPECT_NE(valueInteger4, valueInteger5); - - // data - EXPECT_TRUE(Connect(*graph, valueID1, "Get", maxByPointerID, "TestBehaviorContextObject: 0")); - EXPECT_TRUE(Connect(*graph, valueID2, "Get", maxByPointerID, "TestBehaviorContextObject: 1")); - EXPECT_TRUE(Connect(*graph, maxByPointerID, "Result: TestBehaviorContextObject", valueID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueID3, "Get", valueID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByPointerID, "Result: TestBehaviorContextObject", valueID5, "Set")); - - EXPECT_TRUE(Connect(*graph, valueIntegerID1, "Get", maxByPointerID, "Number: 0")); - EXPECT_TRUE(Connect(*graph, valueIntegerID2, "Get", maxByPointerID, "Number: 1")); - EXPECT_TRUE(Connect(*graph, maxByPointerID, "Result: Number", valueIntegerID3, "Set")); - EXPECT_TRUE(Connect(*graph, valueIntegerID3, "Get", valueIntegerID4, "Set")); - EXPECT_TRUE(Connect(*graph, maxByPointerID, "Result: Number", valueIntegerID5, "Set")); - - EXPECT_TRUE(Connect(*graph, startID, "Out", maxByPointerID, "In")); - - delete graph->GetEntity(); - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TestBehaviorContextObject::Reflect(m_serializeContext); - TestBehaviorContextObject::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} #pragma warning( pop ) From b93dd36c613cd858d8146b619b170e2cf2fcc383 Mon Sep 17 00:00:00 2001 From: Victor Huang Date: Thu, 1 Jul 2021 10:26:44 -0700 Subject: [PATCH 020/156] Changed AP window title and popup messages Signed-off-by: Victor Huang --- .../native/AssetManager/assetProcessorManager.cpp | 2 +- Code/Tools/AssetProcessor/native/ui/MainWindow.ui | 2 +- .../AssetProcessor/native/utilities/ApplicationManagerBase.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp index 91abc032f2..96a30596c1 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp @@ -2548,7 +2548,7 @@ namespace AssetProcessor jobdetail.m_jobParam[AZ_CRC(AutoFailReasonKey)] = AZStd::string::format( "Source file ( %s ) contains non ASCII characters.\n" - "Open 3D Engine currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" + "O3DE currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" "Please rename the source file to fix this error.\n", normalizedPath.toUtf8().data()); diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui index 869edce3f0..d4f341d2b5 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui @@ -17,7 +17,7 @@ - Asset Processor + O3DE Asset Processor diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 7ac957c6b7..cbdb1e4184 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -478,7 +478,7 @@ void ApplicationManagerBase::InitConnectionManager() result = QObject::connect(GetRCController(), &AssetProcessor::RCController::JobStarted, this, [](QString inputFile, QString platform) { - QString msg = QCoreApplication::translate("Asset Processor", "Processing %1 (%2)...\n", "%1 is the name of the file, and %2 is the platform to process it for").arg(inputFile, platform); + QString msg = QCoreApplication::translate("O3DE Asset Processor", "Processing %1 (%2)...\n", "%1 is the name of the file, and %2 is the platform to process it for").arg(inputFile, platform); AZ_Printf(AssetProcessor::ConsoleChannel, "%s", msg.toUtf8().constData()); AssetNotificationMessage message(inputFile.toUtf8().constData(), AssetNotificationMessage::JobStarted, AZ::Data::s_invalidAssetType, platform.toUtf8().constData()); EBUS_EVENT(AssetProcessor::ConnectionBus, SendPerPlatform, 0, message, platform); From 6b27c1d7977fa07d117c90260ed54a54f1fd19dd Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 1 Jul 2021 11:18:03 -0700 Subject: [PATCH 021/156] fix python test against editor Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py b/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py index b6ef00486b..129570f80d 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/FileMenu_Default_NewAndOpen.py @@ -58,8 +58,11 @@ class TestFileMenuDefaultNewOpen: sc_main = sc.findChild(QtWidgets.QMainWindow) sc_tabs = sc_main.findChild(QtWidgets.QTabWidget, "ScriptCanvasTabs") - # 3) Trigger File->New action + # wait for the intial tab count + general.idle_wait(GENERAL_WAIT) initial_tabs_count = sc_tabs.count() + + # 3) Trigger File->New action action = pyside_utils.find_child_by_pattern( sc_main, {"objectName": "action_New_Script", "type": QtWidgets.QAction} ) From fea83b0b51990975b175196229d2d1fbe448fe62 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 1 Jul 2021 17:08:16 -0700 Subject: [PATCH 022/156] The Great ScriptCanvas Purge, Part II Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Framework/ScriptCanvasTraceUtilities.h | 8 +- .../GraphCanvas/NodeDescriptorBus.h | 2 +- .../Code/Editor/Nodes/NodeCreateUtils.cpp | 30 ------- .../Code/Editor/Nodes/NodeCreateUtils.h | 1 - .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 6 -- .../Code/Editor/Nodes/NodeDisplayUtils.h | 4 - .../Code/Editor/ReflectComponent.cpp | 1 - .../SpecializedNodePaletteTreeItemTypes.cpp | 41 --------- .../SpecializedNodePaletteTreeItemTypes.h | 33 -------- .../VariableNodePaletteTreeItemTypes.cpp | 1 - .../View/Windows/ScriptCanvasContextMenus.cpp | 61 -------------- .../View/Windows/ScriptCanvasContextMenus.h | 18 ---- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 2 - .../ScriptCanvas/Core/ModifiableDatumView.h | 3 +- .../ScriptCanvas/Core/NodeFunctionGeneric.h | 10 --- .../ScriptCanvas/Libraries/Core/CoreNodes.cpp | 4 - .../ScriptCanvas/Libraries/Core/CoreNodes.h | 2 - .../ScriptCanvas/Libraries/Core/Error.cpp | 84 ------------------- .../ScriptCanvas/Libraries/Core/Error.h | 34 -------- .../Libraries/Core/ErrorHandler.cpp | 73 ---------------- .../Libraries/Core/ErrorHandler.h | 37 -------- .../ScriptCanvas/Libraries/Entity/Entity.cpp | 2 +- .../ScriptCanvas/Libraries/Libraries.h | 15 ++++ .../ScriptCanvas/Libraries/Math/Math.cpp | 46 ++++++---- .../Code/scriptcanvasgem_common_files.cmake | 4 - 25 files changed, 54 insertions(+), 468 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.h diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 62050980b6..de1a6de247 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -171,15 +171,15 @@ namespace ScriptCanvasEditor struct ScopedOutputSuppression { - ScopedOutputSuppression(bool suppressState = true) + ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { - AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); +// AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); +// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h index 6822576482..a0b0cea549 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h @@ -37,7 +37,7 @@ namespace ScriptCanvasEditor EBusHandler, EBusHandlerEvent, EBusSender, - EntityRef, + _deprecated_, VariableNode, SetVariable, GetVariable, diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp index 1ad27566d9..0b2d0de958 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp @@ -131,36 +131,6 @@ namespace ScriptCanvasEditor::Nodes return AZStd::make_pair(node, nodeIdPair); } - NodeIdPair CreateEntityNode(const AZ::EntityId& sourceId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId) - { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); - NodeIdPair nodeIdPair; - - ScriptCanvas::Node* node = nullptr; - AZ::Entity* scriptCanvasEntity{ aznew AZ::Entity }; - scriptCanvasEntity->Init(); - nodeIdPair.m_scriptCanvasId = scriptCanvasEntity->GetId(); - ScriptCanvas::SystemRequestBus::BroadcastResult(node, &ScriptCanvas::SystemRequests::CreateNodeOnEntity, scriptCanvasEntity->GetId(), scriptCanvasId, ScriptCanvas::Nodes::Entity::EntityRef::RTTI_Type()); - - auto* entityNode = azrtti_cast(node); - entityNode->SetEntityRef(sourceId); - - // Set the name - AZ::Entity* sourceEntity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(sourceEntity, &AZ::ComponentApplicationRequests::FindEntity, sourceId); - if (sourceEntity) - { - scriptCanvasEntity->SetName(AZStd::string::format("SC-EntityRef(%s)", sourceEntity->GetName().data())); - } - - AZ::EntityId graphCanvasGraphId; - EditorGraphRequestBus::EventResult(graphCanvasGraphId, scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); - - nodeIdPair.m_graphCanvasId = DisplayEntityNode(graphCanvasGraphId, entityNode); - - return nodeIdPair; - } - NodeIdPair CreateObjectMethodNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, ScriptCanvas::PropertyStatus propertyStatus) { AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.h b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.h index c24b48a289..a3a9a4cc1e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.h @@ -28,7 +28,6 @@ namespace ScriptCanvasEditor::Nodes // Specific create methods which will also handle displaying the node. AZStd::pair CreateAndGetNode(const AZ::Uuid& classData, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const StyleConfiguration& styleConfiguration, AZStd::function = nullptr); NodeIdPair CreateNode(const AZ::Uuid& classData, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const StyleConfiguration& styleConfiguration); - NodeIdPair CreateEntityNode(const AZ::EntityId& sourceId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId); NodeIdPair CreateObjectMethodNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, ScriptCanvas::PropertyStatus propertyStatus); NodeIdPair CreateObjectMethodOverloadNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasGraphId); NodeIdPair CreateGlobalMethodNode(AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId); diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 0c210441fe..691cfe3698 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -43,8 +43,6 @@ #include #include #include -#include - namespace ScriptCanvasEditor::Nodes::SlotDisplayHelper { @@ -1093,10 +1091,6 @@ namespace ScriptCanvasEditor::Nodes { graphCanvasNodeId = DisplayAzEventHandlerNode(graphCanvasGraphId, azEventHandlerNode); } - else if (azrtti_istypeof(node)) - { - graphCanvasNodeId = DisplayEntityNode(graphCanvasGraphId, static_cast(node)); - } else if (azrtti_istypeof(node)) { graphCanvasNodeId = DisplayScriptEventWrapperNode(graphCanvasGraphId, static_cast(node)); diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h index 59c69ea662..3befb20846 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.h @@ -30,10 +30,6 @@ namespace ScriptCanvas::Nodes::Core class SetVariableNode; class SendScriptEvent; } -namespace ScriptCanvas::Nodes::Entity -{ - class EntityRef; -} namespace ScriptEvents { class Method; diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index a90e3a9fd5..2d45f0c644 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -59,7 +59,6 @@ namespace ScriptCanvasEditor CreateEBusHandlerMimeEvent::Reflect(context); CreateEBusHandlerEventMimeEvent::Reflect(context); CreateEBusSenderMimeEvent::Reflect(context); - CreateEntityRefNodeMimeEvent::Reflect(context); CreateGetVariableNodeMimeEvent::Reflect(context); CreateSetVariableNodeMimeEvent::Reflect(context); CreateVariableChangedNodeMimeEvent::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp index a214bb7ab8..0f97741060 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.cpp @@ -27,47 +27,6 @@ namespace ScriptCanvasEditor { - ///////////////////////////////// - // CreateEntityRefNodeMimeEvent - ///////////////////////////////// - - void CreateEntityRefNodeMimeEvent::Reflect(AZ::ReflectContext* reflectContext) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext); - - if (serializeContext) - { - serializeContext->Class() - ->Version(0) - ->Field("EntityId", &CreateEntityRefNodeMimeEvent::m_entityId) - ; - } - } - - CreateEntityRefNodeMimeEvent::CreateEntityRefNodeMimeEvent(const AZ::EntityId& entityId) - : m_entityId(entityId) - { - } - - ScriptCanvasEditor::NodeIdPair CreateEntityRefNodeMimeEvent::CreateNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const - { - return Nodes::CreateEntityNode(m_entityId, scriptCanvasId); - } - - ///////////////////////////////// - // EntityRefNodePaletteTreeItem - ///////////////////////////////// - - EntityRefNodePaletteTreeItem::EntityRefNodePaletteTreeItem(AZStd::string_view nodeName, [[maybe_unused]] const QString& iconPath) - : DraggableNodePaletteTreeItem(nodeName, ScriptCanvasEditor::AssetEditorId) - { - } - - GraphCanvas::GraphCanvasMimeEvent* EntityRefNodePaletteTreeItem::CreateMimeEvent() const - { - return aznew CreateEntityRefNodeMimeEvent(); - } - /////////////////////////////// // CreateCommentNodeMimeEvent /////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.h index 5f623e4c56..bf02a3455d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/SpecializedNodePaletteTreeItemTypes.h @@ -11,39 +11,6 @@ namespace ScriptCanvasEditor { - // - class CreateEntityRefNodeMimeEvent - : public CreateNodeMimeEvent - { - public: - AZ_RTTI(CreateEntityRefNodeMimeEvent, "{20CD5AF5-216E-4A41-9630-191C2803899B}", CreateNodeMimeEvent); - AZ_CLASS_ALLOCATOR(CreateEntityRefNodeMimeEvent, AZ::SystemAllocator, 0); - - static void Reflect(AZ::ReflectContext* reflectContext); - - CreateEntityRefNodeMimeEvent() = default; - CreateEntityRefNodeMimeEvent(const AZ::EntityId& entityId); - ~CreateEntityRefNodeMimeEvent() = default; - - protected: - ScriptCanvasEditor::NodeIdPair CreateNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override; - - private: - AZ::EntityId m_entityId; - }; - - class EntityRefNodePaletteTreeItem - : public GraphCanvas::DraggableNodePaletteTreeItem - { - public: - AZ_CLASS_ALLOCATOR(EntityRefNodePaletteTreeItem, AZ::SystemAllocator, 0); - EntityRefNodePaletteTreeItem(AZStd::string_view nodeName, const QString& iconPath); - ~EntityRefNodePaletteTreeItem() = default; - - GraphCanvas::GraphCanvasMimeEvent* CreateMimeEvent() const override; - }; - // - // class CreateCommentNodeMimeEvent : public SpecializedCreateNodeMimeEvent diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp index c7649174bb..054158bcde 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.cpp @@ -30,7 +30,6 @@ #include "Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h" #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp index 95386c7e55..716c498b56 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp @@ -55,59 +55,6 @@ 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); - - ScriptCanvas::ScriptCanvasId scriptCanvasId; - GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::GetScriptCanvasId, graphCanvasGraphId); - - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::ClearSelection); - - AZ::Vector2 addPosition = scenePos; - - for (const AZ::EntityId& id : selectedEntities) - { - NodeIdPair nodePair = Nodes::CreateEntityNode(id, scriptCanvasId); - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::AddNode, nodePair.m_graphCanvasId, addPosition, false); - addPosition += AZ::Vector2(20, 20); - } - - return GraphCanvas::ContextMenuAction::SceneReaction::PostUndo; - } - //////////////////////////// // EndpointSelectionAction //////////////////////////// @@ -860,12 +807,6 @@ namespace ScriptCanvasEditor { const bool inContextMenu = true; Widget::ScriptCanvasNodePaletteConfig paletteConfig(paletteModel, assetModel, inContextMenu); - - m_addSelectedEntitiesAction = aznew AddSelectedEntitiesAction(this); - - AddActionGroup(m_addSelectedEntitiesAction->GetActionGroupId()); - AddMenuAction(m_addSelectedEntitiesAction); - AddNodePaletteMenuAction(paletteConfig); } @@ -905,8 +846,6 @@ namespace ScriptCanvasEditor m_graphCanvasConstructGroups.SetCommentsEnabled(false); m_nodeGroupPresets.SetEnabled(false); m_alignmentActionsGroups.SetEnabled(false); - - m_addSelectedEntitiesAction->setEnabled(false); } ////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.h index 01029e0be1..116f9f4ced 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.h @@ -32,22 +32,6 @@ namespace ScriptCanvasEditor // CustomActions ////////////////// - 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 { @@ -217,8 +201,6 @@ namespace ScriptCanvasEditor protected: AZ::EntityId m_sourceSlotId; - - AddSelectedEntitiesAction* m_addSelectedEntitiesAction; }; class ConnectionContextMenu diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 16edeaff5d..ad71378a26 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -95,7 +94,6 @@ namespace ScriptCanvas void Graph::Reflect(AZ::ReflectContext* context) { - Data::PropertyMetadata::Reflect(context); Data::Type::Reflect(context); Nodes::UnaryOperator::Reflect(context); Nodes::UnaryExpression::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ModifiableDatumView.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ModifiableDatumView.h index 7786a1a136..a079a2932f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ModifiableDatumView.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ModifiableDatumView.h @@ -29,8 +29,7 @@ namespace ScriptCanvas friend class Node; friend class GraphVariable; - friend class PureData; - + public: AZ_CLASS_ALLOCATOR(ModifiableDatumView, AZ::SystemAllocator, 0); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h index ca88c5179a..95fc23c5d5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h @@ -316,9 +316,6 @@ namespace ScriptCanvas #define SCRIPT_CANVAS_GENERICS_TO_VM(GenericClass, ReflectClass, BehaviorContext, CategoryName)\ GenericClass::Reflect(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str()); -#define SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(GenericClass, BehaviorContext, CategoryName)\ - GenericClass::Reflect(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str()); - template class RegistrarGeneric { @@ -335,13 +332,6 @@ namespace ScriptCanvas SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(nodes.push_back({ azrtti_typeid(), AZ::AzTypeInfo::Name() })); } - static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName) - { - auto reflection = behaviorContext->Class>(libraryName); - reflection->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent)->Attribute(AZ::ScriptCanvasAttributes::Internal::ImplementedAsNodeGeneric, true); - SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(reflection->Method(t_Node::GetNodeFunctionName(), t_Node::GetFunction())->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List | AZ::Script::Attributes::ExcludeFlags::Documentation)); - } - template static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp index 3c02099403..bd86696596 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.cpp @@ -99,8 +99,6 @@ namespace ScriptCanvas void Core::InitNodeRegistry(NodeRegistry& nodeRegistry) { using namespace ScriptCanvas::Nodes::Core; - AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); @@ -122,8 +120,6 @@ namespace ScriptCanvas AZStd::vector Core::GetComponentDescriptors() { return AZStd::vector({ - ScriptCanvas::Nodes::Core::Error::CreateDescriptor(), - ScriptCanvas::Nodes::Core::ErrorHandler::CreateDescriptor(), ScriptCanvas::Nodes::Core::Method::CreateDescriptor(), ScriptCanvas::Nodes::Core::MethodOverloaded::CreateDescriptor(), ScriptCanvas::Nodes::Core::Start::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h index 567304ee37..f1c921b1ca 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/CoreNodes.h @@ -11,8 +11,6 @@ // shared code #include "EBusEventHandler.h" -#include "Error.h" -#include "ErrorHandler.h" #include "ExtractProperty.h" #include "FunctionDefinitionNode.h" #include "ForEach.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.cpp deleted file mode 100644 index 1da9428e8f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.cpp +++ /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 - * - */ - -#include "Error.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - void Error::OnInit() - { - { - ExecutionSlotConfiguration slotConfiguration("In", ConnectionType::Input); - AddSlot(slotConfiguration); - } - - { - DynamicDataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = "This"; - slotConfiguration.m_dynamicDataType = DynamicDataType::Any; - slotConfiguration.SetConnectionType(ConnectionType::Output); - - AddSlot(slotConfiguration); // \todo for testing only, we need to ability to arbitrarily connect nodes themeselve to slots (as input to function call or error handling) or directly (as the flow of execution with arrows if easier to read...) - } - - { - DataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = "Description"; - slotConfiguration.SetConnectionType(ConnectionType::Input); - slotConfiguration.ConfigureDatum(AZStd::move(Datum(AZStd::move(Data::Type::String()), Datum::eOriginality::Copy))); - - AddSlot(slotConfiguration); - } - } - - void Error::OnInputSignal(const SlotId&) - { - const Datum* input = FindDatum(GetSlotId("Description")); - if (const Data::StringType* desc = input ? input->GetAs() : nullptr) - { - SCRIPTCANVAS_REPORT_ERROR((*this), desc->data()); - } - else - { - // \todo get a more descriptive default error report - SCRIPTCANVAS_REPORT_ERROR((*this), "Undescribed error"); - } - } - - void Error::Reflect(AZ::ReflectContext* reflectContext) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Error", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Utilities/Debug") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Error.png") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ; - } - } - } - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.h deleted file mode 100644 index f9c91ad85b..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Error.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 -{ - namespace Nodes - { - namespace Core - { - class Error - : public Node - { - public: - AZ_COMPONENT(Error, "{C6928F30-87BA-4FFE-A3C0-B6096C161DD0}", Node); - - static void Reflect(AZ::ReflectContext* reflection); - - bool IsDeprecated() const override { return true; } - - protected: - void OnInit() override; - void OnInputSignal(const SlotId&) override; - }; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp deleted file mode 100644 index 06485f5e0a..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.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 "ErrorHandler.h" - -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - const char* ErrorHandler::k_sourceName = "Source"; - - void ErrorHandler::OnInit() - { - { - ExecutionSlotConfiguration slotConfiguration("Out", ConnectionType::Output); - AddSlot(slotConfiguration); - } - - { - DynamicDataSlotConfiguration slotConfiguration; - - slotConfiguration.m_name = k_sourceName; - slotConfiguration.SetConnectionType(ConnectionType::Input); - - slotConfiguration.m_dynamicDataType = DynamicDataType::Any; - - // \todo split node abstractions into executable and !executable - AZStd::vector forbiddenTypes{ azrtti_typeid() }; - auto func = [forbiddenTypes]() { return aznew ContractRTTI(forbiddenTypes, ContractRTTI::Flags::Exclusive); }; - ContractDescriptor descriptor{ AZStd::move(func) }; - - slotConfiguration.m_contractDescs.emplace_back(descriptor); - - AddSlot(slotConfiguration); - } - } - - AZStd::vector> ErrorHandler::GetSources() const - { - return ModConnectedNodes(*GetSlot(GetSlotId(k_sourceName))); - } - - void ErrorHandler::Reflect(AZ::ReflectContext* reflectContext) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(0) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Error Handler", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Utilities/Debug") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ErrorHandler.png") - ; - } - } - } - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.h deleted file mode 100644 index 3edd8c7d4b..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ErrorHandler.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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - class ErrorHandler - : public Node - { - public: - AZ_COMPONENT(ErrorHandler, "{CF23B5A6-827C-4364-9714-EA99612D6CAE}", Node); - - static void Reflect(AZ::ReflectContext* reflection); - - AZStd::vector> GetSources() const; - - bool IsDeprecated() const override { return true; } - - protected: - static const char* k_sourceName; - void OnInit() override; - }; - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp index d55de9be45..914a8cea28 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp @@ -70,7 +70,7 @@ namespace ScriptCanvas } if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) { - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(EntityNodes::Registrar, behaviorContext, EntityNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(EntityNodes::Registrar, Entity, behaviorContext, EntityNodes::k_categoryName); } ScriptCanvas::Entity::RotateMethod::Reflect(reflection); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h index e75191a4f6..ccc65027ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h @@ -12,6 +12,21 @@ #include #include +#define REFLECT_MATH_LIBRARY_TYPE(MathType, Guid)\ + struct MathType\ + {\ + AZ_TYPE_INFO(MathType, Guid);\ + static void Reflect(AZ::ReflectContext* reflection)\ + {\ + if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection))\ + {\ + serializeContext->Class()\ + ->Version(0)\ + ;\ + }\ + }\ + }; + namespace AZ { class ReflectContext; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp index b287453f0f..d018bf459d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp @@ -13,6 +13,26 @@ namespace ScriptCanvas { + namespace Nodes + { + namespace Math + { + REFLECT_MATH_LIBRARY_TYPE(AABB, "{AB0C2753-680E-47AD-8277-66B3AC01C659}"); + REFLECT_MATH_LIBRARY_TYPE(Color, "{6CC7B2F9-F551-4CB8-A713-4149959AE337}"); + REFLECT_MATH_LIBRARY_TYPE(CRC, "{D8B65A5B-38FF-4B41-9FA4-FCA080D75625}"); + REFLECT_MATH_LIBRARY_TYPE(Matrix3x3, "{8C5F6959-C2C4-46D9-9FCD-4DC234E7732D}"); + REFLECT_MATH_LIBRARY_TYPE(Matrix4x4, "{537AB179-E23C-492D-8EF7-53845A2DB163}"); + REFLECT_MATH_LIBRARY_TYPE(OBB, "{8CBDA3B7-9DCD-4A04-A12C-123C322CA63A}"); + REFLECT_MATH_LIBRARY_TYPE(Plane, "{F2C799DF-2CC1-4DD8-91DC-18C2D517BAB0}"); + REFLECT_MATH_LIBRARY_TYPE(Quaternion, "{9BE75E2E-AA07-4767-9BF3-905C289EB38A}"); + REFLECT_MATH_LIBRARY_TYPE(Random, "{D9DF1385-6C5C-4E41-94CA-8B10E9D8FAAF}"); + REFLECT_MATH_LIBRARY_TYPE(Transform, "{59E0EF87-352C-4CFB-A810-5B8752BDD1EF}"); + REFLECT_MATH_LIBRARY_TYPE(Vector2, "{FD1BFADF-BA1F-4AFC-819B-ABA1F22AE6E6}"); + REFLECT_MATH_LIBRARY_TYPE(Vector3, "{53EA7604-E3AE-4E88-BE0E-66CBC488A7DB}"); + REFLECT_MATH_LIBRARY_TYPE(Vector4, "{66027D7A-FCD1-4592-93E5-EB4B7F4BD671}"); + } + } + namespace Library { void Math::Reflect(AZ::ReflectContext* reflection) @@ -37,22 +57,20 @@ namespace ScriptCanvas if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) { using namespace ScriptCanvas::Nodes::Math; - + SCRIPT_CANVAS_GENERICS_TO_VM(AABBNodes::Registrar, AABB, behaviorContext, AABBNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(ColorNodes::Registrar, Color, behaviorContext, ColorNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(CRCNodes::Registrar, CRC, behaviorContext, CRCNodes::k_categoryName); SCRIPT_CANVAS_GENERICS_TO_VM(MathNodes::Registrar, Math, behaviorContext, MathNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(Matrix3x3Nodes::Registrar, Matrix3x3, behaviorContext, Matrix3x3Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(Matrix4x4Nodes::Registrar, Matrix4x4, behaviorContext, Matrix4x4Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(OBBNodes::Registrar, OBB, behaviorContext, OBBNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(PlaneNodes::Registrar, Plane, behaviorContext, PlaneNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(QuaternionNodes::Registrar, Quaternion, behaviorContext, QuaternionNodes::k_categoryName); SCRIPT_CANVAS_GENERICS_TO_VM(RandomNodes::Registrar, Random, behaviorContext, RandomNodes::k_categoryName); - - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(AABBNodes::Registrar, behaviorContext, AABBNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(CRCNodes::Registrar, behaviorContext, CRCNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(ColorNodes::Registrar, behaviorContext, ColorNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix3x3Nodes::Registrar, behaviorContext, Matrix3x3Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix4x4Nodes::Registrar, behaviorContext, Matrix4x4Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(OBBNodes::Registrar, behaviorContext, OBBNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(PlaneNodes::Registrar, behaviorContext, PlaneNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(QuaternionNodes::Registrar, behaviorContext, QuaternionNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(TransformNodes::Registrar, behaviorContext, TransformNodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector2Nodes::Registrar, behaviorContext, Vector2Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector3Nodes::Registrar, behaviorContext, Vector3Nodes::k_categoryName); - SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector4Nodes::Registrar, behaviorContext, Vector4Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(TransformNodes::Registrar, Transform, behaviorContext, TransformNodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(Vector2Nodes::Registrar, Vector2, behaviorContext, Vector2Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(Vector3Nodes::Registrar, Vector3, behaviorContext, Vector3Nodes::k_categoryName); + SCRIPT_CANVAS_GENERICS_TO_VM(Vector4Nodes::Registrar, Vector4, behaviorContext, Vector4Nodes::k_categoryName); } Nodes::Internal::ExpressionNodeBase::Reflect(reflection); diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 8d5f43c3bc..3aff2357c0 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -258,10 +258,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/ExtractProperty.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.h Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.cpp - Include/ScriptCanvas/Libraries/Core/Error.cpp - Include/ScriptCanvas/Libraries/Core/Error.h - Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp - Include/ScriptCanvas/Libraries/Core/ErrorHandler.h Include/ScriptCanvas/Libraries/Core/ForEach.cpp Include/ScriptCanvas/Libraries/Core/ForEach.h Include/ScriptCanvas/Libraries/Core/ForEach.ScriptCanvasGrammar.xml From 16f9eece76872be37b236367b93dafd5927eb9d0 Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 14:12:12 -0700 Subject: [PATCH 023/156] Set correct display text for the default and minimal projects. Signed-off-by: pconroy --- Templates/DefaultProject/template.json | 4 ++-- Templates/MinimalProject/template.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index 98cf0fc815..fabfb0cf18 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -4,8 +4,8 @@ "restricted_platform_relative_path": "Templates", "origin": "The primary repo for DefaultProject goes here: i.e. http://www.mydomain.com", "license": "What license DefaultProject uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "Default", - "summary": "A short description of DefaultProject.", + "display_name": "Standard", + "summary": "This template has everything you need to build a full online 3D game or application.", "included_gems": ["Atom","Camera","EMotionFX","UI","Maestro","Input","ImGui"], "canonical_tags": [], "user_tags": [ diff --git a/Templates/MinimalProject/template.json b/Templates/MinimalProject/template.json index 18b10e8cae..a244904578 100644 --- a/Templates/MinimalProject/template.json +++ b/Templates/MinimalProject/template.json @@ -2,8 +2,8 @@ "template_name": "MinimalProject", "origin": "The primary repo for MinimalProject goes here: i.e. http://www.mydomain.com", "license": "What license MinimalProject uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "MinimalProject", - "summary": "A short description of MinimalProject.", + "display_name": "Minimal", + "summary": "This will be a good starting point for developers who are looking for building the game with the bare minimum of gems in O3DE, and adding more when needed. ", "canonical_tags": [], "user_tags": [ "MinimalProject" From 88c328c6e27d7bf844b4517a5230866a68116067 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 1 Jul 2021 17:50:56 -0700 Subject: [PATCH 024/156] The Great ScriptCanvas Purge, Part III Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Framework/ScriptCanvasTraceUtilities.h | 6 +++--- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 21 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index de1a6de247..b3c4993063 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -173,13 +173,13 @@ namespace ScriptCanvasEditor { ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { -// AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); -// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); + AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index ad71378a26..6d367e5027 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -12,38 +12,34 @@ #include #include #include - #include #include #include - #include #include #include #include #include #include -#include - -#include +#include +#include #include -#include +#include #include - -#include +#include +#include #include #include #include #include -#include -#include #include #include - +#include +#include +#include #include #include -#include #include #include @@ -94,6 +90,7 @@ namespace ScriptCanvas void Graph::Reflect(AZ::ReflectContext* context) { + Data::PropertyMetadata::Reflect(context); Data::Type::Reflect(context); Nodes::UnaryOperator::Reflect(context); Nodes::UnaryExpression::Reflect(context); From e0c3d15d5a62f402f6582406f71c37aabd9bd15c Mon Sep 17 00:00:00 2001 From: pconroy Date: Fri, 25 Jun 2021 17:39:27 -0700 Subject: [PATCH 025/156] Remove deleted projects from project manager Signed-off-by: pconroy --- .../ProjectManager/Source/ProjectsScreen.cpp | 7 +++ .../ProjectManager/Source/ProjectsScreen.h | 1 + .../ProjectManager/Source/PythonBindings.cpp | 9 ++++ .../ProjectManager/Source/PythonBindings.h | 1 + .../Source/PythonBindingsInterface.h | 5 ++ scripts/o3de/o3de/register.py | 51 ++++++++++--------- 6 files changed, 51 insertions(+), 23 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index b1db77ea83..df828b028a 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -119,6 +119,8 @@ namespace O3DE::ProjectManager QFrame* ProjectsScreen::CreateProjectsContent(QString buildProjectPath, ProjectButton** projectButton) { + RemoveInvalidProjects(); + QFrame* frame = new QFrame(this); frame->setObjectName("projectsContent"); { @@ -481,6 +483,11 @@ namespace O3DE::ProjectManager return displayFirstTimeContent; } + void ProjectsScreen::RemoveInvalidProjects() + { + PythonBindingsInterface::Get()->RemoveInvalidProjects(); + } + void ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo) { if (ProjectUtils::IsVS2019Installed()) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.h b/Code/Tools/ProjectManager/Source/ProjectsScreen.h index 12152e908b..e2929c1107 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.h @@ -59,6 +59,7 @@ namespace O3DE::ProjectManager ProjectButton* CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing = false); void ResetProjectsContent(); bool ShouldDisplayFirstTimeContent(); + void RemoveInvalidProjects(); void StartProjectBuild(const ProjectInfo& projectInfo); QList::iterator RequiresBuildProjectIterator(const QString& projectPath); diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index f8c45bedeb..11ca5a79c5 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -755,6 +755,15 @@ namespace O3DE::ProjectManager }); } + void PythonBindings::RemoveInvalidProjects() + { + ExecuteWithLockErrorHandling( + [&] + { + m_register.attr("remove_invalid_o3de_projects")(); + }); + } + AZ::Outcome PythonBindings::UpdateProject(const ProjectInfo& projectInfo) { bool updateProjectSucceeded = false; diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index 1d98505457..a64727abfe 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -50,6 +50,7 @@ namespace O3DE::ProjectManager AZ::Outcome UpdateProject(const ProjectInfo& projectInfo) override; AZ::Outcome AddGemToProject(const QString& gemPath, const QString& projectPath) override; AZ::Outcome RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override; + void RemoveInvalidProjects() override; // ProjectTemplate AZ::Outcome> GetProjectTemplates(const QString& projectPath = {}) override; diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index 0adc842a05..c4a271cfa1 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -141,6 +141,11 @@ namespace O3DE::ProjectManager */ virtual AZ::Outcome RemoveGemFromProject(const QString& gemPath, const QString& projectPath) = 0; + /** + * Removes invalid projects from the manifest + */ + virtual void RemoveInvalidProjects() = 0; + // Project Templates diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index 7ad341784e..3a006735ed 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -404,27 +404,28 @@ def register_project_path(json_data: dict, if result != 0: return result - # registering a project has the additional step of setting the project.json 'engine' field - this_engine_json = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) - if not this_engine_json: - return 1 - project_json_data = manifest.get_project_json_data(project_path=project_path) - if not project_json_data: - return 1 - - update_project_json = False - try: - update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] - except KeyError as e: - update_project_json = True - - if update_project_json: - project_json_path = project_path / 'project.json' - project_json_data['engine'] = this_engine_json['engine_name'] - utils.backup_file(project_json_path) - if not manifest.save_o3de_manifest(project_json_data, project_json_path): + if not remove: + # registering a project has the additional step of setting the project.json 'engine' field + this_engine_json = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) + if not this_engine_json: + return 1 + project_json_data = manifest.get_project_json_data(project_path=project_path) + if not project_json_data: return 1 + update_project_json = False + try: + update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] + except KeyError as e: + update_project_json = True + + if update_project_json: + project_json_path = project_path / 'project.json' + project_json_data['engine'] = this_engine_json['engine_name'] + utils.backup_file(project_json_path) + if not manifest.save_o3de_manifest(project_json_data, project_json_path): + return 1 + return 0 @@ -657,6 +658,13 @@ def register(engine_path: pathlib.Path = None, return result +def remove_invalid_o3de_projects() -> None: + json_data = manifest.load_o3de_manifest() + + for project in json_data['projects']: + if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): + logger.warn(f"Project path {project} is invalid.") + register(project_path=pathlib.Path(project), remove=True) def remove_invalid_o3de_objects() -> None: json_data = manifest.load_o3de_manifest() @@ -667,10 +675,7 @@ def remove_invalid_o3de_objects() -> None: logger.warn(f"Engine path {engine_path} is invalid.") register(engine_path=engine_path, remove=True) - for project in json_data['projects']: - if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): - logger.warn(f"Project path {project} is invalid.") - register(project_path=project, remove=True) + remove_invalid_o3de_projects() for gem in json_data['gems']: if not validation.valid_o3de_gem_json(pathlib.Path(gem).resolve() / 'gem.json'): From ae6a42406441c91566b5b6fb320ce6ea88379724 Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 13:22:44 -0700 Subject: [PATCH 026/156] Make remove_invalid_o3de_projects take a path and return a value Signed-off-by: pconroy --- Code/Tools/ProjectManager/Source/ProjectsScreen.cpp | 4 ++-- Code/Tools/ProjectManager/Source/ProjectsScreen.h | 2 +- Code/Tools/ProjectManager/Source/PythonBindings.cpp | 12 +++++++++--- Code/Tools/ProjectManager/Source/PythonBindings.h | 2 +- .../ProjectManager/Source/PythonBindingsInterface.h | 2 +- scripts/o3de/o3de/register.py | 13 ++++++++++--- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index df828b028a..90ef0b6416 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -483,9 +483,9 @@ namespace O3DE::ProjectManager return displayFirstTimeContent; } - void ProjectsScreen::RemoveInvalidProjects() + bool ProjectsScreen::RemoveInvalidProjects() { - PythonBindingsInterface::Get()->RemoveInvalidProjects(); + return PythonBindingsInterface::Get()->RemoveInvalidProjects(); } void ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.h b/Code/Tools/ProjectManager/Source/ProjectsScreen.h index e2929c1107..6bedb1a188 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.h @@ -59,7 +59,7 @@ namespace O3DE::ProjectManager ProjectButton* CreateProjectButton(ProjectInfo& project, QLayout* flowLayout, bool processing = false); void ResetProjectsContent(); bool ShouldDisplayFirstTimeContent(); - void RemoveInvalidProjects(); + bool RemoveInvalidProjects(); void StartProjectBuild(const ProjectInfo& projectInfo); QList::iterator RequiresBuildProjectIterator(const QString& projectPath); diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 11ca5a79c5..00b6940255 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -755,13 +755,19 @@ namespace O3DE::ProjectManager }); } - void PythonBindings::RemoveInvalidProjects() + bool PythonBindings::RemoveInvalidProjects() { - ExecuteWithLockErrorHandling( + bool removalResult = false; + bool result = ExecuteWithLock( [&] { - m_register.attr("remove_invalid_o3de_projects")(); + auto pythonRemovalResult = m_register.attr("remove_invalid_o3de_projects")(); + + // Returns an exit code so boolify it then invert result + removalResult = !pythonRemovalResult.cast(); }); + + return result && removalResult; } AZ::Outcome PythonBindings::UpdateProject(const ProjectInfo& projectInfo) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index a64727abfe..98ca8e90f0 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -50,7 +50,7 @@ namespace O3DE::ProjectManager AZ::Outcome UpdateProject(const ProjectInfo& projectInfo) override; AZ::Outcome AddGemToProject(const QString& gemPath, const QString& projectPath) override; AZ::Outcome RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override; - void RemoveInvalidProjects() override; + bool RemoveInvalidProjects() override; // ProjectTemplate AZ::Outcome> GetProjectTemplates(const QString& projectPath = {}) override; diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index c4a271cfa1..8580087737 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -144,7 +144,7 @@ namespace O3DE::ProjectManager /** * Removes invalid projects from the manifest */ - virtual void RemoveInvalidProjects() = 0; + virtual bool RemoveInvalidProjects() = 0; // Project Templates diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index 3a006735ed..d1029ee47f 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -658,13 +658,20 @@ def register(engine_path: pathlib.Path = None, return result -def remove_invalid_o3de_projects() -> None: - json_data = manifest.load_o3de_manifest() +def remove_invalid_o3de_projects(manifest_path: pathlib.Path = None) -> int: + if not manifest_path: + manifest_path = manifest.get_o3de_manifest() + + json_data = manifest.load_o3de_manifest(manifest_path) + + result = 0 for project in json_data['projects']: if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): logger.warn(f"Project path {project} is invalid.") - register(project_path=pathlib.Path(project), remove=True) + result = register(project_path=pathlib.Path(project), remove=True) + + return result def remove_invalid_o3de_objects() -> None: json_data = manifest.load_o3de_manifest() From a0b754bb4d4ae96dc53b8350fa62baba7d4f20c2 Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 14:33:12 -0700 Subject: [PATCH 027/156] Fix return value when multiple projects are removed and one fails Signed-off-by: pconroy --- scripts/o3de/o3de/register.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index d1029ee47f..2eb9cd45be 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -669,7 +669,9 @@ def remove_invalid_o3de_projects(manifest_path: pathlib.Path = None) -> int: for project in json_data['projects']: if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): logger.warn(f"Project path {project} is invalid.") - result = register(project_path=pathlib.Path(project), remove=True) + # Attempt to unregister all invalid projects even if previous projects failed to unregister + # but combine the result codes of each command. + result = register(project_path=pathlib.Path(project), remove=True) or result return result From 4a3772d96af7e469a050f32d2a1a3ec5acd7140d Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Fri, 2 Jul 2021 12:52:56 +0200 Subject: [PATCH 028/156] [LYN-4437] Replaced the background images for the Project Manager * Added the two new background images. * Background is now dynamically changing based on whether the user opens the PM the first time or has already created a project. Signed-off-by: Benjamin Jillich --- .../Resources/Backgrounds/DefaultBackground.jpg | 3 +++ .../Resources/Backgrounds/FirstTimeBackgroundImage.jpg | 3 --- .../ProjectManager/Resources/Backgrounds/FtueBackground.jpg | 3 +++ Code/Tools/ProjectManager/Resources/ProjectManager.qrc | 3 ++- Code/Tools/ProjectManager/Source/ProjectsScreen.cpp | 5 +++-- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg delete mode 100644 Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg create mode 100644 Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg new file mode 100644 index 0000000000..3af15393c4 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/DefaultBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:342c3eaccf68a178dfd8c2b1792a93a8c9197c8184dca11bf90706d7481df087 +size 1611268 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg deleted file mode 100644 index bfa5f83cf6..0000000000 --- a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7088e902885d98953f6a1715efab319c063a4ab8918fd0e810251c8ed82b8514 -size 542983 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg new file mode 100644 index 0000000000..44291a8b1d --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/FtueBackground.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:797794816e4b1702f1ae1f32b408c95c79eb1f8a95aba43cfad9cccc181b0bda +size 1135182 diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc index 0b9de2af89..cfe4b37fbc 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc @@ -26,12 +26,13 @@ o3de.svg menu.svg menu_hover.svg - Backgrounds/FirstTimeBackgroundImage.jpg ArrowDownLine.svg ArrowUpLine.svg CarrotArrowDown.svg Summary.svg WindowClose.svg Warning.svg + Backgrounds/DefaultBackground.jpg + Backgrounds/FtueBackground.jpg diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index cc3e386118..80fb5dcb71 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -53,8 +53,6 @@ namespace O3DE::ProjectManager vLayout->setContentsMargins(s_contentMargins, 0, s_contentMargins, 0); setLayout(vLayout); - m_background.load(":/Backgrounds/FirstTimeBackgroundImage.jpg"); - m_stack = new QStackedWidget(this); m_firstTimeContent = CreateFirstTimeContent(); @@ -232,6 +230,8 @@ namespace O3DE::ProjectManager m_projectsContent->deleteLater(); } + m_background.load(":/Backgrounds/DefaultBackground.jpg"); + // Make sure to update builder with latest Project Button if (m_currentBuilder) { @@ -459,6 +459,7 @@ namespace O3DE::ProjectManager { if (ShouldDisplayFirstTimeContent()) { + m_background.load(":/Backgrounds/FtueBackground.jpg"); m_stack->setCurrentWidget(m_firstTimeContent); } else From 5f9c066626d5e23db324986f70160e7cc80b6c83 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Fri, 2 Jul 2021 14:52:56 +0200 Subject: [PATCH 029/156] [LYN-4437] Added 30% opaque overlay to the background image of the Project Manager * 30% opaque overlay image to darken down the colors and increase usability and accessibility. * Some code cleaning. Signed-off-by: Benjamin Jillich --- .../ProjectManager/Source/ProjectsScreen.cpp | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index 80fb5dcb71..b3ecd96e43 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -269,21 +269,30 @@ namespace O3DE::ProjectManager // we paint the background here because qss does not support background cover scaling QPainter painter(this); - auto winSize = size(); - auto pixmapRatio = (float)m_background.width() / m_background.height(); - auto windowRatio = (float)winSize.width() / winSize.height(); + const QSize winSize = size(); + const float pixmapRatio = (float)m_background.width() / m_background.height(); + const float windowRatio = (float)winSize.width() / winSize.height(); + QRect backgroundRect; if (pixmapRatio > windowRatio) { - auto newWidth = (int)(winSize.height() * pixmapRatio); - auto offset = (newWidth - winSize.width()) / -2; - painter.drawPixmap(offset, 0, newWidth, winSize.height(), m_background); + const int newWidth = (int)(winSize.height() * pixmapRatio); + const int offset = (newWidth - winSize.width()) / -2; + backgroundRect = QRect(offset, 0, newWidth, winSize.height()); } else { - auto newHeight = (int)(winSize.width() / pixmapRatio); - painter.drawPixmap(0, 0, winSize.width(), newHeight, m_background); + const int newHeight = (int)(winSize.width() / pixmapRatio); + backgroundRect = QRect(0, 0, winSize.width(), newHeight); } + + // Draw the background image. + painter.drawPixmap(backgroundRect, m_background); + + // Draw a semi-transparent overlay to darken down the colors. + painter.setCompositionMode (QPainter::CompositionMode_DestinationIn); + const float overlayTransparency = 0.7f; + painter.fillRect(backgroundRect, QColor(0, 0, 0, static_cast(255.0f * overlayTransparency))); } void ProjectsScreen::HandleNewProjectButton() From d17390befbb463fa371ed1874e39ec89635172df Mon Sep 17 00:00:00 2001 From: pereslav Date: Fri, 2 Jul 2021 16:01:30 +0100 Subject: [PATCH 030/156] LYN-4866 Fixed net entities indices when creating net spawnable Signed-off-by: pereslav --- .../Prefab/Spawnable/SpawnableUtils.cpp | 26 ++++--- .../Prefab/Spawnable/SpawnableUtils.h | 7 ++ .../Pipeline/NetworkPrefabProcessor.cpp | 69 +++++++------------ 3 files changed, 48 insertions(+), 54 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index f23f9c6187..65e4c14276 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -46,10 +46,11 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } + template void OrganizeEntitiesForSorting( - AzFramework::Spawnable::EntityList& entities, + AZStd::vector& entities, AZStd::unordered_set& existingEntityIds, - AZStd::unordered_map& parentIdToChildren, + AZStd::unordered_map>& parentIdToChildren, AZStd::vector& candidateIds, size_t& removedEntitiesCount) { @@ -90,7 +91,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils // entities with no transform component will be treated like entities with no parent. AZ::EntityId parentId; if (AZ::TransformInterface* transformInterface = - AZ::EntityUtils::FindFirstDerivedComponent(entity.get())) + AZ::EntityUtils::FindFirstDerivedComponent(&(*entity))) { parentId = transformInterface->GetParentId(); if (parentId == entityId) @@ -104,8 +105,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } auto& children = parentIdToChildren[parentId]; - children.emplace_back(nullptr); - children.back().swap(entity); + children.emplace_back(AZStd::move(entity)); } // clear 'entities', we'll refill it in sorted order. @@ -125,9 +125,10 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } + template void TraceParentingLoop( const AZ::EntityId& parentFromLoopId, - const AZStd::unordered_map& parentIdToChildren) + const AZStd::unordered_map>& parentIdToChildren) { // Find name to use in warning message @@ -153,16 +154,22 @@ namespace AzToolsFramework::Prefab::SpawnableUtils parentFromLoopId.ToString().c_str()); } + void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable) { - auto& entities = spawnable.GetEntities(); + SortEntitiesByTransformHierarchy(spawnable.GetEntities()); + } + + template + void SortEntitiesByTransformHierarchy(AZStd::vector& entities) + { const size_t originalEntityCount = entities.size(); // IDs of those present in 'entities'. Does not include parent ID if parent not found in 'entities' AZStd::unordered_set existingEntityIds; // map children by their parent ID (even if parent not found in 'entities') - AZStd::unordered_map parentIdToChildren; + AZStd::unordered_map> parentIdToChildren; // use 'candidateIds' to track the parent IDs we're going to process next. AZStd::vector candidateIds; @@ -199,8 +206,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils for (auto& child : foundChildren->second) { candidateIds.push_back(child->GetId()); - entities.emplace_back(nullptr); - entities.back().swap(child); + entities.emplace_back(AZStd::move(child)); } parentIdToChildren.erase(foundChildren); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index e727f3487d..f46c94d4ec 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -16,4 +16,11 @@ namespace AzToolsFramework::Prefab::SpawnableUtils bool CreateSpawnable(AzFramework::Spawnable& spawnable, const PrefabDom& prefabDom, AZStd::vector>& referencedAssets); void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable); + + template + void SortEntitiesByTransformHierarchy(AZStd::vector& entities); + + // Explicit specializations + template void SortEntitiesByTransformHierarchy(AZStd::vector& entities); + template void SortEntitiesByTransformHierarchy(AZStd::vector>& entities); } // namespace AzToolsFramework::Prefab::SpawnableUtils diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index 3452a79e25..41b8466bc5 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -72,21 +72,24 @@ namespace Multiplayer } static void GatherNetEntities( - AzToolsFramework::Prefab::Instance* instance, - AZStd::vector>& output) + AzToolsFramework::Prefab::Instance* instance, + AZStd::unordered_map& entityToInstanceMap, + AZStd::vector& netEntities) { - instance->GetEntities([instance, &output](AZStd::unique_ptr& prefabEntity) + instance->GetEntities([instance, &entityToInstanceMap, &netEntities](AZStd::unique_ptr& prefabEntity) { if (prefabEntity->FindComponent()) { - output.push_back(AZStd::make_pair(prefabEntity.get(), instance)); + AZ::Entity* entity = prefabEntity.get(); + entityToInstanceMap[entity] = instance; + netEntities.push_back(entity); } return true; }); - instance->GetNestedInstances([&output](AZStd::unique_ptr& nestedInstance) + instance->GetNestedInstances([&entityToInstanceMap, &netEntities](AZStd::unique_ptr& nestedInstance) { - GatherNetEntities(nestedInstance.get(), output); + GatherNetEntities(nestedInstance.get(), entityToInstanceMap, netEntities); }); } @@ -112,33 +115,32 @@ namespace Multiplayer auto&& [object, networkSpawnable] = ProcessedObjectStore::Create(uniqueName, context.GetSourceUuid(), AZStd::move(serializer)); + auto& netSpawnableEntities = networkSpawnable->GetEntities(); // Grab all net entities with their corresponding Instances to handle nested prefabs correctly - AZStd::vector> netEntities; - GatherNetEntities(sourceInstance.get(), netEntities); + AZStd::unordered_map netEntityToInstanceMap; + AZStd::vector prefabNetEntities; + GatherNetEntities(sourceInstance.get(), netEntityToInstanceMap, prefabNetEntities); - if (netEntities.empty()) + if (prefabNetEntities.empty()) { // No networked entities in the prefab, no need to do anything in this processor. return; } - // Instance container for net entities - AZStd::unique_ptr networkInstance(aznew Instance()); - networkInstance->SetTemplateSourcePath(AZ::IO::PathView(uniqueName)); + // Sort the entities prior to processing. The entities will end up in the net spawnable in this order. + SpawnableUtils::SortEntitiesByTransformHierarchy(prefabNetEntities); // Create an asset for our future network spawnable: this allows us to put references to the asset in the components AZ::Data::Asset networkSpawnableAsset; networkSpawnableAsset.Create(networkSpawnable->GetId()); networkSpawnableAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - // Each spawnable has a root meta-data entity at position 0, so starting net indices from 1 - size_t netEntitiesIndexCounter = 1; + size_t netEntitiesIndexCounter = 0; - for (auto& entityInstancePair : netEntities) + for (auto* prefabEntity : prefabNetEntities) { - AZ::Entity* prefabEntity = entityInstancePair.first; - Instance* instance = entityInstancePair.second; + Instance* instance = netEntityToInstanceMap[prefabEntity]; AZ::EntityId entityId = prefabEntity->GetId(); AZ::Entity* netEntity = instance->DetachEntity(entityId).release(); @@ -147,7 +149,11 @@ namespace Multiplayer // Net entity will need a new ID to avoid IDs collision netEntity->SetId(AZ::Entity::MakeId()); - networkInstance->AddEntity(*netEntity); + netEntity->InvalidateDependencies(); + netEntity->EvaluateDependencies(); + + // Insert the entity into the target net spawnable + netSpawnableEntities.emplace_back(netEntity); // Use the old ID for the breadcrumb entity to keep parent-child relationship in the original spawnable AZ::Entity* breadcrumbEntity = aznew AZ::Entity(entityId, netEntity->GetName()); @@ -185,37 +191,12 @@ namespace Multiplayer } // save the final result in the target Prefab DOM. - PrefabDom networkPrefab; - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*networkInstance, networkPrefab)) - { - AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); - return; - } - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*sourceInstance, prefab)) { AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); return; } - bool result = SpawnableUtils::CreateSpawnable(*networkSpawnable, networkPrefab); - if (result) - { - AzFramework::Spawnable::EntityList& entities = networkSpawnable->GetEntities(); - for (auto it = entities.begin(); it != entities.end(); ++it) - { - (*it)->InvalidateDependencies(); - (*it)->EvaluateDependencies(); - } - - SpawnableUtils::SortEntitiesByTransformHierarchy(*networkSpawnable); - - context.GetProcessedObjects().push_back(AZStd::move(object)); - } - else - { - AZ_Error("Prefabs", false, "Failed to convert prefab '%.*s' to a spawnable.", AZ_STRING_ARG(prefabName)); - context.ErrorEncountered(); - } + context.GetProcessedObjects().push_back(AZStd::move(object)); } } From d365ff51d68a69b3a4d39dc7c52a52f88fbf0e9c Mon Sep 17 00:00:00 2001 From: amzn-hdoke <61443753+hdoke@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:24:42 -0700 Subject: [PATCH 031/156] [AWS][Gems] Fix for Linux Release Monolithic Builds (#1739) * Add missing 3rd party deps to Metrics gem Signed-off-by: dhrudesh * Set AWSNativeSDK-linux revision to 5 Signed-off-by: dhrudesh --- AutomatedTesting/Gem/Code/enabled_gems.cmake | 2 +- Gems/AWSMetrics/Code/CMakeLists.txt | 1 + cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake index fa421b8633..d4f23ede63 100644 --- a/AutomatedTesting/Gem/Code/enabled_gems.cmake +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -51,7 +51,7 @@ set(ENABLED_GEMS ) # TODO remove conditional add once AWSNativeSDK libs are fixed for Android and Linux Monolithic release. -set(aws_excluded_platforms Linux Android) +set(aws_excluded_platforms Android) if (NOT (LY_MONOLITHIC_GAME AND ${PAL_PLATFORM_NAME} IN_LIST aws_excluded_platforms)) list(APPEND ENABLED_GEMS AWSCore diff --git a/Gems/AWSMetrics/Code/CMakeLists.txt b/Gems/AWSMetrics/Code/CMakeLists.txt index 153c8bec1b..150e226d14 100644 --- a/Gems/AWSMetrics/Code/CMakeLists.txt +++ b/Gems/AWSMetrics/Code/CMakeLists.txt @@ -21,6 +21,7 @@ ly_add_target( AZ::AzFramework PUBLIC Gem::AWSCore + 3rdParty::AWSNativeSDK::Core ) ly_add_target( diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index c0099b8dbe..b0cfb52fb2 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -31,7 +31,7 @@ ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-linux TARGETS freetype PACKAGE_HASH 9ad246873067717962c6b780d28a5ce3cef3321b73c9aea746a039c798f52e93) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-linux TARGETS tiff PACKAGE_HASH ae92b4d3b189c42ef644abc5cac865d1fb2eb7cb5622ec17e35642b00d1a0a76) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-linux TARGETS AWSNativeSDK PACKAGE_HASH b4db38de49d35a5f7500aed7f4aee5ec511dd3b584ee06fe9097885690191a5d) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev5-linux TARGETS AWSNativeSDK PACKAGE_HASH 0101a4052d9fce83a6f5515e00f366e97b308ecb8261ad23a6e4eb4365212ab6) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux TARGETS Lua PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-linux TARGETS PhysX PACKAGE_HASH a110249cbef4f266b0002c4ee9a71f59f373040cefbe6b82f1e1510c811edde6) ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-linux TARGETS etc2comp PACKAGE_HASH 9283aa5db5bb7fb90a0ddb7a9f3895317c8ebe8044943124bbb3673a41407430) From 3c959832a3165ce834de3d812f313ce4bbf06d80 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:24:58 -0700 Subject: [PATCH 032/156] Reparenting - introduce loop detection on instance reparenting (DCO fix) (#1752) * Detect loops in reparenting code and assert. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Add warning when detecting a cyclical dependancy. Revert reparenting on loop. Signed-off-by: daimini <82231674+AMZN-daimini@users.noreply.github.com> Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Use GetActiveWindow helper to handle window edge cases Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../Application/ToolsApplication.cpp | 9 +++- .../Prefab/PrefabPublicHandler.cpp | 43 +++++++++++++++++-- .../Prefab/PrefabPublicHandler.h | 2 +- .../Prefab/PrefabPublicInterface.h | 3 +- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index ff0c2c586b..95f13dc649 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1589,7 +1590,13 @@ namespace AzToolsFramework // Multiple changes to the same entity are just split between different undo nodes. for (AZ::EntityId entityId : m_dirtyEntities) { - prefabPublicInterface->GenerateUndoNodesForEntityChangeAndUpdateCache(entityId, m_currentBatchUndo); + auto outcome = prefabPublicInterface->GenerateUndoNodesForEntityChangeAndUpdateCache(entityId, m_currentBatchUndo); + + if (!outcome.IsSuccess()) + { + QMessageBox::warning( + AzToolsFramework::GetActiveWindow(), QString("Error"), QString(outcome.GetError().c_str()), QMessageBox::Ok, QMessageBox::Ok); + } } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index cf55a02f65..d479b72e37 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -587,21 +587,21 @@ namespace AzToolsFramework return AZ::Success(entityId); } - void PrefabPublicHandler::GenerateUndoNodesForEntityChangeAndUpdateCache( + PrefabOperationResult PrefabPublicHandler::GenerateUndoNodesForEntityChangeAndUpdateCache( AZ::EntityId entityId, UndoSystem::URSequencePoint* parentUndoBatch) { // Create Undo node on entities if they belong to an instance InstanceOptionalReference owningInstance = m_instanceEntityMapperInterface->FindOwningInstance(entityId); if (!owningInstance.has_value()) { - return; + return AZ::Success(); } AZ::Entity* entity = GetEntityById(entityId); if (!entity) { m_prefabUndoCache.PurgeCache(entityId); - return; + return AZ::Success(); } PrefabDom beforeState; @@ -633,6 +633,41 @@ namespace AzToolsFramework (&beforeOwningInstance->get() != &afterOwningInstance->get())) { isNewParentOwnedByDifferentInstance = true; + + // Detect loops. Assert if an instance has been reparented in such a way to generate circular dependencies. + AZStd::vector instancesInvolved; + + if (isInstanceContainerEntity) + { + instancesInvolved.push_back(&owningInstance->get()); + } + else + { + // Retrieve all nested instances that are part of the subtree under the current entity. + EntityList entities; + RetrieveAndSortPrefabEntitiesAndInstances({ entity }, beforeOwningInstance->get(), entities, instancesInvolved); + } + + for (Instance* instance : instancesInvolved) + { + const PrefabDom& templateDom = + m_prefabSystemComponentInterface->FindTemplateDom(instance->GetTemplateId()); + AZStd::unordered_set templatePaths; + PrefabDomUtils::GetTemplateSourcePaths(templateDom, templatePaths); + + if (IsCyclicalDependencyFound(afterOwningInstance->get(), templatePaths)) + { + // Cancel the operation by restoring the previous parent + AZ::TransformBus::Event(entityId, &AZ::TransformBus::Events::SetParent, beforeParentId); + m_prefabUndoCache.UpdateCache(entityId); + + // Skip the creation of an undo node + return AZ::Failure(AZStd::string::format( + "Reparent Prefab operation aborted - Cyclical dependency detected\n(%s depends on %s).", + instance->GetTemplateSourcePath().Native().c_str(), + afterOwningInstance->get().GetTemplateSourcePath().Native().c_str())); + } + } } } @@ -673,6 +708,8 @@ namespace AzToolsFramework } m_prefabUndoCache.UpdateCache(entityId); + + return AZ::Success(); } void PrefabPublicHandler::Internal_HandleContainerOverride( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h index 687c11cd60..7dbb7b1e71 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h @@ -46,7 +46,7 @@ namespace AzToolsFramework PrefabOperationResult SavePrefab(AZ::IO::Path filePath) override; PrefabEntityResult CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position) override; - void GenerateUndoNodesForEntityChangeAndUpdateCache(AZ::EntityId entityId, UndoSystem::URSequencePoint* parentUndoBatch) override; + PrefabOperationResult GenerateUndoNodesForEntityChangeAndUpdateCache(AZ::EntityId entityId, UndoSystem::URSequencePoint* parentUndoBatch) override; bool IsInstanceContainerEntity(AZ::EntityId entityId) const override; bool IsLevelInstanceContainerEntity(AZ::EntityId entityId) const override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h index e65268dcb2..100e403660 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h @@ -79,8 +79,9 @@ namespace AzToolsFramework * * @param entityId The entity to patch. * @param parentUndoBatch The undo batch the undo nodes should be parented to. + * @return Returns Success if the node was generated correctly, or an error message otherwise. */ - virtual void GenerateUndoNodesForEntityChangeAndUpdateCache( + virtual PrefabOperationResult GenerateUndoNodesForEntityChangeAndUpdateCache( AZ::EntityId entityId, UndoSystem::URSequencePoint* parentUndoBatch) = 0; /** From 2a42e7a0125f33dea661659dcb34e9f6d6a61b65 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:56:34 -0700 Subject: [PATCH 033/156] [LYN-4393] As a dev I want to Enable Gems in O3DE.exe with Keyboard (#1760) Enabling and disabling the selected gem is now possible by pressing the space bar. Signed-off-by: Benjamin Jillich --- .../Source/GemCatalog/GemItemDelegate.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 2718165993..035fcb7181 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -131,6 +131,17 @@ namespace O3DE::ProjectManager return false; } + if (event->type() == QEvent::KeyPress) + { + auto keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Space) + { + const bool isAdded = GemModel::IsAdded(modelIndex); + GemModel::SetIsAdded(*model, modelIndex, !isAdded); + return true; + } + } + if (event->type() == QEvent::MouseButtonPress) { QMouseEvent* mouseEvent = static_cast(event); From d20cf06e1ef7a7396532ee28859fc1c620ae96c7 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:59:44 -0700 Subject: [PATCH 034/156] Update with simpler .lfsconfig instructions (#1730) --- .lfsconfig | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.lfsconfig b/.lfsconfig index e51eb5e7c4..546f34ff1c 100644 --- a/.lfsconfig +++ b/.lfsconfig @@ -2,10 +2,14 @@ # Default LFS endpoint for this repository url=https://d3df09qsjufr6g.cloudfront.net/api/v1 -# To use the endpoint with your fork: -# 1. uncomment the url line below by removing the '#' -# 2. replace 'owner' with the username or organization that owns the fork -# 3. have git ignore your local modification of this file by running -# git update-index --skip-worktree .lfsconfig - -# url=https://d3df09qsjufr6g.cloudfront.net/api/v1/fork/owner +# To use the endpoint with your fork, run the following git command +# in your local repository (without the '#'), replacing 'owner' with +# the username or organization that owns the fork. +# +# git config lfs.url "https://d3df09qsjufr6g.cloudfront.net/api/v1/fork/owner" +# +# For example, if your fork is https://github.com/octocat/o3de use +# git config lfs.url "https://d3df09qsjufr6g.cloudfront.net/api/v1/fork/octocat" +# +# IMPORTANT: authenticate with your GitHub username and personal access token +# not your GitHub password From 1cf6e6dd108211e7c37f255a1e26d20044eceb77 Mon Sep 17 00:00:00 2001 From: Mike Chang <62353586+amzn-changml@users.noreply.github.com> Date: Fri, 2 Jul 2021 09:27:04 -0700 Subject: [PATCH 035/156] Change 3p default CDN endpoint (#1749) Signed-off-by: changml --- cmake/3rdPartyPackages.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index a0124f9a33..c13eecbee4 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -28,8 +28,7 @@ include(cmake/LySet.cmake) # also allowed: # "s3://bucketname" (it will use LYPackage_S3Downloader.cmake to download it from a s3 bucket) -# https://d2c171ws20a1rv.cloudfront.net will be the current "production" CDN until formally moved to the public O3DE repo -set(LY_PACKAGE_SERVER_URLS "https://d2c171ws20a1rv.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") +set(LY_PACKAGE_SERVER_URLS "http://d3t6xeg4fgfoum.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") # Note: if you define the "LY_PACKAGE_SERVER_URLS" environment variable # it will be added to this value in the front, so that users can set # an env var and use that as an "additional" set of servers beyond the default set. From 5eb0b794170a100a3a5e9cd74262570d90b5ea31 Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 2 Jul 2021 09:46:18 -0700 Subject: [PATCH 036/156] Increment AWS native SDK Android package version number. This fixes curl library not being copied into APK. (#1728) --- cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index 1f3d67a034..8c25e34f3f 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -19,7 +19,7 @@ ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-android TARGETS freetype PACKAGE_HASH 74dd75382688323c3a2a5090f473840b5d7e9d2aed1a4fcdff05ed2a09a664f2) ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-android TARGETS tiff PACKAGE_HASH a9b30a1980946390c2fad0ed94562476a1d7ba8c1f36934ae140a89c54a8efd0) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-android TARGETS AWSNativeSDK PACKAGE_HASH 9d163696591a836881fc22dac3c94e57b0278771b6c6cec807ff6a5e96f2669d) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev5-android TARGETS AWSNativeSDK PACKAGE_HASH f90aac69ea5703c1e0ad7ee893cdd5a030a8a376ba527334268ae3679761e6ea) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-android TARGETS Lua PACKAGE_HASH 1f638e94a17a87fe9e588ea456d5893876094b4db191234380e4c4eb9e06c300) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-android TARGETS PhysX PACKAGE_HASH b8cb6aa46b2a21671f6cb1f6a78713a3ba88824d0447560ff5ce6c01014b9f43) ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-android TARGETS mikkelsen PACKAGE_HASH 075e8e4940884971063b5a9963014e2e517246fa269c07c7dc55b8cf2cd99705) From 436d9734d2e269890aad996fccef62708359c87e Mon Sep 17 00:00:00 2001 From: pereslav Date: Fri, 2 Jul 2021 18:06:39 +0100 Subject: [PATCH 037/156] Fixed clang build error Signed-off-by: pereslav --- .../AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp | 3 +++ .../AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index 65e4c14276..3ee376264a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -223,4 +223,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } + // Explicit specializations of SortEntitiesByTransformHierarchy (have to be in cpp due to clang errors) + template void SortEntitiesByTransformHierarchy(AZStd::vector& entities); + template void SortEntitiesByTransformHierarchy(AZStd::vector>& entities); } // namespace AzToolsFramework::Prefab::SpawnableUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index f46c94d4ec..02aabfe55e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -20,7 +20,4 @@ namespace AzToolsFramework::Prefab::SpawnableUtils template void SortEntitiesByTransformHierarchy(AZStd::vector& entities); - // Explicit specializations - template void SortEntitiesByTransformHierarchy(AZStd::vector& entities); - template void SortEntitiesByTransformHierarchy(AZStd::vector>& entities); } // namespace AzToolsFramework::Prefab::SpawnableUtils From 9f2b31e07796d37f2821e95c5ac64ecc64db7879 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Fri, 2 Jul 2021 11:12:45 -0700 Subject: [PATCH 038/156] [LYN-4915] [iOS] [Android] awscoreconfiguration.setreg, awsMetricsClientConfigurationsetreg and authenticationProvider.setreg couldn't be loaded when the application starts (#1716) [LYN-4915] [iOS] [Android] awscoreconfiguration.setreg, awsMetricsClientConfiguration.setreg and authenticationProvider.setreg couldn't be loaded when the application starts --- .../PasswordSignIn.scriptcanvas | 3231 ++++++++--------- .../AWSCognitoAuthenticationProvider.h | 2 +- .../AuthenticationProviderInterface.h | 3 +- .../AuthenticationProviderManager.h | 6 +- .../AuthenticationProviderScriptCanvasBus.h | 3 +- .../GoogleAuthenticationProvider.h | 2 +- .../LWAAuthenticationProvider.h | 2 +- .../AuthenticationProviderBus.h | 3 +- .../AWSCognitoAuthenticationProvider.cpp | 3 +- .../AuthenticationProviderManager.cpp | 25 +- .../GoogleAuthenticationProvider.cpp | 11 +- .../LWAAuthenticationProvider.cpp | 11 +- .../Code/Tests/AWSClientAuthGemMock.h | 13 +- .../AWSCognitoAuthenticationProviderTest.cpp | 6 +- ...tionProviderManagerScriptCanvasBusTest.cpp | 35 +- .../AuthenticationProviderManagerTest.cpp | 35 +- .../GoogleAuthenticationProviderTest.cpp | 13 +- .../LWAAuthenticationProviderTest.cpp | 13 +- .../Configuration/AWSCoreConfiguration.h | 9 +- .../Configuration/AWSCoreConfiguration.cpp | 63 +- .../AWSResourceMappingManager.cpp | 2 +- .../Code/Tests/AWSCoreSystemComponentTest.cpp | 3 + .../AWSCoreConfigurationTest.cpp | 21 +- .../AWSCoreAttributionManagerTest.cpp | 9 - .../AWSCoreAttributionSystemComponentTest.cpp | 7 - .../AWSResourceMappingManagerTest.cpp | 8 +- .../Code/Tests/TestFramework/AWSCoreFixture.h | 10 + .../Include/Private/ClientConfiguration.h | 10 +- .../Code/Include/Private/MetricsManager.h | 3 +- .../Code/Source/AWSMetricsSystemComponent.cpp | 6 +- .../Code/Source/ClientConfiguration.cpp | 33 +- .../AWSMetrics/Code/Source/MetricsManager.cpp | 4 +- .../AWSMetrics/Code/Tests/AWSMetricsGemMock.h | 6 +- .../Code/Tests/MetricsManagerTest.cpp | 19 +- .../awsMetricsClientConfiguration.setreg | 0 35 files changed, 1787 insertions(+), 1843 deletions(-) rename Gems/AWSMetrics/{Code => }/Registry/awsMetricsClientConfiguration.setreg (100%) diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas index ffc3064084..1a135f3e2c 100644 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/PasswordSignIn.scriptcanvas @@ -3,7 +3,7 @@ - + @@ -16,21 +16,21 @@ - + - + - + @@ -68,7 +68,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -220,7 +220,7 @@ - + @@ -229,12 +229,55 @@ + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -258,7 +301,7 @@ - + @@ -268,7 +311,7 @@ - + @@ -296,7 +339,7 @@ - + @@ -306,10 +349,10 @@ - + - + @@ -334,7 +377,7 @@ - + @@ -344,7 +387,7 @@ - + @@ -369,28 +412,43 @@ - + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -399,22 +457,22 @@ - + - + - + - + - + @@ -422,9 +480,9 @@ - + - + @@ -434,7 +492,7 @@ - + @@ -852,21 +910,127 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -904,7 +1068,7 @@ - + @@ -942,7 +1106,7 @@ - + @@ -980,7 +1144,7 @@ - + @@ -1018,7 +1182,7 @@ - + @@ -1056,7 +1220,7 @@ - + @@ -1094,7 +1258,7 @@ - + @@ -1132,7 +1296,7 @@ - + @@ -1170,7 +1334,7 @@ - + @@ -1208,7 +1372,7 @@ - + @@ -1246,7 +1410,7 @@ - + @@ -1284,7 +1448,7 @@ - + @@ -1322,7 +1486,7 @@ - + @@ -1360,7 +1524,7 @@ - + @@ -1398,7 +1562,7 @@ - + @@ -1436,7 +1600,7 @@ - + @@ -1474,7 +1638,7 @@ - + @@ -1512,7 +1676,7 @@ - + @@ -1550,7 +1714,7 @@ - + @@ -1588,7 +1752,7 @@ - + @@ -1626,7 +1790,7 @@ - + @@ -1664,7 +1828,7 @@ - + @@ -1702,7 +1866,7 @@ - + @@ -1740,7 +1904,7 @@ - + @@ -1778,7 +1942,7 @@ - + @@ -1816,7 +1980,7 @@ - + @@ -1854,7 +2018,7 @@ - + @@ -1892,7 +2056,7 @@ - + @@ -1930,7 +2094,7 @@ - + @@ -1968,7 +2132,7 @@ - + @@ -2017,20 +2181,20 @@ - + - + - + - + @@ -2047,14 +2211,14 @@ - + - + @@ -2071,14 +2235,14 @@ - + - + @@ -2095,14 +2259,14 @@ - + - + @@ -2119,14 +2283,14 @@ - + - + @@ -2143,14 +2307,14 @@ - + - + @@ -2167,14 +2331,14 @@ - + - + @@ -2191,14 +2355,14 @@ - + - + @@ -2215,7 +2379,7 @@ - + @@ -2235,14 +2399,14 @@ - + - + @@ -2259,14 +2423,14 @@ - + - + @@ -2283,14 +2447,14 @@ - + - + @@ -2310,107 +2474,21 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2448,7 +2526,7 @@ - + @@ -2486,7 +2564,7 @@ - + @@ -2521,49 +2599,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -2571,59 +2619,233 @@ - + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2633,8 +2855,8 @@ - - + + @@ -2643,7 +2865,7 @@ - + @@ -2661,7 +2883,7 @@ - + @@ -2671,66 +2893,35 @@ - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2740,84 +2931,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -2844,7 +2959,7 @@ - + @@ -2882,7 +2997,7 @@ - + @@ -2920,50 +3035,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2973,11 +3045,11 @@ - + - - + + @@ -3001,7 +3073,7 @@ - + @@ -3011,7 +3083,7 @@ - + @@ -3039,7 +3111,7 @@ - + @@ -3049,10 +3121,10 @@ - + - + @@ -3077,7 +3149,7 @@ - + @@ -3087,7 +3159,7 @@ - + @@ -3112,43 +3184,28 @@ - - - - - - - - - - - - - - - - + - + - + - + - + - + @@ -3157,22 +3214,22 @@ - + - + - + - + - + @@ -3180,9 +3237,9 @@ - + - + @@ -3192,21 +3249,21 @@ - + - + - + - + - + @@ -3215,9 +3272,14 @@ + + + + + - - + + @@ -3227,16 +3289,16 @@ - + - - + + - + @@ -3244,7 +3306,7 @@ - + @@ -3254,8 +3316,8 @@ - - + + @@ -3282,7 +3344,7 @@ - + @@ -3292,8 +3354,8 @@ - - + + @@ -3320,7 +3382,7 @@ - + @@ -3330,10 +3392,10 @@ - - + + - + @@ -3341,62 +3403,73 @@ - + - + - - - - - + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3406,24 +3479,24 @@ - + - - + + - - + + - + @@ -3434,7 +3507,7 @@ - + @@ -3444,7 +3517,7 @@ - + @@ -3457,7 +3530,7 @@ - + @@ -3468,11 +3541,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3482,24 +3586,24 @@ - - + + - + - - + + - + @@ -3510,7 +3614,7 @@ - + @@ -3520,8 +3624,8 @@ - - + + @@ -3530,10 +3634,10 @@ - + - + @@ -3548,7 +3652,7 @@ - + @@ -3558,8 +3662,8 @@ - - + + @@ -3571,7 +3675,7 @@ - + @@ -3586,7 +3690,7 @@ - + @@ -3596,10 +3700,10 @@ - - + + - + @@ -3607,13 +3711,13 @@ - + - + @@ -3624,7 +3728,7 @@ - + @@ -3634,8 +3738,8 @@ - - + + @@ -3647,7 +3751,7 @@ - + @@ -3662,7 +3766,7 @@ - + @@ -3700,7 +3804,7 @@ - + @@ -3710,7 +3814,7 @@ - + @@ -3738,7 +3842,7 @@ - + @@ -3776,7 +3880,7 @@ - + @@ -3786,7 +3890,7 @@ - + @@ -3814,7 +3918,7 @@ - + @@ -3824,10 +3928,10 @@ - + - + @@ -3835,13 +3939,13 @@ - + - + - + @@ -3852,7 +3956,7 @@ - + @@ -3890,45 +3994,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3938,7 +4004,7 @@ - + @@ -3966,7 +4032,7 @@ - + @@ -3976,11 +4042,11 @@ - + - - + + @@ -4004,7 +4070,7 @@ - + @@ -4014,7 +4080,7 @@ - + @@ -4042,7 +4108,7 @@ - + @@ -4052,11 +4118,11 @@ - + - - + + @@ -4080,7 +4146,7 @@ - + @@ -4090,7 +4156,7 @@ - + @@ -4118,7 +4184,7 @@ - + @@ -4156,7 +4222,7 @@ - + @@ -4166,10 +4232,10 @@ - + - + @@ -4177,13 +4243,13 @@ - + - + - + @@ -4194,7 +4260,7 @@ - + @@ -4204,11 +4270,11 @@ - + - - + + @@ -4232,7 +4298,7 @@ - + @@ -4242,7 +4308,7 @@ - + @@ -4270,7 +4336,7 @@ - + @@ -4308,7 +4374,7 @@ - + @@ -4318,7 +4384,7 @@ - + @@ -4342,344 +4408,135 @@ - - - - - - - - - - - - - + + + + + - - + + + + + + + - - + + + + + - - - - - - - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - + + + + + - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - + + + + + - - - - + + - - - - - - - - - - - - + + + - - + + + - + + + - - - - - - - - - - - - + - - - - + + + + + - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4689,14 +4546,14 @@ - - + + - + - + @@ -4707,7 +4564,7 @@ - + @@ -4716,23 +4573,18 @@ - - - - - - + - - + + - + @@ -4750,7 +4602,7 @@ - + @@ -4759,13 +4611,8 @@ - - - - - - + @@ -4775,14 +4622,14 @@ - - + + - + - + @@ -4793,7 +4640,7 @@ - + @@ -4803,24 +4650,24 @@ - + - + - - + + - + @@ -4831,7 +4678,7 @@ - + @@ -4841,7 +4688,7 @@ - + @@ -4854,7 +4701,7 @@ - + @@ -4866,162 +4713,306 @@ - - - - - - + + + + + + + + + + + + - - - + + - - - - - - - + + - - - + + + + + + + + + + - + + - - - - - + + + + + + + + + - - - + + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -5029,127 +5020,107 @@ - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5158,8 +5129,13 @@ + + + + + - + @@ -5170,13 +5146,13 @@ - + - + @@ -5187,7 +5163,7 @@ - + @@ -5197,7 +5173,7 @@ - + @@ -5207,7 +5183,7 @@ - + @@ -5225,7 +5201,7 @@ - + @@ -5235,10 +5211,10 @@ - + - + @@ -5246,13 +5222,13 @@ - + - + @@ -5260,19 +5236,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + @@ -5280,21 +5293,21 @@ - + - + - + - + @@ -5332,7 +5345,7 @@ - + @@ -5366,126 +5379,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + - + @@ -5493,7 +5438,7 @@ - + @@ -5501,14 +5446,14 @@ - + - + @@ -5546,7 +5491,7 @@ - + @@ -5584,11 +5529,11 @@ - + - + @@ -5601,28 +5546,28 @@ - + - + - + - + - + - + - + @@ -5632,28 +5577,28 @@ - + - + - + - + - + - + - + @@ -5663,28 +5608,28 @@ - + - + - + - + - + - + - + @@ -5694,28 +5639,28 @@ - + - + - + - + - + - + - + @@ -5725,28 +5670,28 @@ - + - + - + - + - + - + - + @@ -5756,28 +5701,28 @@ - + - + - + - + - + - + - + @@ -5787,28 +5732,28 @@ - + - + - + - + - + - + - + @@ -5818,28 +5763,28 @@ - + - + - + - + - + - + - + @@ -5849,28 +5794,28 @@ - + - + - + - + - + - + - + @@ -5886,7 +5831,7 @@ - + @@ -5894,49 +5839,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5947,7 +5850,7 @@ - + @@ -5955,14 +5858,14 @@ - + - + @@ -5983,7 +5886,7 @@ - + @@ -5994,7 +5897,7 @@ - + @@ -6002,14 +5905,14 @@ - + - + @@ -6030,28 +5933,7 @@ - - - - - - - - - - - - - - - - - - - - - - + @@ -6059,27 +5941,21 @@ - + - + - - - - - - - + @@ -6088,51 +5964,52 @@ + + + + + + - + - - - - - - - - + + - + - - + + - + - - + + - - - - - - + - + + + + + + + @@ -6140,41 +6017,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6182,41 +6059,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6224,16 +6101,10 @@ - + - - - - - - @@ -6244,21 +6115,32 @@ - + - - + + - + - - + + - + + + + + + + + + + + + @@ -6266,7 +6148,7 @@ - + @@ -6287,7 +6169,7 @@ - + @@ -6297,7 +6179,7 @@ - + @@ -6305,7 +6187,7 @@ - + @@ -6313,20 +6195,22 @@ - + - - - + + + + - - - + + + + @@ -6337,17 +6221,62 @@ - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - + + + + + + + + + + + + + + @@ -6355,7 +6284,7 @@ - + @@ -6363,33 +6292,33 @@ - + - + - + - - - + + + - - - + + + @@ -6397,10 +6326,16 @@ - + + + + + + + @@ -6415,28 +6350,17 @@ - - + + - + - - + + - - - - - - - - - - - - + @@ -6444,41 +6368,41 @@ - + - - - + + + + - - - + + + + - + - - - - + + + - - - - + + + @@ -6486,41 +6410,62 @@ - + - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -6531,15 +6476,7 @@ - - - - - - - - - + @@ -6551,13 +6488,17 @@ - + + + + + @@ -6567,11 +6508,15 @@ - + + + + + - + diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h index 0d3696f3d5..cdd551cbed 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AWSCognitoAuthenticationProvider.h @@ -22,7 +22,7 @@ namespace AWSClientAuth virtual ~AWSCognitoAuthenticationProvider() = default; // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h index 9cba2227b1..c8addc6ff6 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderInterface.h @@ -22,9 +22,8 @@ namespace AWSClientAuth virtual ~AuthenticationProviderInterface() = default; //! Extract required settings for the provider from setting registry. - //! @param settingsRegistry Passed in initialized settings registry object. //! @return bool True: if provider can parse required settings and validate. False: fails to parse required settings. - virtual bool Initialize(AZStd::weak_ptr settingsRegistry) = 0; + virtual bool Initialize() = 0; //! Call sign in endpoint for provider password grant flow. //! @param username Username to use to for sign in. diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h index d4cb66b1a4..5ccc670d47 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderManager.h @@ -29,7 +29,7 @@ namespace AWSClientAuth protected: // AuthenticationProviderRequestsBus Interface - bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) override; + bool Initialize(const AZStd::vector& providerNames) override; void PasswordGrantSingleFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const ProviderNameEnum& providerName, const AZStd::string& username, const AZStd::string& confirmationCode) override; @@ -42,7 +42,7 @@ namespace AWSClientAuth AuthenticationTokens GetAuthenticationTokens(const ProviderNameEnum& providerName) override; // AuthenticationProviderScriptCanvasRequest interface - bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) override; + bool Initialize(const AZStd::vector& providerNames) override; void PasswordGrantSingleFactorSignInAsync( const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync( @@ -64,8 +64,6 @@ namespace AWSClientAuth bool IsProviderInitialized(const ProviderNameEnum& providerName); void ResetProviders(); ProviderNameEnum GetProviderNameEnum(AZStd::string name); - - AZStd::shared_ptr m_settingsRegistry; }; } // namespace AWSClientAuth diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h index 17a3907846..ccbf3e0466 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/AuthenticationProviderScriptCanvasBus.h @@ -20,9 +20,8 @@ namespace AWSClientAuth //! Parse the settings file for required settings for authentication providers. Instantiate and initialize authentication providers //! @param providerNames List of provider names to instantiate and initialize for Authentication. - //! @param settingsRegistryPath Path for the settings registry file to use to configure providers. //! @return bool True: if all providers initialized successfully. False: If any provider fails initialization. - virtual bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) = 0; + virtual bool Initialize(const AZStd::vector& providerNames) = 0; //! Checks if user is signed in. //! If access tokens are available and not expired. diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h index 292cf2e80a..d5616213b3 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/GoogleAuthenticationProvider.h @@ -21,7 +21,7 @@ namespace AWSClientAuth virtual ~GoogleAuthenticationProvider(); // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h b/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h index 8a4d68f67e..9e12cf5810 100644 --- a/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h +++ b/Gems/AWSClientAuth/Code/Include/Private/Authentication/LWAAuthenticationProvider.h @@ -21,7 +21,7 @@ namespace AWSClientAuth virtual ~LWAAuthenticationProvider(); // AuthenticationProviderInterface overrides - bool Initialize(AZStd::weak_ptr settingsRegistry) override; + bool Initialize() override; void PasswordGrantSingleFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorSignInAsync(const AZStd::string& username, const AZStd::string& password) override; void PasswordGrantMultiFactorConfirmSignInAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override; diff --git a/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h b/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h index d11588ad55..d9b37b06db 100644 --- a/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h +++ b/Gems/AWSClientAuth/Code/Include/Public/Authentication/AuthenticationProviderBus.h @@ -19,9 +19,8 @@ namespace AWSClientAuth //! Parse the settings file for required settings for authentication providers. Instantiate and initialize authentication providers //! @param providerNames List of provider names to instantiate and initialize for Authentication. - //! @param settingsRegistryPath Path for the settings registry file to use to configure providers. //! @return bool True: if all providers initialized successfully. False: If any provider fails initialization. - virtual bool Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) = 0; + virtual bool Initialize(const AZStd::vector& providerNames) = 0; //! Checks if user is signed in. //! If access tokens are available and not expired. diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp index 482c9b1d9e..7f00e93f51 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/AWSCognitoAuthenticationProvider.cpp @@ -30,9 +30,8 @@ namespace AWSClientAuth constexpr char CognitoRefreshTokenAuthParamKey[] = "REFRESH_TOKEN"; constexpr char CognitoSmsMfaCodeKey[] = "SMS_MFA_CODE"; - bool AWSCognitoAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool AWSCognitoAuthenticationProvider::Initialize() { - AZ_UNUSED(settingsRegistry); AWSCore::AWSResourceMappingRequestBus::BroadcastResult( m_cognitoAppClientId, &AWSCore::AWSResourceMappingRequests::GetResourceNameId, CognitoAppClientIdResourceMappingKey); AZ_Warning("AWSCognitoAuthenticationProvider", !m_cognitoAppClientId.empty(), "Missing Cognito App Client Id from resource mappings. Calls to Cognito will fail."); diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp index 75f70932f1..a4fb232648 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/AuthenticationProviderManager.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include @@ -27,37 +26,21 @@ namespace AWSClientAuth AuthenticationProviderManager::~AuthenticationProviderManager() { ResetProviders(); - m_settingsRegistry.reset(); AuthenticationProviderScriptCanvasRequestBus::Handler::BusDisconnect(); AuthenticationProviderRequestBus::Handler::BusDisconnect(); AZ::Interface::Unregister(this); } - bool AuthenticationProviderManager::Initialize(const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) + bool AuthenticationProviderManager::Initialize(const AZStd::vector& providerNames) { ResetProviders(); - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - AZ_Assert(fileIO, "File IO is not initialized."); - - m_settingsRegistry.reset(); - m_settingsRegistry = AZStd::make_shared(); - - AZStd::array resolvedPath{}; - fileIO->ResolvePath(settingsRegistryPath.data(), resolvedPath.data(), resolvedPath.size()); - - - if (!m_settingsRegistry->MergeSettingsFile(resolvedPath.data(), AZ::SettingsRegistryInterface::Format::JsonMergePatch)) - { - AZ_Error("AuthenticationProviderManager", false, "Error merging settings registry for path: %s", resolvedPath.data()); - return false; - } bool initializeSuccess = true; for (auto providerName : providerNames) { m_authenticationProvidersMap[providerName] = CreateAuthenticationProviderObject(providerName); - initializeSuccess = initializeSuccess && m_authenticationProvidersMap[providerName]->Initialize(m_settingsRegistry); + initializeSuccess = initializeSuccess && m_authenticationProvidersMap[providerName]->Initialize(); } return initializeSuccess; @@ -199,14 +182,14 @@ namespace AWSClientAuth } bool AuthenticationProviderManager::Initialize( - const AZStd::vector& providerNames, const AZStd::string& settingsRegistryPath) + const AZStd::vector& providerNames) { AZStd::vector providerNamesEnum; for (auto name : providerNames) { providerNamesEnum.push_back(GetProviderNameEnum(name)); } - return Initialize(providerNamesEnum, settingsRegistryPath); + return Initialize(providerNamesEnum); } void AuthenticationProviderManager::PasswordGrantSingleFactorSignInAsync(const AZStd::string& providerName, const AZStd::string& username, const AZStd::string& password) diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp index 3d180b17db..3d6e351017 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/GoogleAuthenticationProvider.cpp @@ -30,9 +30,16 @@ namespace AWSClientAuth m_settings.reset(); } - bool GoogleAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool GoogleAuthenticationProvider::Initialize() { - if (!settingsRegistry.lock()->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to load the setting registry"); + return false; + } + + if (!settingsRegistry->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath)) { AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to get Google settings object for path %s", GoogleSettingsPath); return false; diff --git a/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp b/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp index b8028ff769..f5628b3734 100644 --- a/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp +++ b/Gems/AWSClientAuth/Code/Source/Authentication/LWAAuthenticationProvider.cpp @@ -29,9 +29,16 @@ namespace AWSClientAuth m_settings.reset(); } - bool LWAAuthenticationProvider::Initialize(AZStd::weak_ptr settingsRegistry) + bool LWAAuthenticationProvider::Initialize() { - if (!settingsRegistry.lock()->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), LwaSettingsPath)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to load the setting registry"); + return false; + } + + if (!settingsRegistry->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), LwaSettingsPath)) { AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to get login with Amazon settings object for path %s", LwaSettingsPath); return false; diff --git a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h index eef29e2cb5..cf6364fa00 100644 --- a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h +++ b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h @@ -351,12 +351,12 @@ namespace AWSClientAuthUnitTest AuthenticationProviderMock() { - ON_CALL(*this, Initialize(testing::_)).WillByDefault(testing::Return(true)); + ON_CALL(*this, Initialize()).WillByDefault(testing::Return(true)); } virtual ~AuthenticationProviderMock() = default; - MOCK_METHOD1(Initialize, bool(AZStd::weak_ptr settingsRegistry)); + MOCK_METHOD0(Initialize, bool()); MOCK_METHOD2(PasswordGrantSingleFactorSignInAsync, void(const AZStd::string& username, const AZStd::string& password)); MOCK_METHOD2(PasswordGrantMultiFactorSignInAsync, void(const AZStd::string& username, const AZStd::string& password)); MOCK_METHOD2(PasswordGrantMultiFactorConfirmSignInAsync, void(const AZStd::string& username, const AZStd::string& confirmationCode)); @@ -495,6 +495,8 @@ namespace AWSClientAuthUnitTest m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + AZ::ComponentApplicationBus::Handler::BusConnect(); AZ::Interface::Register(this); @@ -555,6 +557,8 @@ namespace AWSClientAuthUnitTest AWSClientAuth::AWSClientAuthRequestBus::Handler::BusDisconnect(); } + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_testFolder.reset(); m_settingsRegistry.reset(); m_serializeContext.reset(); @@ -660,8 +664,5 @@ namespace AWSClientAuthUnitTest m_testFolderCreated = true; return path; } - - }; - - + }; } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp index 328f77b28f..99a8c867d7 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AWSCognitoAuthenticationProviderTest.cpp @@ -31,7 +31,7 @@ class AWSCognitoAuthenticationProviderTest { AWSClientAuthUnitTest::AWSClientAuthGemAllocatorFixture::SetUp(); - m_cognitoAuthenticationProviderMock.Initialize(m_settingsRegistry); + m_cognitoAuthenticationProviderMock.Initialize(); AWSCore::AWSCoreRequestBus::Handler::BusConnect(); @@ -98,7 +98,7 @@ TEST_F(AWSCognitoAuthenticationProviderTest, Initialize_Success) { EXPECT_CALL(m_awsResourceMappingRequestBusMock, GetResourceNameId(testing::_)).Times(1); AWSClientAuthUnitTest::AWSCognitoAuthenticationProviderrLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_cognitoAppClientId, AWSClientAuthUnitTest::TEST_RESOURCE_NAME_ID); } @@ -260,5 +260,5 @@ TEST_F(AWSCognitoAuthenticationProviderTest, Initialize_Fail_EmptyResourceName) { AWSClientAuthUnitTest::AWSCognitoAuthenticationProviderrLocalMock mock; EXPECT_CALL(m_awsResourceMappingRequestBusMock, GetResourceNameId(testing::_)).Times(1).WillOnce(testing::Return("")); - ASSERT_FALSE(mock.Initialize(m_settingsRegistry)); + ASSERT_FALSE(mock.Initialize()); } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp index fb233aeb5d..736b0a299d 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerScriptCanvasBusTest.cpp @@ -28,7 +28,8 @@ protected: AWSClientAuth::LWAProviderSetting::Reflect(*m_serializeContext); AWSClientAuth::GoogleProviderSetting::Reflect(*m_serializeContext); - m_settingspath = AZStd::string::format("%s/%s/authenticationProvider.setreg", + AZStd::string settingspath = AZStd::string::format( + "%s/%s/authenticationProvider.setreg", m_testFolder->c_str(), AZ::SettingsRegistryInterface::RegistryFolder); CreateTestFile("authenticationProvider.setreg" , R"({ @@ -54,6 +55,7 @@ protected: } } })"); + m_settingsRegistry->MergeSettingsFile(settingspath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_mockController = AZStd::make_unique>(); } @@ -66,20 +68,19 @@ protected: public: AZStd::unique_ptr> m_mockController; - AZStd::string m_settingspath; AZStd::vector m_enabledProviderNames { AWSClientAuth::ProvideNameEnumStringAWSCognitoIDP, AWSClientAuth::ProvideNameEnumStringLoginWithAmazon, AWSClientAuth::ProvideNameEnumStringGoogle}; }; TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Success) { - ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames, m_settingspath)); + ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames)); ASSERT_TRUE(m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP] != nullptr); } TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); EXPECT_CALL(*cognitoProviderMock, PasswordGrantSingleFactorSignInAsync(testing::_, testing::_)).Times(1); @@ -96,7 +97,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantSingleFactorS TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -111,7 +112,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorSi TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -126,7 +127,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, PasswordGrantMultiFactorCo TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -142,7 +143,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantSignInAsync TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -157,7 +158,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, DeviceCodeGrantConfirmSign TEST_F(AuthenticationProviderManagerScriptCanvasTest, RefreshTokenAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -172,7 +173,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, RefreshTokenAsync_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ValidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -188,7 +189,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_InvalidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens; EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens)); @@ -209,7 +210,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokensWithRefreshAsync_ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokens_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -224,7 +225,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, GetTokens_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, IsSignedIn_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -238,7 +239,7 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, IsSignedIn_Success) TEST_F(AuthenticationProviderManagerScriptCanvasTest, SignOut_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* googleProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::Google].get(); EXPECT_CALL(*googleProviderMock, SignOut()).Times(1); @@ -248,9 +249,3 @@ TEST_F(AuthenticationProviderManagerScriptCanvasTest, SignOut_Success) googleProviderMock = nullptr; } -TEST_F(AuthenticationProviderManagerScriptCanvasTest, Initialize_Fail_InvalidPath) -{ - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_mockController->Initialize(m_enabledProviderNames, "")); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); -} diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp index 362efaf025..747ea1efda 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/AuthenticationProviderManagerTest.cpp @@ -27,7 +27,8 @@ protected: AWSClientAuth::LWAProviderSetting::Reflect(*m_serializeContext); AWSClientAuth::GoogleProviderSetting::Reflect(*m_serializeContext); - m_settingspath = AZStd::string::format("%s/%s/authenticationProvider.setreg", + AZStd::string settingspath = AZStd::string::format( + "%s/%s/authenticationProvider.setreg", m_testFolder->c_str(), AZ::SettingsRegistryInterface::RegistryFolder); CreateTestFile("authenticationProvider.setreg" , R"({ @@ -53,6 +54,7 @@ protected: } } })"); + m_settingsRegistry->MergeSettingsFile(settingspath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_mockController = AZStd::make_unique>(); } @@ -65,20 +67,19 @@ protected: public: AZStd::unique_ptr> m_mockController; - AZStd::string m_settingspath; AZStd::vector m_enabledProviderNames {AWSClientAuth::ProviderNameEnum::AWSCognitoIDP, AWSClientAuth::ProviderNameEnum::LoginWithAmazon, AWSClientAuth::ProviderNameEnum::Google}; }; TEST_F(AuthenticationProviderManagerTest, Initialize_Success) { - ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames, m_settingspath)); + ASSERT_TRUE(m_mockController->Initialize(m_enabledProviderNames)); ASSERT_TRUE(m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP] != nullptr); } TEST_F(AuthenticationProviderManagerTest, PasswordGrantSingleFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); EXPECT_CALL(*cognitoProviderMock, PasswordGrantSingleFactorSignInAsync(testing::_, testing::_)).Times(1); @@ -95,7 +96,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantSingleFactorSignInAsync_F TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -110,7 +111,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorSignInAsync_Su TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -125,7 +126,7 @@ TEST_F(AuthenticationProviderManagerTest, PasswordGrantMultiFactorConfirmSignInA TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -141,7 +142,7 @@ TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantSignInAsync_Success) TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantConfirmSignInAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock* lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -156,7 +157,7 @@ TEST_F(AuthenticationProviderManagerTest, DeviceCodeGrantConfirmSignInAsync_Succ TEST_F(AuthenticationProviderManagerTest, RefreshTokenAsync_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock *cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); testing::NiceMock *lwaProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::LoginWithAmazon].get(); @@ -171,7 +172,7 @@ TEST_F(AuthenticationProviderManagerTest, RefreshTokenAsync_Success) TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_ValidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -187,7 +188,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_ValidToken_S TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_InvalidToken_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens; EXPECT_CALL(*cognitoProviderMock, GetAuthenticationTokens()).Times(1).WillOnce(testing::Return(tokens)); @@ -208,7 +209,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokensWithRefreshAsync_NotInitializ TEST_F(AuthenticationProviderManagerTest, GetTokens_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -223,7 +224,7 @@ TEST_F(AuthenticationProviderManagerTest, GetTokens_Success) TEST_F(AuthenticationProviderManagerTest, IsSignedIn_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* cognitoProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::AWSCognitoIDP].get(); AWSClientAuth::AuthenticationTokens tokens( @@ -237,7 +238,7 @@ TEST_F(AuthenticationProviderManagerTest, IsSignedIn_Success) TEST_F(AuthenticationProviderManagerTest, SignOut_Success) { - m_mockController->Initialize(m_enabledProviderNames, m_settingspath); + m_mockController->Initialize(m_enabledProviderNames); testing::NiceMock* googleProviderMock = (testing::NiceMock*)m_mockController->m_authenticationProvidersMap[AWSClientAuth::ProviderNameEnum::Google].get(); EXPECT_CALL(*googleProviderMock, SignOut()).Times(1); @@ -247,9 +248,3 @@ TEST_F(AuthenticationProviderManagerTest, SignOut_Success) googleProviderMock = nullptr; } -TEST_F(AuthenticationProviderManagerTest, Initialize_Fail_InvalidPath) -{ - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_mockController->Initialize(m_enabledProviderNames, "")); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); -} diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp index f8b8399118..06aa7eeec8 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/GoogleAuthenticationProviderTest.cpp @@ -47,7 +47,7 @@ class GoogleAuthenticationProviderTest })"); m_settingsRegistry->MergeSettingsFile(path, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); - m_googleAuthenticationProviderLocalMock.Initialize(m_settingsRegistry); + m_googleAuthenticationProviderLocalMock.Initialize(); } void TearDown() override @@ -63,7 +63,7 @@ public: TEST_F(GoogleAuthenticationProviderTest, Initialize_Success) { AWSClientAuthUnitTest::GoogleAuthenticationProviderLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, "TestGoogleClientId"); } @@ -117,14 +117,19 @@ TEST_F(GoogleAuthenticationProviderTest, RefreshTokensAsync_Fail_RequestHttpErro TEST_F(GoogleAuthenticationProviderTest, Initialize_Fail_EmptyRegistry) { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + AZStd::shared_ptr registry = AZStd::make_shared(); registry->SetContext(m_serializeContext.get()); + AZ::SettingsRegistry::Register(registry.get()); AWSClientAuthUnitTest::GoogleAuthenticationProviderLocalMock mock; - ASSERT_FALSE(mock.Initialize(registry)); + ASSERT_FALSE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, ""); + AZ::SettingsRegistry::Unregister(registry.get()); registry.reset(); // Restore - mock.Initialize(m_settingsRegistry); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + mock.Initialize(); } diff --git a/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp index cbbec30cb7..21f23bf627 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authentication/LWAAuthenticationProviderTest.cpp @@ -47,7 +47,7 @@ class LWAAuthenticationProviderTest })"); m_settingsRegistry->MergeSettingsFile(path, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); - m_lwaAuthenticationProviderLocalMock.Initialize(m_settingsRegistry); + m_lwaAuthenticationProviderLocalMock.Initialize(); } void TearDown() override @@ -63,7 +63,7 @@ public: TEST_F(LWAAuthenticationProviderTest, Initialize_Success) { AWSClientAuthUnitTest::LWAAuthenticationProviderLocalMock mock; - ASSERT_TRUE(mock.Initialize(m_settingsRegistry)); + ASSERT_TRUE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, "TestLWAClientId"); } @@ -117,14 +117,19 @@ TEST_F(LWAAuthenticationProviderTest, RefreshTokensAsync_Fail_RequestHttpError) TEST_F(LWAAuthenticationProviderTest, Initialize_Fail_EmptyRegistry) { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + AZStd::shared_ptr registry = AZStd::make_shared(); registry->SetContext(m_serializeContext.get()); + AZ::SettingsRegistry::Register(registry.get()); AWSClientAuthUnitTest::LWAAuthenticationProviderLocalMock mock; - ASSERT_FALSE(mock.Initialize(registry)); + ASSERT_FALSE(mock.Initialize()); ASSERT_EQ(mock.m_settings->m_appClientId, ""); + AZ::SettingsRegistry::Unregister(registry.get()); registry.reset(); // Restore - mock.Initialize(m_settingsRegistry); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); + mock.Initialize(); } diff --git a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h index 42b828f450..14c4da33ba 100644 --- a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h +++ b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include @@ -35,8 +34,10 @@ namespace AWSCore "Failed to get profile name, return default value instead."; static constexpr const char ResourceMappingFileNameNotFoundErrorMessage[] = "Failed to get resource mapping config file name, return empty value instead."; - static constexpr const char SettingsRegistryLoadFailureErrorMessage[] = + static constexpr const char SettingsRegistryFileLoadFailureErrorMessage[] = "Failed to load AWSCore settings registry file."; + static constexpr const char GlobalSettingsRegistryLoadFailureErrorMessage[] = + "Failed to load AWSCore configurations from global settings registry."; AWSCoreConfiguration(); @@ -53,9 +54,6 @@ namespace AWSCore void ReloadConfiguration() override; private: - // Initialize settings registry reference by loading for project .setreg file - void InitSettingsRegistry(); - // Initialize source project folder path void InitSourceProjectFolderPath(); @@ -66,7 +64,6 @@ namespace AWSCore void ResetSettingsRegistryData(); AZStd::string m_sourceProjectFolder; - AZ::SettingsRegistryImpl m_settingsRegistry; AZStd::string m_profileName; AZStd::string m_resourceMappingConfigFileName; }; diff --git a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp index c6863e6f3d..4b5ce59517 100644 --- a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp +++ b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp @@ -6,6 +6,8 @@ */ #include +#include +#include #include #include @@ -69,27 +71,6 @@ namespace AWSCore void AWSCoreConfiguration::InitConfig() { InitSourceProjectFolderPath(); - InitSettingsRegistry(); - } - - void AWSCoreConfiguration::InitSettingsRegistry() - { - if (m_sourceProjectFolder.empty()) - { - AZ_Warning(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage); - return; - } - - AZStd::string settingsRegistryPath = AZStd::string::format("%s/%s/%s", - m_sourceProjectFolder.c_str(), AZ::SettingsRegistryInterface::RegistryFolder, AWSCoreConfiguration::AWSCoreConfigurationFileName); - AzFramework::StringFunc::Path::Normalize(settingsRegistryPath); - - if (!m_settingsRegistry.MergeSettingsFile(settingsRegistryPath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, "")) - { - AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryLoadFailureErrorMessage); - return; - } - ParseSettingsRegistryValues(); } @@ -108,10 +89,17 @@ namespace AWSCore void AWSCoreConfiguration::ParseSettingsRegistryValues() { + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning(AWSCoreConfigurationName, false, GlobalSettingsRegistryLoadFailureErrorMessage); + return; + } + m_resourceMappingConfigFileName.clear(); auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey); - if (!m_settingsRegistry.Get(m_resourceMappingConfigFileName, resourceMappingConfigFileNamePath)) + if (!settingsRegistry->Get(m_resourceMappingConfigFileName, resourceMappingConfigFileNamePath)) { AZ_Warning(AWSCoreConfigurationName, false, ResourceMappingFileNameNotFoundErrorMessage); } @@ -119,7 +107,7 @@ namespace AWSCore m_profileName.clear(); auto profileNamePath = AZStd::string::format( "%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey); - if (!m_settingsRegistry.Get(m_profileName, profileNamePath)) + if (!settingsRegistry->Get(m_profileName, profileNamePath)) { AZ_Warning(AWSCoreConfigurationName, false, ProfileNameNotFoundErrorMessage); m_profileName = AWSCoreDefaultProfileName; @@ -128,20 +116,43 @@ namespace AWSCore void AWSCoreConfiguration::ResetSettingsRegistryData() { + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) + { + AZ_Warning(AWSCoreConfigurationName, false, GlobalSettingsRegistryLoadFailureErrorMessage); + return; + } + auto profileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey); - m_settingsRegistry.Remove(profileNamePath); + settingsRegistry->Remove(profileNamePath); m_profileName = AWSCoreDefaultProfileName; auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey); - m_settingsRegistry.Remove(resourceMappingConfigFileNamePath); + settingsRegistry->Remove(resourceMappingConfigFileNamePath); m_resourceMappingConfigFileName.clear(); + + // Reload the AWSCore setting registry file from disk. + if (m_sourceProjectFolder.empty()) + { + AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryFileLoadFailureErrorMessage); + return; + } + + auto settingsRegistryPath = AZ::IO::FixedMaxPath(AZStd::string_view{ m_sourceProjectFolder }) / + AZ::SettingsRegistryInterface::RegistryFolder / + AWSCoreConfiguration::AWSCoreConfigurationFileName; + if (!settingsRegistry->MergeSettingsFile(settingsRegistryPath.c_str(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, "")) + { + AZ_Warning(AWSCoreConfigurationName, false, SettingsRegistryFileLoadFailureErrorMessage); + return; + } } void AWSCoreConfiguration::ReloadConfiguration() { ResetSettingsRegistryData(); - InitSettingsRegistry(); + ParseSettingsRegistryValues(); } } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp b/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp index 48e3ffad70..c58dba227b 100644 --- a/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp +++ b/Gems/AWSCore/Code/Source/ResourceMapping/AWSResourceMappingManager.cpp @@ -31,7 +31,7 @@ namespace AWSCore void AWSResourceMappingManager::ActivateManager() { - ReloadConfigFile(true); + ReloadConfigFile(); AWSResourceMappingRequestBus::Handler::BusConnect(); } diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index 52acd7d6f5..c9f7ebfcf7 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -67,10 +67,13 @@ protected: m_serializeContext = AZStd::make_unique(); m_serializeContext->CreateEditContext(); m_behaviorContext = AZStd::make_unique(); + m_componentDescriptor.reset(AWSCoreSystemComponent::CreateDescriptor()); m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); + m_settingsRegistry->SetContext(m_serializeContext.get()); + m_entity = aznew AZ::Entity(); m_coreSystemsComponent.reset(m_entity->CreateComponent()); } diff --git a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp index 371e264f56..be32acedf5 100644 --- a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp +++ b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp @@ -60,6 +60,8 @@ public: AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFolderPath); m_localFileIO->SetAlias("@devassets@", m_normalizedSourceProjectFolder.c_str()); + + CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); } void TearDown() override @@ -73,11 +75,11 @@ public: } AZStd::unique_ptr m_awsCoreConfiguration; + AZStd::string m_normalizedSetRegFilePath; private: AZStd::string m_normalizedSourceProjectFolder; AZStd::string m_normalizedSetRegFolderPath; - AZStd::string m_normalizedSetRegFilePath; void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) { @@ -118,17 +120,9 @@ private: TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@devassets@"); - AZ_TEST_START_TRACE_SUPPRESSION; - m_awsCoreConfiguration->InitConfig(); - AZ_TEST_STOP_TRACE_SUPPRESSION(1); // expect the above have thrown an AZ_Error - auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); - EXPECT_TRUE(actualConfigFilePath.empty()); -} - -TEST_F(AWSCoreConfigurationTest, InitConfig_NoSettingsRegistryFileFound_ReturnEmptyConfigFilePath) -{ AZ_TEST_START_TRACE_SUPPRESSION; m_awsCoreConfiguration->InitConfig(); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // expect the above have thrown an AZ_Error @@ -140,6 +134,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_NoSettingsRegistryFileFound_ReturnEm TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyConfigFilePath) { CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -148,7 +143,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyC TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -157,6 +152,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonE TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@devassets@"); m_awsCoreConfiguration->ReloadConfiguration(); @@ -167,6 +163,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAfterInvalidOne_ReturnNonEmptyConfigFilePath) { CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -185,7 +182,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistryAfterValidOne_ReturnEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp index 4128edc1e2..ca402b9edd 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -161,7 +160,6 @@ namespace AWSAttributionUnitTest protected: AZStd::shared_ptr m_serializeContext; AZStd::unique_ptr m_registrationContext; - AZStd::shared_ptr m_settingsRegistry; AZStd::unique_ptr m_jobContext; AZStd::unique_ptr m_jobCancelGroup; AZStd::unique_ptr m_jobManager; @@ -186,13 +184,9 @@ namespace AWSAttributionUnitTest AZ::JsonSystemComponent::Reflect(m_registrationContext.get()); - m_settingsRegistry = AZStd::make_unique(); - m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); - AZ::SettingsRegistry::Register(m_settingsRegistry.get()); - AZ::JobManagerDesc jobManagerDesc; AZ::JobManagerThreadDesc threadDesc; @@ -210,9 +204,6 @@ namespace AWSAttributionUnitTest m_jobCancelGroup.reset(); m_jobManager.reset(); - AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); - - m_settingsRegistry.reset(); m_serializeContext.reset(); m_registrationContext.reset(); diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp index eaae801776..a790ccf067 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionSystemComponentTest.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -87,13 +86,9 @@ namespace AWSCoreUnitTest m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); - m_settingsRegistry = AZStd::make_unique(); - m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); - AZ::SettingsRegistry::Register(m_settingsRegistry.get()); - m_entity = aznew AZ::Entity(); m_awsCoreSystemComponentMock = aznew testing::NiceMock(); m_entity->AddComponent(m_awsCoreSystemComponentMock); @@ -113,7 +108,6 @@ namespace AWSCoreUnitTest m_awsCoreComponentDescriptor.reset(); m_componentDescriptor.reset(); m_behaviorContext.reset(); - m_settingsRegistry.reset(); m_registrationContext.reset(); m_serializeContext.reset(); AWSCoreFixture::TearDown(); @@ -130,7 +124,6 @@ namespace AWSCoreUnitTest AZStd::unique_ptr m_registrationContext; AZStd::unique_ptr m_componentDescriptor; AZStd::unique_ptr m_awsCoreComponentDescriptor; - AZStd::shared_ptr m_settingsRegistry; }; TEST_F(AWSAttributionSystemComponentTest, SystemComponentInitActivate_Success) diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp index 424a5e2048..ca43724a1d 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp @@ -171,7 +171,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_Con AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_TRUE(actualAccountId.empty()); EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); @@ -186,7 +186,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_FALSE(actualAccountId.empty()); EXPECT_FALSE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Ready); @@ -413,7 +413,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter AZStd::string actualRegion; AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_TRUE(actualAccountId.empty()); EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); @@ -423,7 +423,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); AWSResourceMappingRequestBus::BroadcastResult(actualRegion, &AWSResourceMappingRequests::GetDefaultRegion); - EXPECT_EQ(m_reloadConfigurationCounter, 1); + EXPECT_EQ(m_reloadConfigurationCounter, 0); EXPECT_FALSE(actualAccountId.empty()); EXPECT_FALSE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Ready); diff --git a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h index 78d377711b..a6ebe9ab31 100644 --- a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h +++ b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -117,10 +118,16 @@ public: m_otherFileIO = AZ::IO::FileIOBase::GetInstance(); AZ::IO::FileIOBase::SetInstance(nullptr); AZ::IO::FileIOBase::SetInstance(m_localFileIO); + + m_settingsRegistry = AZStd::make_unique(); + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); } void TearDown() override { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_settingsRegistry.reset(); + AZ::IO::FileIOBase::SetInstance(nullptr); if (m_otherFileIO) @@ -160,4 +167,7 @@ public: private: AZ::IO::FileIOBase* m_otherFileIO = nullptr; + +protected: + AZStd::unique_ptr m_settingsRegistry; }; diff --git a/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h b/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h index 239d01b56c..835f44aca8 100644 --- a/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h +++ b/Gems/AWSMetrics/Code/Include/Private/ClientConfiguration.h @@ -17,12 +17,16 @@ namespace AWSMetrics class ClientConfiguration { public: + static constexpr const char AWSMetricsMaxQueueSizeInMbKey[] = "/Gems/AWSMetrics/MaxQueueSizeInMb"; + static constexpr const char AWSMetricsQueueFlushPeriodInSecondsKey[] = "/Gems/AWSMetrics/QueueFlushPeriodInSeconds"; + static constexpr const char AWSMetricsOfflineRecordingEnabledKey[] = "/Gems/AWSMetrics/OfflineRecording"; + static constexpr const char AWSMetricsMaxNumRetriesKey[] = "/Gems/AWSMetrics/MaxNumRetries"; + ClientConfiguration(); - //! Reset the client settings based on the provided configuration file. - //! @param settingsRegistryPath Full path to the configuration file. + //! Initialize the client settings based on the global setting registry. //! @return whether the operation is successful - bool ResetClientConfiguration(const AZStd::string& settingsRegistryPath); + bool InitClientConfiguration(); //! Retrieve the max queue size setting. //! @return Max queue size in bytes. diff --git a/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h b/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h index 9f110c75e0..1cdb2b8118 100644 --- a/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h +++ b/Gems/AWSMetrics/Code/Include/Private/MetricsManager.h @@ -33,9 +33,8 @@ namespace AWSMetrics ~MetricsManager(); //! Initializing the metrics manager - //! @param settingsRegistryPath Path to the settings registry file. //! @return Whether the operation is successful. - bool Init(const AZStd::string& settingsRegistryPath = ""); + bool Init(); //! Start sending metircs to the backend or a local file. void StartMetrics(); //! Stop sending metircs to the backend or a local file. diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp b/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp index cbc10a1f04..ee9b2d6edc 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp @@ -192,11 +192,7 @@ namespace AWSMetrics void AWSMetricsSystemComponent::Init() { - AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@"); - AZStd::string configFilePath = priorAlias + "\\Gems\\AWSMetrics\\Code\\" + AZ::SettingsRegistryInterface::RegistryFolder + "\\awsMetricsClientConfiguration.setreg"; - AzFramework::StringFunc::Path::Normalize(configFilePath); - - m_metricsManager->Init(configFilePath); + m_metricsManager->Init(); } void AWSMetricsSystemComponent::Activate() diff --git a/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp b/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp index 504c02d920..b97eba25bd 100644 --- a/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp +++ b/Gems/AWSMetrics/Code/Source/ClientConfiguration.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -23,38 +24,44 @@ namespace AWSMetrics { } - bool ClientConfiguration::ResetClientConfiguration(const AZStd::string& settingsRegistryPath) + bool ClientConfiguration::InitClientConfiguration() { - AZStd::unique_ptr settingsRegistry = AZStd::make_unique(); - - AZ_Printf("AWSMetrics", "Reset client settings using the confiugration file %s", settingsRegistryPath.c_str()); - if (!settingsRegistry->MergeSettingsFile(settingsRegistryPath, AZ::SettingsRegistryInterface::Format::JsonMergePatch)) + AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); + if (!settingsRegistry) { - AZ_Warning("AWSMetrics", false, "Failed to merge the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to load the setting registry"); return false; } - if (!settingsRegistry->Get(m_maxQueueSizeInMb, "/Amazon/Gems/AWSMetrics/MaxQueueSizeInMb")) + if (!settingsRegistry->Get( + m_maxQueueSizeInMb, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsMaxQueueSizeInMbKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the maximum queue size setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the maximum queue size setting from the setting registry"); return false; } - if (!settingsRegistry->Get(m_queueFlushPeriodInSeconds, "/Amazon/Gems/AWSMetrics/QueueFlushPeriodInSeconds")) + if (!settingsRegistry->Get( + m_queueFlushPeriodInSeconds, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsQueueFlushPeriodInSecondsKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the queue flush period setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the queue flush period setting from the setting registry"); return false; } bool enableOfflineRecording = false; - if (!settingsRegistry->Get(enableOfflineRecording, "/Amazon/Gems/AWSMetrics/OfflineRecording")) + if (!settingsRegistry->Get( + enableOfflineRecording, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsOfflineRecordingEnabledKey))) { - AZ_Warning("AWSMetrics", false, "Failed to read the submission target setting in the configuration file"); + AZ_Warning("AWSMetrics", false, "Failed to read the submission target setting from the setting registry"); return false; } m_offlineRecordingEnabled = enableOfflineRecording; - if (!settingsRegistry->Get(m_maxNumRetries, "/Amazon/Gems/AWSMetrics/MaxNumRetries")) + if (!settingsRegistry->Get( + m_maxNumRetries, + AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSMetricsMaxNumRetriesKey))) { AZ_Warning("AWSMetrics", false, "Failed to read the maximum number of retries setting in the configuration file"); return false; diff --git a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp index 5779697010..b2eda9a39d 100644 --- a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp +++ b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp @@ -34,9 +34,9 @@ namespace AWSMetrics ShutdownMetrics(); } - bool MetricsManager::Init(const AZStd::string& settingsRegistryPath) + bool MetricsManager::Init() { - if (!m_clientConfiguration->ResetClientConfiguration(settingsRegistryPath)) + if (!m_clientConfiguration->InitClientConfiguration()) { return false; } diff --git a/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h b/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h index 77d3f5e5b8..33fae3693e 100644 --- a/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h +++ b/Gems/AWSMetrics/Code/Tests/AWSMetricsGemMock.h @@ -52,10 +52,14 @@ namespace AWSMetrics m_settingsRegistry->SetContext(m_serializeContext.get()); m_settingsRegistry->SetContext(m_registrationContext.get()); + + AZ::SettingsRegistry::Register(m_settingsRegistry.get()); } void TearDown() override { + AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); + m_registrationContext->EnableRemoveReflection(); AZ::JsonSystemComponent::Reflect(m_registrationContext.get()); m_registrationContext->DisableRemoveReflection(); @@ -130,7 +134,7 @@ namespace AWSMetrics AZStd::unique_ptr m_serializeContext; AZStd::unique_ptr m_registrationContext; - AZStd::shared_ptr m_settingsRegistry; + AZStd::unique_ptr m_settingsRegistry; private: AZStd::string GetTestFolderPath() diff --git a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp index 39d06dec66..32b1c9d240 100644 --- a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp @@ -135,7 +135,8 @@ namespace AWSMetrics m_metricsManager = AZStd::make_unique(); AZStd::string configFilePath = CreateClientConfigFile(true, (double) TestMetricsEventSizeInBytes / MbToBytes * 2, DefaultFlushPeriodInSeconds, 0); - m_metricsManager->Init(configFilePath); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_metricsManager->Init(); RemoveFile(m_metricsManager->GetMetricsFilePath()); @@ -161,7 +162,8 @@ namespace AWSMetrics RevertMockIOToLocalFileIO(); AZStd::string configFilePath = CreateClientConfigFile(offlineRecordingEnabled, maxQueueSizeInMb, queueFlushPeriodInSeconds, MaxNumRetries); - m_metricsManager->Init(configFilePath); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_metricsManager->Init(); ReplaceLocalFileIOWithMockIO(); } @@ -555,10 +557,11 @@ namespace AWSMetrics AZStd::unique_ptr m_clientConfiguration; }; - TEST_F(ClientConfigurationTest, ResetClientConfiguration_ValidConfigurationFile_Success) + TEST_F(ClientConfigurationTest, ResetClientConfiguration_ValidClientConfiguration_Success) { AZStd::string configFilePath = CreateClientConfigFile(true, DEFAULT_MAX_QUEUE_SIZE_IN_MB, DefaultFlushPeriodInSeconds, DEFAULT_MAX_NUM_RETRIES); - ASSERT_TRUE(m_clientConfiguration->ResetClientConfiguration(configFilePath)); + m_settingsRegistry->MergeSettingsFile(configFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + ASSERT_TRUE(m_clientConfiguration->InitClientConfiguration()); ASSERT_TRUE(m_clientConfiguration->OfflineRecordingEnabled()); ASSERT_EQ(m_clientConfiguration->GetMaxQueueSizeInBytes(), DEFAULT_MAX_QUEUE_SIZE_IN_MB * 1000000); @@ -573,12 +576,4 @@ namespace AWSMetrics ASSERT_EQ(strcmp(m_clientConfiguration->GetMetricsFileDir(), resolvedPath), 0); ASSERT_EQ(m_clientConfiguration->GetMetricsFileFullPath(), expectedMetricsFilePath); } - - TEST_F(ClientConfigurationTest, ResetClientConfiguration_InvalidConfigurationFile_Fail) - { - AZStd::string configFilePath = "invalidConfig"; - AZ_TEST_START_TRACE_SUPPRESSION; - ASSERT_FALSE(m_clientConfiguration->ResetClientConfiguration(configFilePath)); - AZ_TEST_STOP_TRACE_SUPPRESSION(1); - } } diff --git a/Gems/AWSMetrics/Code/Registry/awsMetricsClientConfiguration.setreg b/Gems/AWSMetrics/Registry/awsMetricsClientConfiguration.setreg similarity index 100% rename from Gems/AWSMetrics/Code/Registry/awsMetricsClientConfiguration.setreg rename to Gems/AWSMetrics/Registry/awsMetricsClientConfiguration.setreg From 19638c4697a2e95bcb9b12badd82980e92b4c5ac Mon Sep 17 00:00:00 2001 From: antonmic Date: Fri, 2 Jul 2021 01:18:09 -0700 Subject: [PATCH 039/156] [ATOM-15876] fixed subsurface scattering on vulkan Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Types/MaterialInputs/DetailMapsInput.azsli | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli index f8227d54bd..0add608dc4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsInput.azsli @@ -33,7 +33,12 @@ bool m_detail_normal_flipX; \ bool m_detail_normal_flipY; \ \ float3x3 m_detailUvMatrix; \ -float3x3 m_detailUvMatrixInverse; +float4 m_detailUvMatrixPad; \ +float3x3 m_detailUvMatrixInverse; \ +float4 m_detailUvMatrixInversePad; + +// [GFX TODO][ATOM-14595] m_detailUvMatrixPad and m_detailUvMatrixInversePad are a workaround for a data stomping bug. +// Remove them once the bug is fixed. #define COMMON_OPTIONS_DETAIL_MAPS(prefix) \ From d68667342747fb25f4c3a092322b04bc83cb4080 Mon Sep 17 00:00:00 2001 From: Terry Michaels Date: Fri, 2 Jul 2021 14:14:47 -0500 Subject: [PATCH 040/156] Removed unneeded binaries (#1767) Signed-off-by: Terry Michaels --- Assets/Editor/Styles/Office2007.dll | 3 --- Assets/Editor/Styles/Office2007Black.dll | 3 --- Assets/Editor/Styles/Office2007Silver.dll | 3 --- 3 files changed, 9 deletions(-) delete mode 100644 Assets/Editor/Styles/Office2007.dll delete mode 100644 Assets/Editor/Styles/Office2007Black.dll delete mode 100644 Assets/Editor/Styles/Office2007Silver.dll diff --git a/Assets/Editor/Styles/Office2007.dll b/Assets/Editor/Styles/Office2007.dll deleted file mode 100644 index 3f986741cc..0000000000 --- a/Assets/Editor/Styles/Office2007.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1c5941f584d35b3d21eb9c311b02698c30499895e9a8c827fb71168e2656255 -size 1436672 diff --git a/Assets/Editor/Styles/Office2007Black.dll b/Assets/Editor/Styles/Office2007Black.dll deleted file mode 100644 index 0a65e1d056..0000000000 --- a/Assets/Editor/Styles/Office2007Black.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f480ade0a4190f7cb1d7cf286e970f958632d88e19b8c21ead11f838358a750 -size 369584 diff --git a/Assets/Editor/Styles/Office2007Silver.dll b/Assets/Editor/Styles/Office2007Silver.dll deleted file mode 100644 index bf24eda6a5..0000000000 --- a/Assets/Editor/Styles/Office2007Silver.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5eba063346e9163f43bbfec7e71497c847645fb12a3ec573314c9f44afbc801 -size 364464 From b11cd2d17f21117371eceb600bd954766d974741 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 2 Jul 2021 14:58:31 -0500 Subject: [PATCH 041/156] O3DE License Scan Updates (#1808) * Removing Tools/Redistributable folder None of the files within it are used by O3DE or are needed for distribution at all Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing the GetGlyphRangesJapanese function from imgui_draw.cpp That function is licensed under the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP) Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h | 1 - .../External/ImGui/v1.82/imgui/imgui_draw.cpp | 89 ------------------- Tools/Redistributables/ANGLE/win32/libEGL.dll | 3 - .../Redistributables/ANGLE/win32/libEGLd.dll | 3 - .../ANGLE/win32/libGLESv2.dll | 3 - .../ANGLE/win32/libGLESv2d.dll | 3 - .../D3DCompiler/win32/D3DCompiler_43.dll | 3 - .../D3DCompiler/win32/d3dcompiler_46.dll | 3 - .../D3DCompiler/win32/d3dcompiler_47.dll | 3 - .../D3DCompiler/win32/d3dcsx_46.dll | 3 - .../D3DCompiler/win32/d3dcsx_47.dll | 3 - .../D3DCompiler/win32/d3dx11_43.dll | 3 - .../D3DCompiler/win32/xinput1_3.dll | 3 - .../DbgHelp/win32/dbghelp.dll | 3 - .../DirectX 9.0c/APR2007_XACT_x64.cab | 3 - .../DirectX 9.0c/APR2007_XACT_x86.cab | 3 - .../DirectX 9.0c/APR2007_d3dx10_33_x64.cab | 3 - .../DirectX 9.0c/APR2007_d3dx10_33_x86.cab | 3 - .../DirectX 9.0c/APR2007_d3dx9_33_x64.cab | 3 - .../DirectX 9.0c/APR2007_d3dx9_33_x86.cab | 3 - .../DirectX 9.0c/APR2007_xinput_x64.cab | 3 - .../DirectX 9.0c/APR2007_xinput_x86.cab | 3 - .../DirectX 9.0c/AUG2006_XACT_x64.cab | 3 - .../DirectX 9.0c/AUG2006_XACT_x86.cab | 3 - .../DirectX 9.0c/AUG2006_xinput_x64.cab | 3 - .../DirectX 9.0c/AUG2006_xinput_x86.cab | 3 - .../DirectX 9.0c/AUG2007_XACT_x64.cab | 3 - .../DirectX 9.0c/AUG2007_XACT_x86.cab | 3 - .../DirectX 9.0c/AUG2007_d3dx10_35_x64.cab | 3 - .../DirectX 9.0c/AUG2007_d3dx10_35_x86.cab | 3 - .../DirectX 9.0c/AUG2007_d3dx9_35_x64.cab | 3 - .../DirectX 9.0c/AUG2007_d3dx9_35_x86.cab | 3 - .../DirectX 9.0c/Apr2005_d3dx9_25_x64.cab | 3 - .../DirectX 9.0c/Apr2005_d3dx9_25_x86.cab | 3 - .../DirectX 9.0c/Apr2006_MDX1_x86.cab | 3 - .../DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab | 3 - .../DirectX 9.0c/Apr2006_XACT_x64.cab | 3 - .../DirectX 9.0c/Apr2006_XACT_x86.cab | 3 - .../DirectX 9.0c/Apr2006_d3dx9_30_x64.cab | 3 - .../DirectX 9.0c/Apr2006_d3dx9_30_x86.cab | 3 - .../DirectX 9.0c/Apr2006_xinput_x64.cab | 3 - .../DirectX 9.0c/Apr2006_xinput_x86.cab | 3 - .../DirectX 9.0c/Aug2005_d3dx9_27_x64.cab | 3 - .../DirectX 9.0c/Aug2005_d3dx9_27_x86.cab | 3 - .../DirectX 9.0c/Aug2008_XACT_x64.cab | 3 - .../DirectX 9.0c/Aug2008_XACT_x86.cab | 3 - .../DirectX 9.0c/Aug2008_XAudio_x64.cab | 3 - .../DirectX 9.0c/Aug2008_XAudio_x86.cab | 3 - .../DirectX 9.0c/Aug2008_d3dx10_39_x64.cab | 3 - .../DirectX 9.0c/Aug2008_d3dx10_39_x86.cab | 3 - .../DirectX 9.0c/Aug2008_d3dx9_39_x64.cab | 3 - .../DirectX 9.0c/Aug2008_d3dx9_39_x86.cab | 3 - .../Aug2009_D3DCompiler_42_x64.cab | 3 - .../Aug2009_D3DCompiler_42_x86.cab | 3 - .../DirectX 9.0c/Aug2009_XACT_x64.cab | 3 - .../DirectX 9.0c/Aug2009_XACT_x86.cab | 3 - .../DirectX 9.0c/Aug2009_XAudio_x64.cab | 3 - .../DirectX 9.0c/Aug2009_XAudio_x86.cab | 3 - .../DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab | 3 - .../DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx10_42_x64.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx10_42_x86.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx11_42_x64.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx11_42_x86.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx9_42_x64.cab | 3 - .../DirectX 9.0c/Aug2009_d3dx9_42_x86.cab | 3 - .../DirectX 9.0c/DEC2006_XACT_x64.cab | 3 - .../DirectX 9.0c/DEC2006_XACT_x86.cab | 3 - .../DirectX 9.0c/DEC2006_d3dx10_00_x64.cab | 3 - .../DirectX 9.0c/DEC2006_d3dx10_00_x86.cab | 3 - .../DirectX 9.0c/DEC2006_d3dx9_32_x64.cab | 3 - .../DirectX 9.0c/DEC2006_d3dx9_32_x86.cab | 3 - .../Redistributables/DirectX 9.0c/DSETUP.dll | 3 - .../Redistributables/DirectX 9.0c/DXSETUP.exe | 3 - .../DirectX 9.0c/Dec2005_d3dx9_28_x64.cab | 3 - .../DirectX 9.0c/Dec2005_d3dx9_28_x86.cab | 3 - .../DirectX 9.0c/FEB2007_XACT_x64.cab | 3 - .../DirectX 9.0c/FEB2007_XACT_x86.cab | 3 - .../DirectX 9.0c/Feb2005_d3dx9_24_x64.cab | 3 - .../DirectX 9.0c/Feb2005_d3dx9_24_x86.cab | 3 - .../DirectX 9.0c/Feb2006_XACT_x64.cab | 3 - .../DirectX 9.0c/Feb2006_XACT_x86.cab | 3 - .../DirectX 9.0c/Feb2006_d3dx9_29_x64.cab | 3 - .../DirectX 9.0c/Feb2006_d3dx9_29_x86.cab | 3 - .../DirectX 9.0c/Feb2010_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/Feb2010_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/Feb2010_XACT_x64.cab | 3 - .../DirectX 9.0c/Feb2010_XACT_x86.cab | 3 - .../DirectX 9.0c/Feb2010_XAudio_x64.cab | 3 - .../DirectX 9.0c/Feb2010_XAudio_x86.cab | 3 - .../DirectX 9.0c/JUN2006_XACT_x64.cab | 3 - .../DirectX 9.0c/JUN2006_XACT_x86.cab | 3 - .../DirectX 9.0c/JUN2007_XACT_x64.cab | 3 - .../DirectX 9.0c/JUN2007_XACT_x86.cab | 3 - .../DirectX 9.0c/JUN2007_d3dx10_34_x64.cab | 3 - .../DirectX 9.0c/JUN2007_d3dx10_34_x86.cab | 3 - .../DirectX 9.0c/JUN2007_d3dx9_34_x64.cab | 3 - .../DirectX 9.0c/JUN2007_d3dx9_34_x86.cab | 3 - .../DirectX 9.0c/JUN2008_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/JUN2008_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/JUN2008_XACT_x64.cab | 3 - .../DirectX 9.0c/JUN2008_XACT_x86.cab | 3 - .../DirectX 9.0c/JUN2008_XAudio_x64.cab | 3 - .../DirectX 9.0c/JUN2008_XAudio_x86.cab | 3 - .../DirectX 9.0c/JUN2008_d3dx10_38_x64.cab | 3 - .../DirectX 9.0c/JUN2008_d3dx10_38_x86.cab | 3 - .../DirectX 9.0c/JUN2008_d3dx9_38_x64.cab | 3 - .../DirectX 9.0c/JUN2008_d3dx9_38_x86.cab | 3 - .../DirectX 9.0c/Jun2005_d3dx9_26_x64.cab | 3 - .../DirectX 9.0c/Jun2005_d3dx9_26_x86.cab | 3 - .../Jun2010_D3DCompiler_43_x64.cab | 3 - .../Jun2010_D3DCompiler_43_x86.cab | 3 - .../DirectX 9.0c/Jun2010_XACT_x64.cab | 3 - .../DirectX 9.0c/Jun2010_XACT_x86.cab | 3 - .../DirectX 9.0c/Jun2010_XAudio_x64.cab | 3 - .../DirectX 9.0c/Jun2010_XAudio_x86.cab | 3 - .../DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab | 3 - .../DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx10_43_x64.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx10_43_x86.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx11_43_x64.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx11_43_x86.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx9_43_x64.cab | 3 - .../DirectX 9.0c/Jun2010_d3dx9_43_x86.cab | 3 - .../DirectX 9.0c/Mar2008_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/Mar2008_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/Mar2008_XACT_x64.cab | 3 - .../DirectX 9.0c/Mar2008_XACT_x86.cab | 3 - .../DirectX 9.0c/Mar2008_XAudio_x64.cab | 3 - .../DirectX 9.0c/Mar2008_XAudio_x86.cab | 3 - .../DirectX 9.0c/Mar2008_d3dx10_37_x64.cab | 3 - .../DirectX 9.0c/Mar2008_d3dx10_37_x86.cab | 3 - .../DirectX 9.0c/Mar2008_d3dx9_37_x64.cab | 3 - .../DirectX 9.0c/Mar2008_d3dx9_37_x86.cab | 3 - .../DirectX 9.0c/Mar2009_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/Mar2009_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/Mar2009_XACT_x64.cab | 3 - .../DirectX 9.0c/Mar2009_XACT_x86.cab | 3 - .../DirectX 9.0c/Mar2009_XAudio_x64.cab | 3 - .../DirectX 9.0c/Mar2009_XAudio_x86.cab | 3 - .../DirectX 9.0c/Mar2009_d3dx10_41_x64.cab | 3 - .../DirectX 9.0c/Mar2009_d3dx10_41_x86.cab | 3 - .../DirectX 9.0c/Mar2009_d3dx9_41_x64.cab | 3 - .../DirectX 9.0c/Mar2009_d3dx9_41_x86.cab | 3 - .../DirectX 9.0c/NOV2007_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/NOV2007_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/NOV2007_XACT_x64.cab | 3 - .../DirectX 9.0c/NOV2007_XACT_x86.cab | 3 - .../DirectX 9.0c/Nov2007_d3dx10_36_x64.cab | 3 - .../DirectX 9.0c/Nov2007_d3dx10_36_x86.cab | 3 - .../DirectX 9.0c/Nov2007_d3dx9_36_x64.cab | 3 - .../DirectX 9.0c/Nov2007_d3dx9_36_x86.cab | 3 - .../DirectX 9.0c/Nov2008_X3DAudio_x64.cab | 3 - .../DirectX 9.0c/Nov2008_X3DAudio_x86.cab | 3 - .../DirectX 9.0c/Nov2008_XACT_x64.cab | 3 - .../DirectX 9.0c/Nov2008_XACT_x86.cab | 3 - .../DirectX 9.0c/Nov2008_XAudio_x64.cab | 3 - .../DirectX 9.0c/Nov2008_XAudio_x86.cab | 3 - .../DirectX 9.0c/Nov2008_d3dx10_40_x64.cab | 3 - .../DirectX 9.0c/Nov2008_d3dx10_40_x86.cab | 3 - .../DirectX 9.0c/Nov2008_d3dx9_40_x64.cab | 3 - .../DirectX 9.0c/Nov2008_d3dx9_40_x86.cab | 3 - .../DirectX 9.0c/OCT2006_XACT_x64.cab | 3 - .../DirectX 9.0c/OCT2006_XACT_x86.cab | 3 - .../DirectX 9.0c/OCT2006_d3dx9_31_x64.cab | 3 - .../DirectX 9.0c/OCT2006_d3dx9_31_x86.cab | 3 - .../DirectX 9.0c/Oct2005_xinput_x64.cab | 3 - .../DirectX 9.0c/Oct2005_xinput_x86.cab | 3 - .../DirectX 9.0c/dsetup32.dll | 3 - .../DirectX 9.0c/dxdllreg_x86.cab | 3 - .../DirectX 9.0c/dxupdate.cab | 3 - .../Redistributables/FFMpeg/win32/ffmpeg.exe | 3 - .../LuaCompiler/win32/LuaCompiler.exe | 3 - .../MSVC90/Microsoft.VC90.CRT.manifest | 6 -- Tools/Redistributables/MSVC90/msvcr90.dll | 3 - .../Redistributables/OpenGL32/opengl32sw.dll | 3 - .../SSLEAY/win32/libeay32.dll | 3 - .../SSLEAY/win32/ssleay32.dll | 3 - .../Visual Studio 2012/vcredist_x64.exe | 3 - .../Visual Studio 2015-2019/VC_redist.x64.exe | 3 - Tools/Redistributables/vc_mbcsmfc.exe | 3 - 181 files changed, 630 deletions(-) delete mode 100644 Tools/Redistributables/ANGLE/win32/libEGL.dll delete mode 100644 Tools/Redistributables/ANGLE/win32/libEGLd.dll delete mode 100644 Tools/Redistributables/ANGLE/win32/libGLESv2.dll delete mode 100644 Tools/Redistributables/ANGLE/win32/libGLESv2d.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll delete mode 100644 Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll delete mode 100644 Tools/Redistributables/DbgHelp/win32/dbghelp.dll delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/DSETUP.dll delete mode 100644 Tools/Redistributables/DirectX 9.0c/DXSETUP.exe delete mode 100644 Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/dsetup32.dll delete mode 100644 Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab delete mode 100644 Tools/Redistributables/DirectX 9.0c/dxupdate.cab delete mode 100644 Tools/Redistributables/FFMpeg/win32/ffmpeg.exe delete mode 100644 Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe delete mode 100644 Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest delete mode 100644 Tools/Redistributables/MSVC90/msvcr90.dll delete mode 100644 Tools/Redistributables/OpenGL32/opengl32sw.dll delete mode 100644 Tools/Redistributables/SSLEAY/win32/libeay32.dll delete mode 100644 Tools/Redistributables/SSLEAY/win32/ssleay32.dll delete mode 100644 Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe delete mode 100644 Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe delete mode 100644 Tools/Redistributables/vc_mbcsmfc.exe diff --git a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h index da70306401..af3d3471bc 100644 --- a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h +++ b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui.h @@ -2598,7 +2598,6 @@ struct ImFontAtlas // NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data. IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters - IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs IMGUI_API const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters diff --git a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp index c41a1ba0b2..fc1c7b34ab 100644 --- a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp +++ b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_draw.cpp @@ -2901,95 +2901,6 @@ const ImWchar* ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon() return &full_ranges[0]; } -const ImWchar* ImFontAtlas::GetGlyphRangesJapanese() -{ - // 2999 ideograms code points for Japanese - // - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points - // - 863 Jinmeiyo (meaning "for personal name") Kanji code points - // - Sourced from the character information database of the Information-technology Promotion Agency, Japan - // - https://mojikiban.ipa.go.jp/mji/ - // - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP). - // - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en - // - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode - // - You can generate this code by the script at: - // - https://github.com/vaiorabbit/everyday_use_kanji - // - References: - // - List of Joyo Kanji - // - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html - // - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji - // - List of Jinmeiyo Kanji - // - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html - // - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji - // - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details. - // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters. - // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.) - static const short accumulative_offsets_from_0x4E00[] = - { - 0,1,2,4,1,1,1,1,2,1,3,3,2,2,1,5,3,5,7,5,6,1,2,1,7,2,6,3,1,8,1,1,4,1,1,18,2,11,2,6,2,1,2,1,5,1,2,1,3,1,2,1,2,3,3,1,1,2,3,1,1,1,12,7,9,1,4,5,1, - 1,2,1,10,1,1,9,2,2,4,5,6,9,3,1,1,1,1,9,3,18,5,2,2,2,2,1,6,3,7,1,1,1,1,2,2,4,2,1,23,2,10,4,3,5,2,4,10,2,4,13,1,6,1,9,3,1,1,6,6,7,6,3,1,2,11,3, - 2,2,3,2,15,2,2,5,4,3,6,4,1,2,5,2,12,16,6,13,9,13,2,1,1,7,16,4,7,1,19,1,5,1,2,2,7,7,8,2,6,5,4,9,18,7,4,5,9,13,11,8,15,2,1,1,1,2,1,2,2,1,2,2,8, - 2,9,3,3,1,1,4,4,1,1,1,4,9,1,4,3,5,5,2,7,5,3,4,8,2,1,13,2,3,3,1,14,1,1,4,5,1,3,6,1,5,2,1,1,3,3,3,3,1,1,2,7,6,6,7,1,4,7,6,1,1,1,1,1,12,3,3,9,5, - 2,6,1,5,6,1,2,3,18,2,4,14,4,1,3,6,1,1,6,3,5,5,3,2,2,2,2,12,3,1,4,2,3,2,3,11,1,7,4,1,2,1,3,17,1,9,1,24,1,1,4,2,2,4,1,2,7,1,1,1,3,1,2,2,4,15,1, - 1,2,1,1,2,1,5,2,5,20,2,5,9,1,10,8,7,6,1,1,1,1,1,1,6,2,1,2,8,1,1,1,1,5,1,1,3,1,1,1,1,3,1,1,12,4,1,3,1,1,1,1,1,10,3,1,7,5,13,1,2,3,4,6,1,1,30, - 2,9,9,1,15,38,11,3,1,8,24,7,1,9,8,10,2,1,9,31,2,13,6,2,9,4,49,5,2,15,2,1,10,2,1,1,1,2,2,6,15,30,35,3,14,18,8,1,16,10,28,12,19,45,38,1,3,2,3, - 13,2,1,7,3,6,5,3,4,3,1,5,7,8,1,5,3,18,5,3,6,1,21,4,24,9,24,40,3,14,3,21,3,2,1,2,4,2,3,1,15,15,6,5,1,1,3,1,5,6,1,9,7,3,3,2,1,4,3,8,21,5,16,4, - 5,2,10,11,11,3,6,3,2,9,3,6,13,1,2,1,1,1,1,11,12,6,6,1,4,2,6,5,2,1,1,3,3,6,13,3,1,1,5,1,2,3,3,14,2,1,2,2,2,5,1,9,5,1,1,6,12,3,12,3,4,13,2,14, - 2,8,1,17,5,1,16,4,2,2,21,8,9,6,23,20,12,25,19,9,38,8,3,21,40,25,33,13,4,3,1,4,1,2,4,1,2,5,26,2,1,1,2,1,3,6,2,1,1,1,1,1,1,2,3,1,1,1,9,2,3,1,1, - 1,3,6,3,2,1,1,6,6,1,8,2,2,2,1,4,1,2,3,2,7,3,2,4,1,2,1,2,2,1,1,1,1,1,3,1,2,5,4,10,9,4,9,1,1,1,1,1,1,5,3,2,1,6,4,9,6,1,10,2,31,17,8,3,7,5,40,1, - 7,7,1,6,5,2,10,7,8,4,15,39,25,6,28,47,18,10,7,1,3,1,1,2,1,1,1,3,3,3,1,1,1,3,4,2,1,4,1,3,6,10,7,8,6,2,2,1,3,3,2,5,8,7,9,12,2,15,1,1,4,1,2,1,1, - 1,3,2,1,3,3,5,6,2,3,2,10,1,4,2,8,1,1,1,11,6,1,21,4,16,3,1,3,1,4,2,3,6,5,1,3,1,1,3,3,4,6,1,1,10,4,2,7,10,4,7,4,2,9,4,3,1,1,1,4,1,8,3,4,1,3,1, - 6,1,4,2,1,4,7,2,1,8,1,4,5,1,1,2,2,4,6,2,7,1,10,1,1,3,4,11,10,8,21,4,6,1,3,5,2,1,2,28,5,5,2,3,13,1,2,3,1,4,2,1,5,20,3,8,11,1,3,3,3,1,8,10,9,2, - 10,9,2,3,1,1,2,4,1,8,3,6,1,7,8,6,11,1,4,29,8,4,3,1,2,7,13,1,4,1,6,2,6,12,12,2,20,3,2,3,6,4,8,9,2,7,34,5,1,18,6,1,1,4,4,5,7,9,1,2,2,4,3,4,1,7, - 2,2,2,6,2,3,25,5,3,6,1,4,6,7,4,2,1,4,2,13,6,4,4,3,1,5,3,4,4,3,2,1,1,4,1,2,1,1,3,1,11,1,6,3,1,7,3,6,2,8,8,6,9,3,4,11,3,2,10,12,2,5,11,1,6,4,5, - 3,1,8,5,4,6,6,3,5,1,1,3,2,1,2,2,6,17,12,1,10,1,6,12,1,6,6,19,9,6,16,1,13,4,4,15,7,17,6,11,9,15,12,6,7,2,1,2,2,15,9,3,21,4,6,49,18,7,3,2,3,1, - 6,8,2,2,6,2,9,1,3,6,4,4,1,2,16,2,5,2,1,6,2,3,5,3,1,2,5,1,2,1,9,3,1,8,6,4,8,11,3,1,1,1,1,3,1,13,8,4,1,3,2,2,1,4,1,11,1,5,2,1,5,2,5,8,6,1,1,7, - 4,3,8,3,2,7,2,1,5,1,5,2,4,7,6,2,8,5,1,11,4,5,3,6,18,1,2,13,3,3,1,21,1,1,4,1,4,1,1,1,8,1,2,2,7,1,2,4,2,2,9,2,1,1,1,4,3,6,3,12,5,1,1,1,5,6,3,2, - 4,8,2,2,4,2,7,1,8,9,5,2,3,2,1,3,2,13,7,14,6,5,1,1,2,1,4,2,23,2,1,1,6,3,1,4,1,15,3,1,7,3,9,14,1,3,1,4,1,1,5,8,1,3,8,3,8,15,11,4,14,4,4,2,5,5, - 1,7,1,6,14,7,7,8,5,15,4,8,6,5,6,2,1,13,1,20,15,11,9,2,5,6,2,11,2,6,2,5,1,5,8,4,13,19,25,4,1,1,11,1,34,2,5,9,14,6,2,2,6,1,1,14,1,3,14,13,1,6, - 12,21,14,14,6,32,17,8,32,9,28,1,2,4,11,8,3,1,14,2,5,15,1,1,1,1,3,6,4,1,3,4,11,3,1,1,11,30,1,5,1,4,1,5,8,1,1,3,2,4,3,17,35,2,6,12,17,3,1,6,2, - 1,1,12,2,7,3,3,2,1,16,2,8,3,6,5,4,7,3,3,8,1,9,8,5,1,2,1,3,2,8,1,2,9,12,1,1,2,3,8,3,24,12,4,3,7,5,8,3,3,3,3,3,3,1,23,10,3,1,2,2,6,3,1,16,1,16, - 22,3,10,4,11,6,9,7,7,3,6,2,2,2,4,10,2,1,1,2,8,7,1,6,4,1,3,3,3,5,10,12,12,2,3,12,8,15,1,1,16,6,6,1,5,9,11,4,11,4,2,6,12,1,17,5,13,1,4,9,5,1,11, - 2,1,8,1,5,7,28,8,3,5,10,2,17,3,38,22,1,2,18,12,10,4,38,18,1,4,44,19,4,1,8,4,1,12,1,4,31,12,1,14,7,75,7,5,10,6,6,13,3,2,11,11,3,2,5,28,15,6,18, - 18,5,6,4,3,16,1,7,18,7,36,3,5,3,1,7,1,9,1,10,7,2,4,2,6,2,9,7,4,3,32,12,3,7,10,2,23,16,3,1,12,3,31,4,11,1,3,8,9,5,1,30,15,6,12,3,2,2,11,19,9, - 14,2,6,2,3,19,13,17,5,3,3,25,3,14,1,1,1,36,1,3,2,19,3,13,36,9,13,31,6,4,16,34,2,5,4,2,3,3,5,1,1,1,4,3,1,17,3,2,3,5,3,1,3,2,3,5,6,3,12,11,1,3, - 1,2,26,7,12,7,2,14,3,3,7,7,11,25,25,28,16,4,36,1,2,1,6,2,1,9,3,27,17,4,3,4,13,4,1,3,2,2,1,10,4,2,4,6,3,8,2,1,18,1,1,24,2,2,4,33,2,3,63,7,1,6, - 40,7,3,4,4,2,4,15,18,1,16,1,1,11,2,41,14,1,3,18,13,3,2,4,16,2,17,7,15,24,7,18,13,44,2,2,3,6,1,1,7,5,1,7,1,4,3,3,5,10,8,2,3,1,8,1,1,27,4,2,1, - 12,1,2,1,10,6,1,6,7,5,2,3,7,11,5,11,3,6,6,2,3,15,4,9,1,1,2,1,2,11,2,8,12,8,5,4,2,3,1,5,2,2,1,14,1,12,11,4,1,11,17,17,4,3,2,5,5,7,3,1,5,9,9,8, - 2,5,6,6,13,13,2,1,2,6,1,2,2,49,4,9,1,2,10,16,7,8,4,3,2,23,4,58,3,29,1,14,19,19,11,11,2,7,5,1,3,4,6,2,18,5,12,12,17,17,3,3,2,4,1,6,2,3,4,3,1, - 1,1,1,5,1,1,9,1,3,1,3,6,1,8,1,1,2,6,4,14,3,1,4,11,4,1,3,32,1,2,4,13,4,1,2,4,2,1,3,1,11,1,4,2,1,4,4,6,3,5,1,6,5,7,6,3,23,3,5,3,5,3,3,13,3,9,10, - 1,12,10,2,3,18,13,7,160,52,4,2,2,3,2,14,5,4,12,4,6,4,1,20,4,11,6,2,12,27,1,4,1,2,2,7,4,5,2,28,3,7,25,8,3,19,3,6,10,2,2,1,10,2,5,4,1,3,4,1,5, - 3,2,6,9,3,6,2,16,3,3,16,4,5,5,3,2,1,2,16,15,8,2,6,21,2,4,1,22,5,8,1,1,21,11,2,1,11,11,19,13,12,4,2,3,2,3,6,1,8,11,1,4,2,9,5,2,1,11,2,9,1,1,2, - 14,31,9,3,4,21,14,4,8,1,7,2,2,2,5,1,4,20,3,3,4,10,1,11,9,8,2,1,4,5,14,12,14,2,17,9,6,31,4,14,1,20,13,26,5,2,7,3,6,13,2,4,2,19,6,2,2,18,9,3,5, - 12,12,14,4,6,2,3,6,9,5,22,4,5,25,6,4,8,5,2,6,27,2,35,2,16,3,7,8,8,6,6,5,9,17,2,20,6,19,2,13,3,1,1,1,4,17,12,2,14,7,1,4,18,12,38,33,2,10,1,1, - 2,13,14,17,11,50,6,33,20,26,74,16,23,45,50,13,38,33,6,6,7,4,4,2,1,3,2,5,8,7,8,9,3,11,21,9,13,1,3,10,6,7,1,2,2,18,5,5,1,9,9,2,68,9,19,13,2,5, - 1,4,4,7,4,13,3,9,10,21,17,3,26,2,1,5,2,4,5,4,1,7,4,7,3,4,2,1,6,1,1,20,4,1,9,2,2,1,3,3,2,3,2,1,1,1,20,2,3,1,6,2,3,6,2,4,8,1,3,2,10,3,5,3,4,4, - 3,4,16,1,6,1,10,2,4,2,1,1,2,10,11,2,2,3,1,24,31,4,10,10,2,5,12,16,164,15,4,16,7,9,15,19,17,1,2,1,1,5,1,1,1,1,1,3,1,4,3,1,3,1,3,1,2,1,1,3,3,7, - 2,8,1,2,2,2,1,3,4,3,7,8,12,92,2,10,3,1,3,14,5,25,16,42,4,7,7,4,2,21,5,27,26,27,21,25,30,31,2,1,5,13,3,22,5,6,6,11,9,12,1,5,9,7,5,5,22,60,3,5, - 13,1,1,8,1,1,3,3,2,1,9,3,3,18,4,1,2,3,7,6,3,1,2,3,9,1,3,1,3,2,1,3,1,1,1,2,1,11,3,1,6,9,1,3,2,3,1,2,1,5,1,1,4,3,4,1,2,2,4,4,1,7,2,1,2,2,3,5,13, - 18,3,4,14,9,9,4,16,3,7,5,8,2,6,48,28,3,1,1,4,2,14,8,2,9,2,1,15,2,4,3,2,10,16,12,8,7,1,1,3,1,1,1,2,7,4,1,6,4,38,39,16,23,7,15,15,3,2,12,7,21, - 37,27,6,5,4,8,2,10,8,8,6,5,1,2,1,3,24,1,16,17,9,23,10,17,6,1,51,55,44,13,294,9,3,6,2,4,2,2,15,1,1,1,13,21,17,68,14,8,9,4,1,4,9,3,11,7,1,1,1, - 5,6,3,2,1,1,1,2,3,8,1,2,2,4,1,5,5,2,1,4,3,7,13,4,1,4,1,3,1,1,1,5,5,10,1,6,1,5,2,1,5,2,4,1,4,5,7,3,18,2,9,11,32,4,3,3,2,4,7,11,16,9,11,8,13,38, - 32,8,4,2,1,1,2,1,2,4,4,1,1,1,4,1,21,3,11,1,16,1,1,6,1,3,2,4,9,8,57,7,44,1,3,3,13,3,10,1,1,7,5,2,7,21,47,63,3,15,4,7,1,16,1,1,2,8,2,3,42,15,4, - 1,29,7,22,10,3,78,16,12,20,18,4,67,11,5,1,3,15,6,21,31,32,27,18,13,71,35,5,142,4,10,1,2,50,19,33,16,35,37,16,19,27,7,1,133,19,1,4,8,7,20,1,4, - 4,1,10,3,1,6,1,2,51,5,40,15,24,43,22928,11,1,13,154,70,3,1,1,7,4,10,1,2,1,1,2,1,2,1,2,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1, - 3,2,1,1,1,1,2,1,1, - }; - static ImWchar base_ranges[] = // not zero-terminated - { - 0x0020, 0x00FF, // Basic Latin + Latin Supplement - 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana - 0x31F0, 0x31FF, // Katakana Phonetic Extensions - 0xFF00, 0xFFEF // Half-width characters - }; - static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00)*2 + 1] = { 0 }; - if (!full_ranges[0]) - { - memcpy(full_ranges, base_ranges, sizeof(base_ranges)); - UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges)); - } - return &full_ranges[0]; -} - const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic() { static const ImWchar ranges[] = diff --git a/Tools/Redistributables/ANGLE/win32/libEGL.dll b/Tools/Redistributables/ANGLE/win32/libEGL.dll deleted file mode 100644 index 17591e8a92..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libEGL.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a355059a9c5502b031f7dc6e20d926a3408d72e3e65de0c698ab7558a96dc815 -size 11776 diff --git a/Tools/Redistributables/ANGLE/win32/libEGLd.dll b/Tools/Redistributables/ANGLE/win32/libEGLd.dll deleted file mode 100644 index 57b9edd0fd..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libEGLd.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d56680be69f7445b11646ddd73ba700bccfca4f719ebc7a2c8f541f69ef7c7d -size 47104 diff --git a/Tools/Redistributables/ANGLE/win32/libGLESv2.dll b/Tools/Redistributables/ANGLE/win32/libGLESv2.dll deleted file mode 100644 index 8db2dd1884..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libGLESv2.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74ad18a8407c076eb828f90df6f001f3ddbc60dabe0d51d6a6e63b239895c372 -size 2013696 diff --git a/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll b/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll deleted file mode 100644 index fb0d5e866c..0000000000 --- a/Tools/Redistributables/ANGLE/win32/libGLESv2d.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9fc47544300f53039fbdcb3c19ce7304d838a033f929d91cb9b00706f00470db -size 9986048 diff --git a/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll b/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll deleted file mode 100644 index 33360daba7..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/D3DCompiler_43.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:44c3a7e330b54a35a9efa015831392593aa02e7da1460be429d17c3644850e8a -size 2526056 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll deleted file mode 100644 index 76409ef17f..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_46.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dde5c2d0ff52f07017ea91e833f3baeca74661539599795df2e8096218abcca7 -size 3873208 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll deleted file mode 100644 index e720652a3d..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcompiler_47.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d82f77d802ff05d4da0c82335a05613604da243513faa7fb145aaad0119bddb5 -size 4488904 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll deleted file mode 100644 index af3bca66f8..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_46.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:475f0b6c0f62fc1420e69130d1df2ff15821f13817d47c81ee18d78fbf5690a9 -size 1917016 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll b/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll deleted file mode 100644 index 142d90def6..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dcsx_47.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8d78452c139d4f4e4e387050fbf3587ae7767a91f52b270e09af5ca00c729e4 -size 1921168 diff --git a/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll b/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll deleted file mode 100644 index cfb2d499ae..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/d3dx11_43.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:981e42629df751217406e7150477cddc853b79abd6a8568a1566298ed8f7bd59 -size 276832 diff --git a/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll b/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll deleted file mode 100644 index 33fbe019ff..0000000000 --- a/Tools/Redistributables/D3DCompiler/win32/xinput1_3.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:756cad002e1553cfa1a91ebe8c1b9380ffabe0b4b1916c4a4db802396ddfbef8 -size 107368 diff --git a/Tools/Redistributables/DbgHelp/win32/dbghelp.dll b/Tools/Redistributables/DbgHelp/win32/dbghelp.dll deleted file mode 100644 index 92ea21217c..0000000000 --- a/Tools/Redistributables/DbgHelp/win32/dbghelp.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c53733eb15cdc60920efcf6fc5a5ad9e936b5ea6d0a1913506730a5721ff2a10 -size 1413064 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab deleted file mode 100644 index e7bf2eaf5f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e1042d91b755a36e7dfca480bb3f868cb23f5438dd1415fd3fcfb13b27d761e -size 195766 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab deleted file mode 100644 index 98e73d72fb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9dee9f2b720b0fc90b8ebdac22d20f2008e58f16f354b9a967526c439bf0b9a3 -size 151225 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab deleted file mode 100644 index bc9e0209be..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1bed02f304d495c2769debff315ae3f017c7e9907d85138996554e8e61a61e91 -size 698612 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab deleted file mode 100644 index da023a3b35..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx10_33_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6aca96d6aa400d8ad07d2fb1c4aa94c62d261b9370cbf01d2acce24e489038ba -size 695865 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab deleted file mode 100644 index 013a902ffe..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:387c63928479e0ad138fa154f9f291821275f6fdf122aac8ace87f0d2033e77c -size 1607358 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab deleted file mode 100644 index 5b27284802..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_d3dx9_33_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a7e65d97910b2038bb01a640a86c2ebf62ab7b36a50f349e71ec901b206f0ee -size 1606039 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab deleted file mode 100644 index b2e5465682..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7a09f8235cc587cc63f583e39fbc75008d9677c8bb4dcc11cb8d0178a5153ac -size 96817 diff --git a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab deleted file mode 100644 index def39b9c76..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/APR2007_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2acea6c8b9f6f7f89ec51365a1e49fbd0d8c42c53418bd0783dbf3f74a744e6d -size 53302 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab deleted file mode 100644 index fc21802558..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:beaac99fd17bc9fa85a2a220a13d8c13bd90f66eee595cbd27ab9aaadc234b03 -size 182903 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab deleted file mode 100644 index f45772bf7a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd2e1256efa1723eb77c77440f7b72f0eed8c0df17677cd4cc5a95a65a0f4849 -size 137235 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab deleted file mode 100644 index e39bf153fb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a54c7820f37b5e70068b801263c7efcc26b6404555a968094227e8bbaf5c22c5 -size 87142 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab deleted file mode 100644 index 4375d58ed1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2006_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad2b521d1a7abca6314eaeacb23690b63b2a17adbb2a47d3d69cc4660c7d2152 -size 46058 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab deleted file mode 100644 index 9a235b6833..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35f09b0727ee1ab9116166c512c08886623a67939b2e0d841efdee689b6e0f84 -size 198096 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab deleted file mode 100644 index 4bebdc313e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b39c1b8483111be11cd4c10ef2d18ec8f0b23ff13b628482507076ede9fa9bd1 -size 153012 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab deleted file mode 100644 index 74b7b71f68..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:edbdcb1fa651ec3c8a505a0bb8570b6147ed89ca372e3e6ea86dc6876d6a72f5 -size 852286 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab deleted file mode 100644 index fc0868a13a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx10_35_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a574ecb764861fc40301ebb65fb0bde10fc904ac6eea0580c325dd0c561ff35b -size 796867 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab deleted file mode 100644 index 42e6fff02c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a637ef67615722156fe3fd57ef7581d4ac85ee237d445975b6a20c7a76bd7e3 -size 1800160 diff --git a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab b/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab deleted file mode 100644 index 71186b145f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/AUG2007_d3dx9_35_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6891a70890d5b0bed82a41c47211690a73b24b6df331b83135ed647ff13b1aca -size 1708152 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab deleted file mode 100644 index 1be3556dbe..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4188ce988af9c4771ae0abcc7edc42a091133f9f20196564f51755dc55ea85d -size 1347354 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab deleted file mode 100644 index 7764f8a390..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2005_d3dx9_25_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ebfb6ed6ac0b69502a5b74e2edca188872fe767269c4ebf62f174157d198de4 -size 1078962 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab deleted file mode 100644 index c424daaec9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e3b4b9d5a45884620820d0e9cfed852b03dfb44e443179a35e93f3183384db3 -size 916430 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab deleted file mode 100644 index 86ec8042a1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_MDX1_x86_Archive.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a051a9b50f58dc631254102ac885942ced67c2911950de0cdd93cd1cd9453ec -size 4162630 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab deleted file mode 100644 index 20f0ea95bf..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:002f45af20e43a24abee7a79c5add11987c88140b84e2ecd33c0c67259c7f71b -size 179133 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab deleted file mode 100644 index 6f07ba3a82..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:875662d0fc1fe865bf43e7279fd391e88f96b3141c1a829ab3080d547501ff8f -size 133103 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab deleted file mode 100644 index 061253b14e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:079f61e155695a61a0ce009ee00cf76fbf6b2b9b412c1a5b4a2035d4b5c90a5b -size 1397830 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab deleted file mode 100644 index 82dbc5a86d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_d3dx9_30_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b5da79e14ef58f2608fc5ccedfc7c6c6f782291aa5573f36af76f2903173db5 -size 1115221 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab deleted file mode 100644 index b305f61305..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48da57aa045a877053a481802fdb3ec5782615d9ad85a8c06612bd80272e75d7 -size 87101 diff --git a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab deleted file mode 100644 index 4785f91ec3..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Apr2006_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9b3dd45926364d79b42b75d8064c814ff428437143c59b1c703ec8323305fbb -size 46010 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab deleted file mode 100644 index edeca33d5e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:281d20c56caa3a2851199c028d4d20ef0a862cc3f84b165eb200da573d9e4401 -size 1350542 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab deleted file mode 100644 index 6aadd5ad03..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2005_d3dx9_27_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a10900872ecd9bdbc8f7beb7869a260fa4b25e34084f237f1b096df5371c273 -size 1077644 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab deleted file mode 100644 index 1d0d437175..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c49e261887fefc13cc914590e33faec10316641bf683a121901c302a7a9efab4 -size 121772 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab deleted file mode 100644 index cbc6dffade..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:913f67e5daeb61d872392f2951e13ecfacef572ad4bb1731f7bbefa1ab314a24 -size 92996 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab deleted file mode 100644 index c119908c98..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5320967b14b8f7ad95973a26d3cb9de645acc663d3c3d1fce7d6464abe7e0d78 -size 271412 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab deleted file mode 100644 index 0521c517d3..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d26eff418f73c878a174c69a12dff08323df617526e8c5d8439e975f083db63b -size 271038 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab deleted file mode 100644 index 3496ddab0c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae64328b9a02a47c5ad429b9fba47b9228ab1a1e7d4e00e5d24087f2772d0b80 -size 867612 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab deleted file mode 100644 index f0be0e37bb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx10_39_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c0643efa8d113fc5ef0a0e98d9a2cc0e32cb8d4219ca0bc7e57cf710fd4fdad -size 849167 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab deleted file mode 100644 index 300b15aed0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e0c5dc6a375a70ac6c8cea9193b76db241dad8e754702d57fd20765b55b30798 -size 1794084 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab deleted file mode 100644 index f594ff002a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2008_d3dx9_39_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:87d672f2ea01ef2123fe5c92da82a988cd964ca55ad660cc073d78d8151a7d84 -size 1464672 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab deleted file mode 100644 index 0358983866..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2e14fc8cb9410caad5bd17c4acff2b6e060c552c432d11946a6905aee216931 -size 919044 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab deleted file mode 100644 index 7d3398e5b4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_D3DCompiler_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36c9be8c55f721c38110d56a6ccada672e7566d89f77c738c94fcdf1a584ecf4 -size 900598 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab deleted file mode 100644 index 698f966cee..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:69dab3f80a58912fbee51934d1e6da8d0432efa7577810600dfd168d4a52d637 -size 122408 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab deleted file mode 100644 index 9dd9e2a8f8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c4bab445d4666965019b6084c23e4b9ae9e34b14898d01debc0101ddb9e12e4 -size 93106 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab deleted file mode 100644 index 5ab27e27ec..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1269f085046694d1466a4b75386ec30dd0564949db4fa90df366983f860acb97 -size 273264 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab deleted file mode 100644 index a17034abaa..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8e0c1022a42156c4239aea081f3abb0bf45ef61f30413df182e422e26435714 -size 272642 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab deleted file mode 100644 index d443cc3a07..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b53bb3ed6f56702672f9f0201f6399b28f8c012ac7f1a604fb13b32a10a40dab -size 3112111 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab deleted file mode 100644 index 9ac2fdf691..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dcsx_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a66fd98a1f746698848a4a7eb5ae69dac8ff2654b56c7decebb03cdca8dc7c85 -size 3319740 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab deleted file mode 100644 index eb81c297df..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2cfd51f0115c048ed432522d387167e46b2a2929524dcbd08b91c07705d5da27 -size 232635 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab deleted file mode 100644 index 75c77c166e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx10_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eef0244674e44a4131f12243a11badf3e9c7a24efdca73dd26cf75f24d902597 -size 192131 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab deleted file mode 100644 index 226a317dd7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b91a568769bf0f89658ffb4eff9eacdc5debbe4ddc2d94da6f7068237c94c86 -size 136301 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab deleted file mode 100644 index d645143381..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx11_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e8c845fc2cf746ba07f8921a09dc533973621d6f8a015342e2b078d11815b121 -size 105044 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab deleted file mode 100644 index 6b79425e40..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:832f6a4415c873ed8acca0d5c9e65fe163d9567f0ce29fb3fda11d7afd1e11c7 -size 930116 diff --git a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab b/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab deleted file mode 100644 index c34893deff..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Aug2009_d3dx9_42_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0adc71e37869f12b4806321f40c25dad3d5f8ad372eb35e0bcbaacf60408eb45 -size 728456 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab deleted file mode 100644 index 6aec647190..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b3f65d918e4dc0e84ce5d0add6d0d46425c58de19fddfbc7b996ff357caac3b2 -size 192475 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab deleted file mode 100644 index 6bbe0f8c43..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d9b905fce31b42c47be263165d71c346b5d47abdabbfe6e9a87fd5a89b0b9f5 -size 145599 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab deleted file mode 100644 index d3a5fd50f9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d926d1381f1949754f5e6d597c4ab49e3f350312b2e426effafeed22ba9ced91 -size 212807 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab deleted file mode 100644 index 07e9610fa8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx10_00_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:07fe66373868c32de3f4a4097bd3834ac98018f490f5bf08f02f559c48dbf985 -size 191720 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab deleted file mode 100644 index c172e53054..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:473c0111f5a1efb6791575c5f769431fa2affd76813aaf9d476a571e26cd3fed -size 1571154 diff --git a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab b/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab deleted file mode 100644 index 84c2e49f7c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DEC2006_d3dx9_32_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81251ebd8ee94f108807e32e04dea544c3937a5f870bc6ccb917d059e70b1838 -size 1574376 diff --git a/Tools/Redistributables/DirectX 9.0c/DSETUP.dll b/Tools/Redistributables/DirectX 9.0c/DSETUP.dll deleted file mode 100644 index f29cc3d578..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DSETUP.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a61679eeedabf7d0d0ac14e5447486575622d6b7cfa56f136c1576ff96da21f -size 95576 diff --git a/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe b/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe deleted file mode 100644 index 6b93909d18..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/DXSETUP.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f47d7121ef6532ad9ad9901e44e237f5c30448b752028c58a9d19521414e40d -size 517976 diff --git a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab b/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab deleted file mode 100644 index e775a2a8b8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8231b38a0ab70018f15d7239ed96e5f2bc89ddae6cf9650c9d7bd052b96877e3 -size 1357976 diff --git a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab b/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab deleted file mode 100644 index 86454423b4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Dec2005_d3dx9_28_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdee0708db956a4ce59220626106a2df70ede2e1e32f29e432254b04876fa7b9 -size 1079456 diff --git a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab deleted file mode 100644 index 2e2c35a180..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85d3279df02904f161f62f7a529911e135439ae26f4aa4984be439a4ac1768ab -size 194675 diff --git a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab deleted file mode 100644 index 96b93a2c92..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/FEB2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2446c0478d0087250c2f4f4cbdec7bdc9aec7ac92ca37b874c96aa3a3275dcd -size 147983 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab deleted file mode 100644 index 5be33e5b4a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48eeeecd6411039b23f32b7b22c8d40bce45280af5f8b066edd6cf30284b90ca -size 1247499 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab deleted file mode 100644 index 2ed0e17879..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2005_d3dx9_24_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12e2aab3dbaee503724a5505a6f6951f07306578801a4b5b6b9b54514275ce79 -size 1013225 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab deleted file mode 100644 index cb79f55355..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ea39caab8e071df53c2f44c19fb2ff6e2f6af4ef47f0c66d8e7b1b0918d6745f -size 178359 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab deleted file mode 100644 index dd87d1e7f2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:633a1fe357e57bbb8e058e1e029f61f379ab936a85c5d30ee442d804a1806868 -size 132409 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab deleted file mode 100644 index 9e8ae80d11..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:405bd17fe25128a91693807a6008031d87c005ba93d016cbab6276891d3bc6bb -size 1362796 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab deleted file mode 100644 index 2465317daa..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2006_d3dx9_29_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:20231448d5d74b7df1e43d796d76381d563699f81944c7ad9ccbcc1a77a5591e -size 1084720 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab deleted file mode 100644 index 4bd9c61e96..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:832b6d48e169b4725ae482ea4d1c3360a09631a89b2fac3aba81a50805a50adc -size 54678 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab deleted file mode 100644 index aac3d6e0f5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:acba5c4d4ac90e1df1c8404be5ff780e24238153cb410af909cd4364d213f2a9 -size 20713 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab deleted file mode 100644 index 65d5681887..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:42d7936ca7520a8092ccb82612d0217c755ecf619251fd2aa0c37ccfd8c49807 -size 122446 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab deleted file mode 100644 index 30931d7c9e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d168fcdd6b63c24f6f6d2851ad1d0d977146edd9f6377b46d8f87bf5a92a0693 -size 93180 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab deleted file mode 100644 index 54a5f9cbc4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:038a01a9b3ba4ceb4df4726a5704a5b325871c07e3714913c3a9ff4184a50df6 -size 276960 diff --git a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab deleted file mode 100644 index 086ffd2cbc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Feb2010_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86a653d6a77bad77df48a19669eb41dc402297b42d6f9ee239b39735be409d31 -size 277191 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab deleted file mode 100644 index 82090d645c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7bddd9db994cbb19671d45216edf40ffb3a77068cc97fbeb4c4e41e0d073501 -size 180785 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab deleted file mode 100644 index 1696587f03..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1a1348611259756b5921d43f9fd9f2a5b40a48af88ea679a40263a2aca029ec -size 133671 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab deleted file mode 100644 index 285768e9d5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e08de538c217d80b19bd56066a269ca9b388e63ff6f3807b369d7b6a7fe794f -size 197122 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab deleted file mode 100644 index 15fdc248b7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e28d18ef520ca81ff7d33dad80b6144771cb82516f01739cef8d3b813c74643d -size 152909 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab deleted file mode 100644 index 76478ca29d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ef426fdd89840ead821ee8fe7a6f470ad8bf06dbcf2ac7cc8e8a0dd0a55622d -size 699044 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab deleted file mode 100644 index c5b6b4de8b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx10_34_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:47b355fb5324776370e2bd27ca2df982a516611fc1e702d75a829b207b3b80f6 -size 698472 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab deleted file mode 100644 index 4841c81828..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c28c2018fcc72a9548a752e2917284320fc1a8848ae9d92bf3513aa312cafc29 -size 1607774 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab deleted file mode 100644 index 559505b2c7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2007_d3dx9_34_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9c3507b1dd4a81651a5013cb7ecb552932ce5989cbaadd4024f02918f55276ac -size 1607286 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab deleted file mode 100644 index 6b6be93338..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:627c66ed6f3b82c8a90f549584c324e33f039f397f196ce9eccb86de76efb574 -size 55154 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab deleted file mode 100644 index b81fafa4fc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:151d0be9d3fa6ce37f7aa8e047b8cc449e86398ed0623c3cc0e203ec221ebc2a -size 21905 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab deleted file mode 100644 index 6bd29b50c2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0736b0ab6eb8c91682f6934c9d4306fc134c65066f70f7f5f80031a927baa8d -size 121054 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab deleted file mode 100644 index 1cc499a4cc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f06de1eef8043f7919a50972df7d0653f9439b725769dae93536dea749b8e2d6 -size 93128 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab deleted file mode 100644 index a4c98b194a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b15a27080204b3c36b787f919cefbf9d441f0b0b616f8b944feb42dc4eb2ff1 -size 269628 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab deleted file mode 100644 index 23ece1c14d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:564696443875b094baafb5f4a151c25876ca537c1834356eddb979be0ca247ac -size 269024 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab deleted file mode 100644 index 36e5e9e8f1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:781eb9276ea0d737d82dc60753c6d6ff89e92d016b48a60e9b21d1a66b8eb545 -size 867828 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab deleted file mode 100644 index 9291c6bc10..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx10_38_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9b4110bd8004f83c0bfcef378071fd49c895294f4583e0b164317a692d9783c -size 849919 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab deleted file mode 100644 index afff0849b2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72e7f92c20462c4746ce000bc909ed6b3f71467f9e5593ba7c074be47553596d -size 1792608 diff --git a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab b/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab deleted file mode 100644 index 4e6c43868b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/JUN2008_d3dx9_38_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5906932933e363acb1651a6b1f252662fb3512ed54dd6b0b87baa141ed6fb21a -size 1463878 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab deleted file mode 100644 index 35779534f9..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7237630b897ce760948d9144151ef27c0699fb76150b5f157676fa2d220a236f -size 1336002 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab deleted file mode 100644 index e288c09019..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2005_d3dx9_26_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b448d7ba5b6fe1dc27639d42eb6ba0a997a793135678c729ba6756cfe4efc38b -size 1064925 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab deleted file mode 100644 index e7e8091043..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:213ad66ab9e469db1e6a49a646d082bfc3700db94172984e7e36801612af50c6 -size 944460 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab deleted file mode 100644 index afafdce4a8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_D3DCompiler_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:417eebd5b19f45c67c94c2d2ba8b774c0fc6d958b896d7b1ac12cf5a0ea06e0e -size 931471 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab deleted file mode 100644 index defb70d9ea..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:06251ab76450feb7dc2ffb9be7615f5eb56960cefa4c990ef560f2c6f2a7551b -size 124596 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab deleted file mode 100644 index fd808be92b..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:354c2e579ed00b391dd5d8be91b0f45115e7c232ed1b842747830be0fd26e915 -size 93686 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab deleted file mode 100644 index 75c30772ce..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:51500283f69e97f5beddb073ba2a9017de3d30379c0dcc4d11dd2236ce07b317 -size 277338 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab deleted file mode 100644 index aaa354134a..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b4332207563beba1103744b6db5399ad150e9e6838f9d5a71497e7eb3645ebf -size 278060 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab deleted file mode 100644 index 9f0efcb902..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cdbec7e3a5a0fef016eb294b036f93c75e45c6ead8d99397f859a32d23fe20cc -size 752783 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab deleted file mode 100644 index 47362daceb..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dcsx_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2c5a2cbba7f211b6ca72ff8e5f69cba1f83be06357311b19e64f582fd3d14e4 -size 762188 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab deleted file mode 100644 index 1de2c119c0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efce48d425c07f1faad4a55d7061a01ed6245aac17f43163cf2a23cbc9a3054b -size 235955 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab deleted file mode 100644 index e008cfcb55..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx10_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a8cf71ffb80b683616d0621be96d3795b0ffda3877ed2d80cd958bfa393ddcfc -size 197283 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab deleted file mode 100644 index 752bbfce78..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1d0d56b83bfb09a5e1a89e1898bb74446a847b30a968f3664ec2d87368eb63e -size 138205 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab deleted file mode 100644 index 6d806e2f63..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx11_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a58cefe822e371d078eaf89319f832693352ba7d62079320074397f0f3425961 -size 109445 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab deleted file mode 100644 index 996b0a7111..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9b98a1269af7f3a0007bfdc73206a47a6ee158d34ba8a87009396c18186bb06a -size 937246 diff --git a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab b/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab deleted file mode 100644 index d4b5470696..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Jun2010_d3dx9_43_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fcc6cf0966b4853d6fa3d32ab299cde5a9824feaecb0d4f34ea452fb9fd1c867 -size 768036 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab deleted file mode 100644 index da8df8c0e5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0209ae7c140b3b3a7635a00d7364591d6b3d017d6bb007f9e347767b00b1671 -size 55058 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab deleted file mode 100644 index 4afa8817e6..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15e0dcefc22fb6a09e3d8724fa5c17c23db01f10879f343e7da22938f568abd7 -size 21867 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab deleted file mode 100644 index 279af93cfc..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:221a6a70898c8d513fac732dfa0ada137b268cffc90875c05d1049ba8f2e3e5b -size 122336 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab deleted file mode 100644 index 479e121922..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1a429a0725765a5b302b83af062d2780859f0a52369b200d1b031e14f030ea0 -size 93734 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab deleted file mode 100644 index 95cac597f2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35d20903b1b246afda8c5205bfa3b253fbad5d3255ce14b5a8d5aaa6b6909dbc -size 251194 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab deleted file mode 100644 index a4bfd9cb63..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:786e6417d105b1dedcb502a799d7cd30a65cbe59a2b41a411781bdafa7fb1917 -size 226250 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab deleted file mode 100644 index e4fe991eca..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9eaba54ab5392802bee889982c585707797ae7810c1e7a66f98903fc963a9eab -size 844884 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab deleted file mode 100644 index 43386c0b1c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx10_37_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:de438d52b5f1141be26f7d06f283699d96827129da524a412e1605bd9c8e6b6a -size 818260 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab deleted file mode 100644 index cc77082f70..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33ed3e21fe9118bad3e11ee13a3f0b31c52ae7e22378ebf96de590b114c2ca02 -size 1769862 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab deleted file mode 100644 index 25c9afacd7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2008_d3dx9_37_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0be4fe173c7becbab42a25421f28d54629479e240a3378b37ac4b657bf60e128 -size 1443282 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab deleted file mode 100644 index 6be88e5590..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5fcb6f2d1dbf278c14813812448026a8d2bf2179bb4c2e807b9167fdb7966290 -size 54600 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab deleted file mode 100644 index 1d24996c1c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd713dc9d50cb72508f0c416f6861588f1227bb9f2e1a40a6f0e774be248bb8d -size 21298 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab deleted file mode 100644 index 88492dfdd1..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:63721ba32053e4f2b0905aab8e68fe63eadaae53543be89b2d5f082b10edf6a2 -size 121506 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab deleted file mode 100644 index 3cbdc6e86c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba7f2b4e34c355dae4ca2aeae585985f2626c69e4cf857b9db009d50a23b620c -size 92740 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab deleted file mode 100644 index dd342cb861..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e470186155459daf0674a30450a4887f941ca7dbdf9aa311fc4d4c87352529ba -size 275044 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab deleted file mode 100644 index b85f698b26..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c360b93d3e799d3502f0b6acf4139c058d7d47e63d41f4af0f2bff59b4742b2 -size 273018 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab deleted file mode 100644 index 74849d4c94..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4e78a01a3a5d236f27cda4a66a9d8a59c06e8a9779fd2f2a3e1f9b416d2c4213 -size 1067160 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab deleted file mode 100644 index 23220b1467..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx10_41_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80736b3fe97947507a32bf7cd744e01a86424c4cc9977f7b4a7404268e83f8c1 -size 1040745 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab deleted file mode 100644 index c3a5196d64..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:218929568334f78c93d3a111ad268ff56ed4a6fee83ce26dce0a2619a092f46b -size 1973702 diff --git a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab b/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab deleted file mode 100644 index 7fe08e22a5..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Mar2009_d3dx9_41_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74ff3ac77380b3a7271f22b21e019c50f6caa8585f0b59cca094e76ce170a28b -size 1612446 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab deleted file mode 100644 index 713f52616e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f954abaf7966b409d3db339f5dc491e103365f47b23faffca25d85ea3728f12f -size 46144 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab deleted file mode 100644 index d5c24ad5e2..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74a6d31a4c54d8c0fb2dcde922409c05db3219b7dcffa44c16f603ba054fb922 -size 18496 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab deleted file mode 100644 index 8d667fd54c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d01b468ec66b36bea0e20503c01b93ac64d9e001c20d28cf7c71293e9f874af0 -size 196762 diff --git a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab deleted file mode 100644 index 2d0c090be4..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/NOV2007_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c888a8a79249ab284a918c371f2fe6da81fdf432e65d3da3cd24fecede267aed -size 148264 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab deleted file mode 100644 index 340df57b33..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0847e4034d70ccbea527e04d14d8d60c9854ecc89cb29b3e07139e65962fbce9 -size 864600 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab deleted file mode 100644 index ca8858d6c8..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx10_36_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0da883c82456a5340411f222af5891fd370bf7efd919e90a48aec0f67f01ec80 -size 803884 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab deleted file mode 100644 index 54449d25c6..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39afab1a89bcf46806b422837da35ddc1b8eedf0393d875a89b47cde5fed79d4 -size 1802058 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab deleted file mode 100644 index 00309abc21..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2007_d3dx9_36_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:89026e7e14fff8164de3c13a774d539e789637104d7bc84b8bb4e059b76a9679 -size 1709360 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab deleted file mode 100644 index e537dc31ea..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8de7aedf7f823e455c663cec42b158f6d5308efd356a9cf9295ae49f7c8a3fdb -size 54522 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab deleted file mode 100644 index 7125770d80..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_X3DAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2264f092313682f4e274ad71030248fa2e23d202abc2d46ab09c7d6b580b81b -size 21851 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab deleted file mode 100644 index de505dcbda..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9dda7b01517451b9ca53abc3a4e61277481c4e8a6404d15450b5a416416b8016 -size 121794 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab deleted file mode 100644 index 3eed967dba..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b5594c1146a7753e8aeb0d235a060360b3072ba7b0fa122536d85b42df73a2e -size 92684 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab deleted file mode 100644 index 81d46c7221..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:980e6bb91d20d90225405887ebec47a7b1deee21faab4c561faae323007f6c98 -size 273960 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab deleted file mode 100644 index ba56b5d3d7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_XAudio_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00c28cd39034f7e1d434adc0bd39e4be29eabe8b73a2f3eaca6de11d2d22be95 -size 272611 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab deleted file mode 100644 index 6cb407859f..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a318a71b953f87ef0f5fad91a153f7ee251c8f895581950022f38f63d5f66cba -size 994154 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab deleted file mode 100644 index c900f04c6d..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx10_40_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4d7805c3db9fe72978fdd4c0c8ff973eed07ca6619d1c988cd01e08b70e1d137 -size 965421 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab deleted file mode 100644 index fc8f2d9201..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:723e8fcfe969493e6c4f79d2634c052eed9cd1e7051cfbf4466643b964fea29c -size 1906878 diff --git a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab b/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab deleted file mode 100644 index 541f1472e7..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Nov2008_d3dx9_40_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a259dd75611610bc0fd9c874e68ec89bbae4ac5f8db0857705a35de616604641 -size 1550796 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab deleted file mode 100644 index 33ff18117e..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db037f2b07f00a7aa481b12ed35d52e3b7c18bb786590eb444b27cf69a675f0f -size 182361 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab deleted file mode 100644 index 8ab0e813f0..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_XACT_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65916ca9db2d3eeb6a44f19a19c4254ca4fc1795bad81fda35e028d9b62e1d3d -size 138017 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab deleted file mode 100644 index ab691eea62..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cf78eeedcddddaf131af35cc68c218685c133326ff2876cb821096ed7ebf0c8 -size 1412902 diff --git a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab b/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab deleted file mode 100644 index acfb6f9c91..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/OCT2006_d3dx9_31_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd8c9c23aea007aa92eca130446913ef04d9fc78e0e6fc3c49c25d210889de61 -size 1127217 diff --git a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab b/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab deleted file mode 100644 index 8baa374c45..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x64.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:10f2bcfcc38d3150bc80eb0030a1cd40084f1ec028dc927543c485d54ec35022 -size 86037 diff --git a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab b/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab deleted file mode 100644 index bb91ccaa94..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/Oct2005_xinput_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2d475864e34409fb586093f92390e1f47403867c39ac30918941f19f3fccb0f -size 45359 diff --git a/Tools/Redistributables/DirectX 9.0c/dsetup32.dll b/Tools/Redistributables/DirectX 9.0c/dsetup32.dll deleted file mode 100644 index 7fd6d69402..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dsetup32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fb0e534f9b0926e518f1c2980640dfd29f14217cdfa37cf3a0c13349127ed9a8 -size 1566040 diff --git a/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab b/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab deleted file mode 100644 index 1a3f8d434c..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dxdllreg_x86.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4afe0249a13868b7c4a92b4d53c998adf6053eb5e2c47fd81020fd8d4bb11150 -size 44624 diff --git a/Tools/Redistributables/DirectX 9.0c/dxupdate.cab b/Tools/Redistributables/DirectX 9.0c/dxupdate.cab deleted file mode 100644 index b4be511234..0000000000 --- a/Tools/Redistributables/DirectX 9.0c/dxupdate.cab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e18a5404b612e88fa8b403c9b33f064c0a89528db7ef9a79aa116908d0e6afed -size 97152 diff --git a/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe b/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe deleted file mode 100644 index 8a0d6de867..0000000000 --- a/Tools/Redistributables/FFMpeg/win32/ffmpeg.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:178e2503062d15f3171953a39594854c31654f22c046faf019b77ff0a92302e3 -size 32841216 diff --git a/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe b/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe deleted file mode 100644 index d46fc8f5f8..0000000000 --- a/Tools/Redistributables/LuaCompiler/win32/LuaCompiler.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22b2527a7fd8e6ce35e54e8a1af7a86ce1036819db6764579f8840414ebd12e0 -size 315392 diff --git a/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest b/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest deleted file mode 100644 index 6e4241c925..0000000000 --- a/Tools/Redistributables/MSVC90/Microsoft.VC90.CRT.manifest +++ /dev/null @@ -1,6 +0,0 @@ - - - - - BYWvegEUfCyiVJwy7tplZYDLDYQ= VVIEvvi79NP3Y8CQaV7j2x7YotU= nS1i+ikFcD/ifqiOGZFwsZG9X/A= - \ No newline at end of file diff --git a/Tools/Redistributables/MSVC90/msvcr90.dll b/Tools/Redistributables/MSVC90/msvcr90.dll deleted file mode 100644 index c42cd731d8..0000000000 --- a/Tools/Redistributables/MSVC90/msvcr90.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5330682ae9c08e5f2e30c5e256b91028389bbbddaa8c38950df76616fca854ff -size 641360 diff --git a/Tools/Redistributables/OpenGL32/opengl32sw.dll b/Tools/Redistributables/OpenGL32/opengl32sw.dll deleted file mode 100644 index 05af1c04b7..0000000000 --- a/Tools/Redistributables/OpenGL32/opengl32sw.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9531e42f5e5e16901c669b2a0ba6ed70ff07fa3ae473b2b0128f907d89f981e -size 17593856 diff --git a/Tools/Redistributables/SSLEAY/win32/libeay32.dll b/Tools/Redistributables/SSLEAY/win32/libeay32.dll deleted file mode 100644 index 17a31bb4d4..0000000000 --- a/Tools/Redistributables/SSLEAY/win32/libeay32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40b9eda31bdbb74f8e3007da61846516a64cfdbf45afd9f1b30b725e92ac82f2 -size 2087424 diff --git a/Tools/Redistributables/SSLEAY/win32/ssleay32.dll b/Tools/Redistributables/SSLEAY/win32/ssleay32.dll deleted file mode 100644 index 6a0f2895e2..0000000000 --- a/Tools/Redistributables/SSLEAY/win32/ssleay32.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc92d16d24ca27c0ca7c5bcd486f7f440ccb07ebde69206135edb58654bf6481 -size 350208 diff --git a/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe b/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe deleted file mode 100644 index b404397acc..0000000000 --- a/Tools/Redistributables/Visual Studio 2012/vcredist_x64.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:681be3e5ba9fd3da02c09d7e565adfa078640ed66a0d58583efad2c1e3cc4064 -size 7186992 diff --git a/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe b/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe deleted file mode 100644 index 9040223c94..0000000000 --- a/Tools/Redistributables/Visual Studio 2015-2019/VC_redist.x64.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40ea2955391c9eae3e35619c4c24b5aaf3d17aeaa6d09424ee9672aa9372aeed -size 15060496 diff --git a/Tools/Redistributables/vc_mbcsmfc.exe b/Tools/Redistributables/vc_mbcsmfc.exe deleted file mode 100644 index 52b9d880ee..0000000000 --- a/Tools/Redistributables/vc_mbcsmfc.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:184a8fdf7e8989aa3440b93b7b26da868c00544beb051c268a26eca505767757 -size 67453208 From 1f77afae6ece720b27955118d62a6325c2a0cb87 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Fri, 2 Jul 2021 15:49:43 -0500 Subject: [PATCH 042/156] Fixing alpha affects specular showing up when the alpha mode is opaque or cut-out. It should only be available when mode is blended or tinted transparent. (#1830) Signed-off-by: Ken Pruiksma --- .../Materials/Types/StandardPBR_HandleOpacityMode.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua index c96c2ff585..7ec6a60320 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua @@ -82,6 +82,12 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("opacity.factor", mainVisibility) context:SetMaterialPropertyVisibility("opacity.doubleSided", mainVisibility) + if(opacityMode == OpacityMode_Blended or opacityMode == OpacityMode_TintedTransparent) then + context:SetMaterialPropertyVisibility("opacity.alphaAffectsSpecular", MaterialPropertyVisibility_Enabled) + else + context:SetMaterialPropertyVisibility("opacity.alphaAffectsSpecular", MaterialPropertyVisibility_Hidden) + end + if(mainVisibility == MaterialPropertyVisibility_Enabled) then local alphaSource = context:GetMaterialPropertyValue_enum("opacity.alphaSource") From 421e7cb88b4a53fa6947152f72817d6e6fcd118c Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 2 Jul 2021 13:54:44 -0700 Subject: [PATCH 043/156] Re-add default cursor image as an optional asset (#1831) Signed-off-by: abrmich --- Gems/LyShine/Assets/LyShine_Dependencies.xml | 8 +-- .../Button_Sliced_Normal.tif.exportsettings | 1 - .../Assets/Textures/Cursor_Default.tif | 3 + .../Textures/Cursor_Default.tif.assetinfo | 69 +++++++++++++++++++ Gems/LyShine/Assets/seedList.seed | 18 +---- Gems/LyShine/Code/Source/Draw2d.cpp | 7 +- .../Code/Source/LyShineSystemComponent.cpp | 2 +- 7 files changed, 77 insertions(+), 31 deletions(-) delete mode 100644 Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings create mode 100644 Gems/LyShine/Assets/Textures/Cursor_Default.tif create mode 100644 Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo diff --git a/Gems/LyShine/Assets/LyShine_Dependencies.xml b/Gems/LyShine/Assets/LyShine_Dependencies.xml index 83c63cfbd4..6297f55ffd 100644 --- a/Gems/LyShine/Assets/LyShine_Dependencies.xml +++ b/Gems/LyShine/Assets/LyShine_Dependencies.xml @@ -1,9 +1,3 @@ - - - - - - - + diff --git a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings b/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings deleted file mode 100644 index 1415bea891..0000000000 --- a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /dns=1 /preset=ReferenceImage_Linear /reduce=0 /ser=0 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif b/Gems/LyShine/Assets/Textures/Cursor_Default.tif new file mode 100644 index 0000000000..01e65389c3 --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a268774eb6d4d4590960c28edbf2a35d3fb7a73caab38d9ad15812c3df1c0c02 +size 4529 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo new file mode 100644 index 0000000000..47b628d60a --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/LyShine/Assets/seedList.seed b/Gems/LyShine/Assets/seedList.seed index f42f2a81bc..499469bd63 100644 --- a/Gems/LyShine/Assets/seedList.seed +++ b/Gems/LyShine/Assets/seedList.seed @@ -1,28 +1,12 @@ - - - - - - - - - - - - - - - - - + diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index c18dd6a4c4..b27d030bd6 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -536,22 +536,19 @@ AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size, //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Data::Instance CDraw2d::LoadTexture(const AZStd::string& pathName) { - AZStd::string sourceRelativePath(pathName); - AZStd::string cacheRelativePath = sourceRelativePath + ".streamingimage"; - // The file may not be in the AssetCatalog at this point if it is still processing or doesn't exist on disk. // Use GenerateAssetIdTEMP instead of GetAssetIdByPath so that it will return a valid AssetId anyways AZ::Data::AssetId streamingImageAssetId; AZ::Data::AssetCatalogRequestBus::BroadcastResult( streamingImageAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GenerateAssetIdTEMP, - sourceRelativePath.c_str()); + pathName.c_str()); streamingImageAssetId.m_subId = AZ::RPI::StreamingImageAsset::GetImageAssetSubId(); auto streamingImageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(streamingImageAssetId, AZ::Data::AssetLoadBehavior::PreLoad); AZ::Data::Instance image = AZ::RPI::StreamingImage::FindOrCreate(streamingImageAsset); if (!image) { - AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", streamingImageAsset.GetHint().c_str()); + AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", pathName.c_str()); } return image; diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index 26e2adf0b3..7521c8b6c1 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -135,7 +135,7 @@ namespace LyShine //////////////////////////////////////////////////////////////////////////////////////////////////// LyShineSystemComponent::LyShineSystemComponent() { - m_cursorImagePathname.SetAssetPath("engineassets/textures/cursor_green.tif"); + m_cursorImagePathname.SetAssetPath("Textures/Cursor_Default.tif"); } //////////////////////////////////////////////////////////////////////////////////////////////////// From 81e39df248f2dfe031c8fec8b1743dd98224de73 Mon Sep 17 00:00:00 2001 From: jackalbe <23512001+jackalbe@users.noreply.github.com> Date: Fri, 2 Jul 2021 16:32:16 -0500 Subject: [PATCH 044/156] {LYN-4456} FIX: assign branch token for LegacyTestAdapter (#1833) * fixes AssetProcessorManagerUnitTests unexpectedly fails due to writing out the branch token * instead, the branch token is calculated ahead of time and added to the settings registry Tests: --gtest_filter=Test/LegacyTestAdapter.* --- .../native/tests/AssetProcessorTest.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index 2b80a3acbf..046c305518 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "BaseAssetProcessorTest.h" #include @@ -67,11 +68,19 @@ namespace AssetProcessor static char** paramStringArray = &namePtr; auto registry = AZ::SettingsRegistry::Get(); - auto projectPathKey = - AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + auto bootstrapKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey); + auto projectPathKey = bootstrapKey + "/project_path"; registry->Set(projectPathKey, "AutomatedTesting"); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); - + + // Forcing the branch token into settings registry before starting the application manager. + // This avoids writing the asset_processor.setreg file which can cause fileIO errors. + AZ::IO::FixedMaxPathString enginePath = AZ::Utils::GetEnginePath(); + auto branchTokenKey = bootstrapKey + "/assetProcessor_branch_token"; + AZStd::string token; + AzFramework::StringFunc::AssetPath::CalculateBranchToken(enginePath.c_str(), token); + registry->Set(branchTokenKey, token.c_str()); + m_application.reset(new UnitTestAppManager(&numParams, ¶mStringArray)); ASSERT_EQ(m_application->BeforeRun(), ApplicationManager::Status_Success); ASSERT_TRUE(m_application->PrepareForTests()); From 497059bea77128c1df074cc9f93b6597fcc2f4d2 Mon Sep 17 00:00:00 2001 From: Mike Chang <62353586+amzn-changml@users.noreply.github.com> Date: Fri, 2 Jul 2021 15:37:54 -0700 Subject: [PATCH 045/156] Update 3p CDN to https (#1807) * Update CDN address to https Signed-off-by: changml --- cmake/3rdPartyPackages.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index c13eecbee4..9a632798e8 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -28,7 +28,7 @@ include(cmake/LySet.cmake) # also allowed: # "s3://bucketname" (it will use LYPackage_S3Downloader.cmake to download it from a s3 bucket) -set(LY_PACKAGE_SERVER_URLS "http://d3t6xeg4fgfoum.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") +set(LY_PACKAGE_SERVER_URLS "https://d3t6xeg4fgfoum.cloudfront.net" CACHE STRING "Server URLS to fetch packages from") # Note: if you define the "LY_PACKAGE_SERVER_URLS" environment variable # it will be added to this value in the front, so that users can set # an env var and use that as an "additional" set of servers beyond the default set. From 9dbafa72a8e92e68fb0665806a4e4ad83f886760 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 2 Jul 2021 15:42:09 -0700 Subject: [PATCH 046/156] Remove deprecated prefab support from UI Editor (#1754) * Remove old prefab support from UI Editor Signed-off-by: abrmich * Delete deprecated prefab files that are no longer supported in UI Editor Signed-off-by: abrmich --- .../CryCommon/LyShine/Bus/UiCanvasBus.h | 25 - Gems/LyShine/Code/Editor/EditorCommon.h | 3 - Gems/LyShine/Code/Editor/EditorMenu.cpp | 13 - Gems/LyShine/Code/Editor/EditorWindow.cpp | 43 -- Gems/LyShine/Code/Editor/EditorWindow.h | 9 - Gems/LyShine/Code/Editor/HierarchyMenu.cpp | 41 +- Gems/LyShine/Code/Editor/HierarchyMenu.h | 11 - Gems/LyShine/Code/Editor/HierarchyWidget.cpp | 2 - .../Code/Editor/NewElementToolbarSection.cpp | 1 - Gems/LyShine/Code/Editor/PrefabHelpers.cpp | 199 ------- Gems/LyShine/Code/Editor/PrefabHelpers.h | 18 - Gems/LyShine/Code/Editor/ViewportWidget.cpp | 2 - .../LyShine/Code/Source/UiCanvasComponent.cpp | 168 ------ Gems/LyShine/Code/Source/UiCanvasComponent.h | 5 - Gems/LyShine/Code/Source/UiSerialize.cpp | 53 -- Gems/LyShine/Code/Source/UiSerialize.h | 14 - .../Code/lyshine_uicanvaseditor_files.cmake | 2 - .../Assets/UI/Prefabs/Button.uiprefab | 201 ------- .../Assets/UI/Prefabs/Checkbox.uiprefab | 346 ------------ .../UiBasics/Assets/UI/Prefabs/Image.uiprefab | 66 --- .../Assets/UI/Prefabs/LayoutColumn.uiprefab | 67 --- .../Assets/UI/Prefabs/LayoutGrid.uiprefab | 74 --- .../Assets/UI/Prefabs/LayoutRow.uiprefab | 67 --- .../UI/Prefabs/ScrollBarHorizontal.uiprefab | 175 ------ .../UI/Prefabs/ScrollBarVertical.uiprefab | 175 ------ .../Assets/UI/Prefabs/ScrollBox.uiprefab | 526 ------------------ .../Assets/UI/Prefabs/Slider.uiprefab | 339 ----------- Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab | 71 --- .../Assets/UI/Prefabs/TextInput.uiprefab | 351 ------------ .../Assets/UI/Prefabs/TooltipDisplay.uiprefab | 154 ----- 30 files changed, 1 insertion(+), 3220 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/PrefabHelpers.cpp delete mode 100644 Gems/LyShine/Code/Editor/PrefabHelpers.h delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab delete mode 100644 Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab diff --git a/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h b/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h index 894f97c9fe..744cb19a12 100644 --- a/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h +++ b/Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h @@ -20,14 +20,6 @@ struct IUiAnimationSystem; class UiCanvasInterface : public AZ::ComponentBus { -public: // types - - enum class ErrorCode - { - NoError, - PrefabContainsExternalEntityRefs - }; - public: // member functions //! Deleting a canvas will delete all its child elements recursively and all of their components @@ -110,23 +102,6 @@ public: // member functions //! \return true if no error virtual bool SaveToXml(const string& assetIdPathname, const string& sourceAssetPathname) = 0; - //! Save the given UI element entity to the given path as a prefab - //! \param pathname the path to save the prefab to - //! \param entity pointer to the entity to save as a prefab - //! \return true if no error - virtual bool SaveAsPrefab(const string& pathname, AZ::Entity* entity) = 0; - - //! Check if it is OK to save the given UI element entity to the given path as a prefab - //! \param entity pointer to the entity to save as a prefab - //! \return errorCode which is NoError if OK to save - virtual ErrorCode CheckElementValidToSaveAsPrefab(AZ::Entity* entity) = 0; - - //! Load a prefab element from the given file and optionally insert as child of given entity - //! \return the top level entity created - virtual AZ::Entity* LoadFromPrefab(const string& pathname, - bool makeUniqueName, - AZ::Entity* optionalInsertionPoint) = 0; - //! Initialize a set of entities that have been added to the canvas //! Used when instantiating a slice or for undo/redo, copy/paste //! \param topLevelEntities - The elements that were created diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 04dc03f8a0..f6b9dc1458 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -112,7 +112,6 @@ enum class FusibleCommand #include "FileHelpers.h" #include "ComponentHelpers.h" #include "HierarchyHelpers.h" -#include "PrefabHelpers.h" #include "UiSliceManager.h" #include "SelectionHelpers.h" #include "ViewportInteraction.h" @@ -173,8 +172,6 @@ bool ClipboardContainsOurDataType(); #define UICANVASEDITOR_COORDINATE_SYSTEM_CYCLE_SHORTCUT_KEY_SEQUENCE QKeySequence(Qt::CTRL + Qt::Key_W) #define UICANVASEDITOR_SNAP_TO_GRID_TOGGLE_SHORTCUT_KEY_SEQUENCE QKeySequence(Qt::Key_G) -#define UICANVASEDITOR_PREFAB_EXTENSION "uiprefab" - #define UICANVASEDITOR_CANVAS_DIRECTORY "UI/Canvases" #define UICANVASEDITOR_CANVAS_EXTENSION "uicanvas" diff --git a/Gems/LyShine/Code/Editor/EditorMenu.cpp b/Gems/LyShine/Code/Editor/EditorMenu.cpp index 039ed7f3ca..ec56c316ee 100644 --- a/Gems/LyShine/Code/Editor/EditorMenu.cpp +++ b/Gems/LyShine/Code/Editor/EditorMenu.cpp @@ -146,19 +146,6 @@ void EditorWindow::AddMenu_File() menu->addSeparator(); - // "Save as Prefab..." file menu option - { - HierarchyWidget* widget = GetHierarchy(); - QAction* action = PrefabHelpers::CreateSavePrefabAction(widget); - action->setEnabled(canvasLoaded); - - // This menu option is always available to the user - menu->addAction(action); - addAction(action); // Also add the action to the window until the shortcut dispatcher can find the menu action - } - - menu->addSeparator(); - // Close the active canvas { QAction* action = CreateCloseCanvasAction(GetCanvas()); diff --git a/Gems/LyShine/Code/Editor/EditorWindow.cpp b/Gems/LyShine/Code/Editor/EditorWindow.cpp index 0edc1e6151..7db6de5fc4 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.cpp +++ b/Gems/LyShine/Code/Editor/EditorWindow.cpp @@ -128,7 +128,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags) , m_previewActionLogDockWidget(nullptr) , m_previewAnimationListDockWidget(nullptr) , m_editorMode(UiEditorMode::Edit) - , m_prefabFiles() , m_actionsEnabledWithSelection() , m_pasteAsSiblingAction(nullptr) , m_pasteAsChildAction(nullptr) @@ -160,8 +159,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags) connect(m_hierarchy, &HierarchyWidget::SetUserSelection, this, &EditorWindow::UpdateActionsEnabledState); m_clipboardConnection = connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &EditorWindow::UpdateActionsEnabledState); - UpdatePrefabFiles(); - // Create the cursor to be used when picking an element in the hierarchy or viewport during object pick mode. // Uses the default hot spot which is the center of the image m_entityPickerCursor = QCursor(QPixmap(UICANVASEDITOR_ENTITY_PICKER_CURSOR)); @@ -1551,46 +1548,6 @@ AssetTreeEntry* EditorWindow::GetSliceLibraryTree() return m_sliceLibraryTree; } -void EditorWindow::UpdatePrefabFiles() -{ - m_prefabFiles.clear(); - - // IMPORTANT: ScanDirectory() is VERY slow. It can easily take as much - // as a whole second to execute. That's why we want to cache its result - // up front and ONLY access the cached data. - GetIEditor()->GetFileUtil()->ScanDirectory("", "*." UICANVASEDITOR_PREFAB_EXTENSION, m_prefabFiles); - SortPrefabsList(); -} - -IFileUtil::FileArray& EditorWindow::GetPrefabFiles() -{ - return m_prefabFiles; -} - -void EditorWindow::AddPrefabFile(const QString& prefabFilename) -{ - IFileUtil::FileDesc fd; - fd.filename = prefabFilename; - m_prefabFiles.push_back(fd); - SortPrefabsList(); -} - -void EditorWindow::SortPrefabsList() -{ - AZStd::sort(m_prefabFiles.begin(), m_prefabFiles.end(), - [](const IFileUtil::FileDesc& fd1, const IFileUtil::FileDesc& fd2) - { - // Some of the files in the list are in different directories, so we - // explicitly sort by filename only. - AZStd::string fd1Filename; - AzFramework::StringFunc::Path::GetFileName(fd1.filename.toUtf8().data(), fd1Filename); - - AZStd::string fd2Filename; - AzFramework::StringFunc::Path::GetFileName(fd2.filename.toUtf8().data(), fd2Filename); - return fd1Filename < fd2Filename; - }); -} - void EditorWindow::ToggleEditorMode() { m_editorMode = (m_editorMode == UiEditorMode::Edit) ? UiEditorMode::Preview : UiEditorMode::Edit; diff --git a/Gems/LyShine/Code/Editor/EditorWindow.h b/Gems/LyShine/Code/Editor/EditorWindow.h index 0f2dd39210..b00ae7ab95 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.h +++ b/Gems/LyShine/Code/Editor/EditorWindow.h @@ -139,11 +139,6 @@ public: // member functions AssetTreeEntry* GetSliceLibraryTree(); - //! WARNING: This is a VERY slow function. - void UpdatePrefabFiles(); - IFileUtil::FileArray& GetPrefabFiles(); - void AddPrefabFile(const QString& prefabFilename); - //! Returns the current mode of the editor (Edit or Preview) UiEditorMode GetEditorMode() { return m_editorMode; } @@ -325,8 +320,6 @@ private: // member functions QAction* CreateCloseAllOtherCanvasesAction(AZ::EntityId canvasEntityId, bool forContextMenu = false); QAction* CreateCloseAllCanvasesAction(bool forContextMenu = false); - void SortPrefabsList(); - void SaveModeSettings(UiEditorMode mode, bool syncSettings); void RestoreModeSettings(UiEditorMode mode); @@ -391,8 +384,6 @@ private: // data //! This tree caches the folder view of all the slice assets under the slice library path AssetTreeEntry* m_sliceLibraryTree = nullptr; - IFileUtil::FileArray m_prefabFiles; - //! Values for setting up undoable canvas/entity changes SerializeHelpers::SerializedEntryList m_preChangeState; bool m_haveValidEntitiesPreChangeState = false; diff --git a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp index 3758041f7a..72868dccdb 100644 --- a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp @@ -26,8 +26,7 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList selectedItems = hierarchy->selectedItems(); - if (showMask & (Show::kNew_EmptyElement | Show::kNew_ElementFromPrefabs | - Show::kNew_EmptyElementAtRoot | Show::kNew_ElementFromPrefabsAtRoot)) + if (showMask & (Show::kNew_EmptyElement | Show::kNew_EmptyElementAtRoot)) { QMenu* menu = (addMenuForNewElement ? addMenu("&New...") : this); @@ -40,11 +39,6 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, { New_ElementFromSlice(hierarchy, selectedItems, menu, (showMask & Show::kNew_InstantiateSliceAtRoot), optionalPos); } - - if (showMask & (Show::kNew_ElementFromPrefabs | Show::kNew_ElementFromPrefabsAtRoot)) - { - New_ElementFromPrefabs(hierarchy, selectedItems, menu, (showMask & Show::kNew_ElementFromPrefabsAtRoot), optionalPos); - } } if (showMask & (Show::kNewSlice | Show::kPushToSlice)) @@ -52,11 +46,6 @@ HierarchyMenu::HierarchyMenu(HierarchyWidget* hierarchy, SliceMenuItems(hierarchy, selectedItems, showMask); } - if (showMask & Show::kSavePrefab) - { - SavePrefab(hierarchy, selectedItems); - } - addSeparator(); if (showMask & Show::kCutCopyPaste) @@ -192,21 +181,6 @@ void HierarchyMenu::CutCopyPaste(HierarchyWidget* hierarchy, } } -void HierarchyMenu::SavePrefab(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems) -{ - QAction* action = PrefabHelpers::CreateSavePrefabAction(hierarchy); - - // Only enable "save as prefab" option if exactly one element is selected - // in the hierarchy pane - if (selectedItems.size() != 1) - { - action->setEnabled(false); - } - - addAction(action); -} - void HierarchyMenu::SliceMenuItems(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, size_t showMask) @@ -404,19 +378,6 @@ void HierarchyMenu::New_EmptyElement(HierarchyWidget* hierarchy, optionalPos)); } -void HierarchyMenu::New_ElementFromPrefabs(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* menu, - bool addAtRoot, - const QPoint* optionalPos) -{ - PrefabHelpers::CreateAddPrefabMenu(hierarchy, - selectedItems, - menu, - addAtRoot, - optionalPos); -} - void HierarchyMenu::New_ElementFromSlice(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, QMenu* menu, diff --git a/Gems/LyShine/Code/Editor/HierarchyMenu.h b/Gems/LyShine/Code/Editor/HierarchyMenu.h index 69432a4d24..9d73c083f9 100644 --- a/Gems/LyShine/Code/Editor/HierarchyMenu.h +++ b/Gems/LyShine/Code/Editor/HierarchyMenu.h @@ -26,11 +26,8 @@ public: kNone = 0x0000, kCutCopyPaste = 0x0001, - kSavePrefab = 0x0002, kNew_EmptyElement = 0x0004, kNew_EmptyElementAtRoot = 0x0008, - kNew_ElementFromPrefabs = 0x0010, - kNew_ElementFromPrefabsAtRoot = 0x0020, kAddComponents = 0x0040, kDeleteElement = 0x0080, kNewSlice = 0x0100, @@ -52,9 +49,6 @@ private: void CutCopyPaste(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems); - void SavePrefab(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems); - void SliceMenuItems(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, size_t showMask); @@ -64,11 +58,6 @@ private: QMenu* menu, bool addAtRoot, const QPoint* optionalPos); - void New_ElementFromPrefabs(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* menu, - bool addAtRoot, - const QPoint* optionalPos); void New_ElementFromSlice(HierarchyWidget* hierarchy, QTreeWidgetItemRawPtrQList& selectedItems, QMenu* menu, diff --git a/Gems/LyShine/Code/Editor/HierarchyWidget.cpp b/Gems/LyShine/Code/Editor/HierarchyWidget.cpp index 9b72f2407f..e5d39282b2 100644 --- a/Gems/LyShine/Code/Editor/HierarchyWidget.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyWidget.cpp @@ -235,9 +235,7 @@ void HierarchyWidget::contextMenuEvent(QContextMenuEvent* ev) { HierarchyMenu contextMenu(this, (HierarchyMenu::Show::kCutCopyPaste | - HierarchyMenu::Show::kSavePrefab | HierarchyMenu::Show::kNew_EmptyElement | - HierarchyMenu::Show::kNew_ElementFromPrefabs | HierarchyMenu::Show::kDeleteElement | HierarchyMenu::Show::kNewSlice | HierarchyMenu::Show::kNew_InstantiateSlice | diff --git a/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp b/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp index c8de5afb11..d9342fe412 100644 --- a/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp +++ b/Gems/LyShine/Code/Editor/NewElementToolbarSection.cpp @@ -21,7 +21,6 @@ NewElementToolbarSection::NewElementToolbarSection(QToolBar* parent, bool addSep { HierarchyMenu contextMenu(editorWindow->GetHierarchy(), (HierarchyMenu::Show::kNew_EmptyElementAtRoot | - HierarchyMenu::Show::kNew_ElementFromPrefabsAtRoot | HierarchyMenu::Show::kNew_InstantiateSliceAtRoot), false); diff --git a/Gems/LyShine/Code/Editor/PrefabHelpers.cpp b/Gems/LyShine/Code/Editor/PrefabHelpers.cpp deleted file mode 100644 index c6f81dd56e..0000000000 --- a/Gems/LyShine/Code/Editor/PrefabHelpers.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "UiCanvasEditor_precompiled.h" - -#include "EditorCommon.h" -#include "AzFramework/StringFunc/StringFunc.h" -#include "Util/PathUtil.h" - -#include -#include - -namespace PrefabHelpers -{ - QAction* CreateSavePrefabAction(HierarchyWidget* hierarchy) - { - QAction* action = new QAction("(Deprecated) Save as Prefab...", hierarchy); - QObject::connect(action, - &QAction::triggered, - hierarchy, - [ hierarchy ]([[maybe_unused]] bool checked) - { - // Note that selectedItems() can be expensive, so call it once and save the value. - QTreeWidgetItemRawPtrQList selectedItems(hierarchy->selectedItems()); - if (selectedItems.isEmpty()) - { - QMessageBox(QMessageBox::Information, - "Selection Needed", - "Please select an element in the Hierarchy pane", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - - return; - } - else if (selectedItems.size() > 1) - { - QMessageBox(QMessageBox::Information, - "Too Many Items Selected", - "Please select only one element in the Hierarchy pane", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - - return; - } - - QString selectedFile = QFileDialog::getSaveFileName(nullptr, - QString(), - FileHelpers::GetAbsoluteGameDir(), - "*." UICANVASEDITOR_PREFAB_EXTENSION, - nullptr, - QFileDialog::DontConfirmOverwrite); - if (selectedFile.isEmpty()) - { - // Nothing to do. - return; - } - - FileHelpers::AppendExtensionIfNotPresent(selectedFile, UICANVASEDITOR_PREFAB_EXTENSION); - - AZ::EntityId canvasEntityId = hierarchy->GetEditorWindow()->GetCanvas(); - - // We've already checked if selectedItems is empty, so calling front() should be fine here - HierarchyItem* hierarchyItem = HierarchyItem::RttiCast(selectedItems.front()); - AZ::Entity* element = hierarchyItem->GetElement(); - - // Check if this element is OK to save as a prefab - UiCanvasInterface::ErrorCode errorCode = UiCanvasInterface::ErrorCode::NoError; - EBUS_EVENT_ID_RESULT(errorCode, canvasEntityId, UiCanvasBus, CheckElementValidToSaveAsPrefab, - element); - - if (errorCode != UiCanvasInterface::ErrorCode::NoError) - { - if (errorCode == UiCanvasInterface::ErrorCode::PrefabContainsExternalEntityRefs) - { - QMessageBox box(QMessageBox::Question, - "External references", - "The selected element contains references to elements that will not be in the prefab.\n" - "If saved these references will be cleared in the prefab.\n\n" - "Do you wish to save as prefab anyway?", - (QMessageBox::Yes | QMessageBox::No), hierarchy->GetEditorWindow()); - box.setDefaultButton(QMessageBox::No); - - int result = box.exec(); - if (result == QMessageBox::No) - { - return; - } - } - else - { - // this should never happen, but will if we forget to update this code when a new error is - // added - QMessageBox(QMessageBox::Information, - "Cannot save as prefab", - "Unknown error", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - return; - } - } - - FileHelpers::SourceControlAddOrEdit(selectedFile.toStdString().c_str(), hierarchy->GetEditorWindow()); - - bool saveSuccessful = false; - EBUS_EVENT_ID_RESULT(saveSuccessful, canvasEntityId, UiCanvasBus, SaveAsPrefab, - selectedFile.toStdString().c_str(), element); - - // Refresh the menu to update "Add prefab...". - if (saveSuccessful) - { - QString gamePath(Path::FullPathToGamePath(selectedFile)); - hierarchy->GetEditorWindow()->AddPrefabFile(gamePath); - - return; - } - - QMessageBox(QMessageBox::Critical, - "Error", - "Unable to save file. Is the file read-only?", - QMessageBox::Ok, hierarchy->GetEditorWindow()).exec(); - }); - - return action; - } - - void CreateAddPrefabMenu(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* parent, - bool addAtRoot, - const QPoint* optionalPos) - { - // Find all the prefabs in the project directory and in any enabled Gems - IFileUtil::FileArray& files = hierarchy->GetEditorWindow()->GetPrefabFiles(); - if (files.empty()) - { - // Since this feature is deprecated we don't show the menu unles there are prefabs - return; - } - - QMenu* prefabMenu = parent->addMenu(QString("(Deprecated) Element%1 from prefab").arg(!addAtRoot && selectedItems.size() > 1 ? "s" : "")); - - QList result; - { - for (auto file : files) - { - // Get the filepath from the engine root directory - QString fullFileName = Path::GamePathToFullPath(file.filename); - QString filepath(fullFileName); - - // Extract the filename without its extension, get it from fullFileName rather than - // file.filename because the former preserves case - AZStd::string filename; - AzFramework::StringFunc::Path::GetFileName(fullFileName.toUtf8().data(), filename); - - QAction* action = new QAction(filename.c_str(), prefabMenu); - QObject::connect(action, - &QAction::triggered, - hierarchy, - [filepath, hierarchy, addAtRoot, optionalPos]([[maybe_unused]] bool checked) - { - if (addAtRoot) - { - hierarchy->clearSelection(); - } - - CommandHierarchyItemCreateFromData::Push(hierarchy->GetEditorWindow()->GetActiveStack(), - hierarchy, - hierarchy->selectedItems(), - true, - [hierarchy, filepath, optionalPos](HierarchyItem* parent, - LyShine::EntityArray& listOfNewlyCreatedTopLevelElements) - { - AZ::Entity* newEntity = nullptr; - EBUS_EVENT_ID_RESULT(newEntity, - hierarchy->GetEditorWindow()->GetCanvas(), - UiCanvasBus, - LoadFromPrefab, - filepath.toStdString().c_str(), - true, - (parent ? parent->GetElement() : nullptr)); - if (newEntity) - { - if (optionalPos) - { - EntityHelpers::MoveElementToGlobalPosition(newEntity, *optionalPos); - } - - listOfNewlyCreatedTopLevelElements.push_back(newEntity); - } - }, - "Prefab"); - }); - result.push_back(action); - } - } - - prefabMenu->addActions(result); - } -} // namespace PrefabHelpers diff --git a/Gems/LyShine/Code/Editor/PrefabHelpers.h b/Gems/LyShine/Code/Editor/PrefabHelpers.h deleted file mode 100644 index 5d39513715..0000000000 --- a/Gems/LyShine/Code/Editor/PrefabHelpers.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 PrefabHelpers -{ - QAction* CreateSavePrefabAction(HierarchyWidget* hierarchy); - - void CreateAddPrefabMenu(HierarchyWidget* hierarchy, - QTreeWidgetItemRawPtrQList& selectedItems, - QMenu* parent, - bool addAtRoot, - const QPoint* optionalPos); -} // namespace PrefabHelpers diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index fd1374f31a..af0f93d8fa 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -428,9 +428,7 @@ void ViewportWidget::contextMenuEvent(QContextMenuEvent* e) const QPoint pos = e->pos(); HierarchyMenu contextMenu(m_editorWindow->GetHierarchy(), HierarchyMenu::Show::kCutCopyPaste | - HierarchyMenu::Show::kSavePrefab | HierarchyMenu::Show::kNew_EmptyElement | - HierarchyMenu::Show::kNew_ElementFromPrefabs | HierarchyMenu::Show::kDeleteElement | HierarchyMenu::Show::kNewSlice | HierarchyMenu::Show::kNew_InstantiateSlice | diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index b678089cb4..1978aa8909 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -590,174 +590,6 @@ bool UiCanvasComponent::SaveToXml(const string& assetIdPathname, const string& s return result; } -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiCanvasInterface::ErrorCode UiCanvasComponent::CheckElementValidToSaveAsPrefab(AZ::Entity* entity) -{ - AZ_Assert(entity, "null entity ptr passed to SaveAsPrefab"); - - // Check that none of the EntityId's in this entity or its children reference entities that - // are not part of the prefab. - // First make a list of all entityIds that will be in the prefab - AZStd::vector entitiesInPrefab = GetEntityIdsOfElementAndDescendants(entity); - - // Next check all entity refs in the element to see if any are externel - // We use ReplaceEntityRefs even though we don't want to change anything - bool foundRefOutsidePrefab = false; - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - AZ::EntityUtils::ReplaceEntityRefs(entity, [&](const AZ::EntityId& key, bool /*isEntityId*/) -> AZ::EntityId - { - if (key.IsValid()) - { - auto iter = AZStd::find(entitiesInPrefab.begin(), entitiesInPrefab.end(), key); - if (iter == entitiesInPrefab.end()) - { - foundRefOutsidePrefab = true; - } - } - return key; // always leave key unchanged - }, context); - - if (foundRefOutsidePrefab) - { - return UiCanvasInterface::ErrorCode::PrefabContainsExternalEntityRefs; - } - - return UiCanvasInterface::ErrorCode::NoError; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiCanvasComponent::SaveAsPrefab(const string& pathname, AZ::Entity* entity) -{ - AZ_Assert(entity, "null entity ptr passed to SaveAsPrefab"); - - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - - // To be sure that we do not save an invalid prefab, if this entity contains entity references - // outside of the prefab set them to invalid references - // First make a list of all entityIds that will be in the prefab - AZStd::vector entitiesInPrefab = GetEntityIdsOfElementAndDescendants(entity); - - // Next make a serializable object containing all the entities to save (in order to check for invalid refs) - AZ::SliceComponent::InstantiatedContainer sourceObjects(false); - for (const AZ::EntityId& id : entitiesInPrefab) - { - AZ::Entity* sourceEntity = nullptr; - EBUS_EVENT_RESULT(sourceEntity, AZ::ComponentApplicationBus, FindEntity, id); - if (sourceEntity) - { - sourceObjects.m_entities.push_back(sourceEntity); - } - } - - // clone all the objects in order to replace external references - AZ::SliceComponent::InstantiatedContainer* clonedObjects = context->CloneObject(&sourceObjects); - AZ::Entity* clonedRootEntity = clonedObjects->m_entities[0]; - - // use ReplaceEntityRefs to replace external references with invalid IDs - // Note that we are not generating new IDs so we do not need to fixup internal references - AZ::EntityUtils::ReplaceEntityRefs(clonedObjects, [&](const AZ::EntityId& key, bool /*isEntityId*/) -> AZ::EntityId - { - if (key.IsValid()) - { - auto iter = AZStd::find(entitiesInPrefab.begin(), entitiesInPrefab.end(), key); - if (iter == entitiesInPrefab.end()) - { - return AZ::EntityId(); - } - } - return key; // leave key unchanged - }, context); - - // make a wrapper object around the prefab entity so that we have an opportunity to change what - // is in a prefab file in future. - UiSerialize::PrefabFileObject fileObject; - fileObject.m_rootEntityId = clonedRootEntity->GetId(); - - // add all of the entities that are not the root entity to a childEntities list - for (auto descendant : clonedObjects->m_entities) - { - fileObject.m_entities.push_back(descendant); - } - - bool result = AZ::Utils::SaveObjectToFile(pathname.c_str(), AZ::ObjectStream::ST_XML, &fileObject); - - // now delete the cloned entities we created, fixed up and saved - delete clonedObjects; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiCanvasComponent::LoadFromPrefab(const string& pathname, bool makeUniqueName, AZ::Entity* optionalInsertionPoint) -{ - AZ::Entity* newEntity = nullptr; - - // Currently LoadObjectFromFile will hang if the file cannot be parsed - // (LMBR-10078). So first check that it is in the right format - if (!IsValidAzSerializedFile(pathname)) - { - return nullptr; - } - - // The top level object in the file is a wrapper object called PrefabFileObject - // this is to give us more protection against changes to what we store in the file in future - // NOTE: this read doesn't support pak files but that is OK because prefab files are an - // editor only feature. - UiSerialize::PrefabFileObject* fileObject = - AZ::Utils::LoadObjectFromFile(pathname.c_str()); - AZ_Assert(fileObject, "Failed to load prefab"); - - if (fileObject) - { - // We want new IDs so generate them and fixup all references within the list of entities - { - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(context, "No serialization context found"); - - AZ::SliceComponent::EntityIdToEntityIdMap entityIdMap; - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(fileObject, entityIdMap, context); - } - - // add all of the entities to this canvases EntityContext - m_entityContext->AddUiEntities(fileObject->m_entities); - - EBUS_EVENT_RESULT(newEntity, AZ::ComponentApplicationBus, FindEntity, fileObject->m_rootEntityId); - - delete fileObject; // we do not keep the file wrapper object around - - if (makeUniqueName) - { - AZ::EntityId parentEntityId; - if (optionalInsertionPoint) - { - parentEntityId = optionalInsertionPoint->GetId(); - } - AZStd::string uniqueName = GetUniqueChildName(parentEntityId, newEntity->GetName(), nullptr); - newEntity->SetName(uniqueName); - } - - UiElementComponent* elementComponent = newEntity->FindComponent(); - AZ_Assert(elementComponent, "No element component found on prefab entity"); - - AZ::Entity* parent = (optionalInsertionPoint) ? optionalInsertionPoint : GetRootElement(); - - // recursively visit all the elements and set their canvas and parent pointers - elementComponent->FixupPostLoad(newEntity, this, parent, true); - - // add this new entity as a child of the parent (insertionPoint or root) - UiElementComponent* parentElementComponent = parent->FindComponent(); - AZ_Assert(parentElementComponent, "No element component found on parent entity"); - parentElementComponent->AddChild(newEntity); - } - - return newEntity; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasComponent::FixupCreatedEntities(LyShine::EntityArray topLevelEntities, bool makeUniqueNamesAndIds, AZ::Entity* optionalInsertionPoint) { diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.h b/Gems/LyShine/Code/Source/UiCanvasComponent.h index df904684ec..b4815f4a76 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.h +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.h @@ -99,11 +99,6 @@ public: // member functions AZ::EntityId FindInteractableToHandleEvent(AZ::Vector2 point) override; bool SaveToXml(const string& assetIdPathname, const string& sourceAssetPathname) override; - bool SaveAsPrefab(const string& pathname, AZ::Entity* entity) override; - UiCanvasInterface::ErrorCode CheckElementValidToSaveAsPrefab(AZ::Entity* entity) override; - AZ::Entity* LoadFromPrefab(const string& pathname, - bool makeUniqueName, - AZ::Entity* optionalInsertionPoint) override; void FixupCreatedEntities(LyShine::EntityArray topLevelEntities, bool makeUniqueNamesAndIds, AZ::Entity* optionalInsertionPoint) override; void AddElement(AZ::Entity* element, AZ::Entity* parent, AZ::Entity* insertBefore) override; void ReinitializeElements() override; diff --git a/Gems/LyShine/Code/Source/UiSerialize.cpp b/Gems/LyShine/Code/Source/UiSerialize.cpp index 80ff9113f2..639821930a 100644 --- a/Gems/LyShine/Code/Source/UiSerialize.cpp +++ b/Gems/LyShine/Code/Source/UiSerialize.cpp @@ -556,11 +556,6 @@ namespace UiSerialize serializeContext->Class >()-> Serializer(&AZ::Serialize::StaticInstance::s_instance); - serializeContext->Class() - ->Version(2, &PrefabFileObject::VersionConverter) - ->Field("RootEntity", &PrefabFileObject::m_rootEntityId) - ->Field("Entities", &PrefabFileObject::m_entities); - serializeContext->Class() ->Version(1) ->Field("SerializeString", &AnimationData::m_serializeData); @@ -607,54 +602,6 @@ namespace UiSerialize } } - //////////////////////////////////////////////////////////////////////////////////////////////////// - bool PrefabFileObject::VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - if (classElement.GetVersion() == 1) - { - // this is an old UI prefab (prior to UI Slices). We need to move all of the owned child entities into a - // separate list and have the references to them be via entity ID - - // Find the m_rootEntity in the PrefabFileObject, in the old format this is an entity, - // we will replace it with an entityId - int rootEntityIndex = classElement.FindElement(AZ_CRC("RootEntity", 0x3cead042)); - if (rootEntityIndex == -1) - { - return false; - } - AZ::SerializeContext::DataElementNode& rootEntityNode = classElement.GetSubElement(rootEntityIndex); - - // All UI element entities will be copied to this container and then added to the m_childEntities list - AZStd::vector copiedEntities; - - // recursively process the root element and all of its child elements, copying their child entities to the - // entities container and replacing them with EntityIds - if (!UiElementComponent::MoveEntityAndDescendantsToListAndReplaceWithEntityId(context, rootEntityNode, -1, copiedEntities)) - { - return false; - } - - // Create the child entities member (which is a generic vector) - using entityVector = AZStd::vector; - AZ::SerializeContext::ClassData* classData = AZ::SerializeGenericTypeInfo::GetGenericInfo()->GetClassData(); - int entitiesIndex = classElement.AddElement(context, "Entities", *classData); - if (entitiesIndex == -1) - { - return false; - } - AZ::SerializeContext::DataElementNode& entitiesNode = classElement.GetSubElement(entitiesIndex); - - // now add all of the copied entities to the entities vector node - for (AZ::SerializeContext::DataElementNode& entityElement : copiedEntities) - { - entityElement.SetName("element"); // all elements in the Vector should have this name - entitiesNode.AddElement(entityElement); - } - } - - return true; - } - //////////////////////////////////////////////////////////////////////////////////////////////// // Helper function to VersionConverter to move three state actions from the derived interactable // to the interactable base class diff --git a/Gems/LyShine/Code/Source/UiSerialize.h b/Gems/LyShine/Code/Source/UiSerialize.h index 9bdddceba2..c3ad18420d 100644 --- a/Gems/LyShine/Code/Source/UiSerialize.h +++ b/Gems/LyShine/Code/Source/UiSerialize.h @@ -16,20 +16,6 @@ namespace UiSerialize //! Define the Cry and UI types for the AZ Serialize system void ReflectUiTypes(AZ::ReflectContext* context); - //! Wrapper class for prefab file. This allows us to make changes to what the top - //! level objects are in the prefab file and do some conversion - //! NOTE: This is only used for old pre-slices UI prefabs - class PrefabFileObject - { - public: - virtual ~PrefabFileObject() { } - AZ_CLASS_ALLOCATOR(PrefabFileObject, AZ::SystemAllocator, 0); - AZ_RTTI(PrefabFileObject, "{C264CC6F-E50C-4813-AAE6-F7AB0B1774D0}"); - static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); - AZ::EntityId m_rootEntityId; - AZStd::vector m_entities; - }; - //! Wrapper class for animation system data file. This allows us to use the old Cry //! serialize for the animation data class AnimationData diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 84a5f560c7..7d6e995d10 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -108,8 +108,6 @@ set(FILES Editor/PivotPresets.h Editor/PivotPresetsWidget.cpp Editor/PivotPresetsWidget.h - Editor/PrefabHelpers.cpp - Editor/PrefabHelpers.h Editor/PresetButton.cpp Editor/PresetButton.h Editor/PreviewActionLog.cpp diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab deleted file mode 100644 index b4e44904e7..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Button.uiprefab +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab deleted file mode 100644 index 4342f051c9..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Checkbox.uiprefab +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab deleted file mode 100644 index 14aebe3ed0..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Image.uiprefab +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab deleted file mode 100644 index 46a09c2228..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutColumn.uiprefab +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab deleted file mode 100644 index 84a23fbbb2..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutGrid.uiprefab +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab deleted file mode 100644 index 35577ee608..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/LayoutRow.uiprefab +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab deleted file mode 100644 index 2911354397..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarHorizontal.uiprefab +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab deleted file mode 100644 index 44f8303729..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBarVertical.uiprefab +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab deleted file mode 100644 index 1019b8b098..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/ScrollBox.uiprefab +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab deleted file mode 100644 index 35a669bdb2..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Slider.uiprefab +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab deleted file mode 100644 index 69646878b8..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/Text.uiprefab +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab deleted file mode 100644 index 593d6dc220..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/TextInput.uiprefab +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab b/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab deleted file mode 100644 index b0dea29b0e..0000000000 --- a/Gems/UiBasics/Assets/UI/Prefabs/TooltipDisplay.uiprefab +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From d0dd80099cfde8cf71f232ca671a48401855d8d5 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Fri, 2 Jul 2021 16:07:26 -0700 Subject: [PATCH 047/156] Open editor button and new project and failed warnings. Signed-off-by: AMZN-Phil --- .../Source/ProjectBuilderController.cpp | 8 ++ .../Source/ProjectBuilderController.h | 1 + .../Source/ProjectBuilderWorker.cpp | 2 +- .../Source/ProjectButtonWidget.cpp | 113 +++++++++++++++++- .../Source/ProjectButtonWidget.h | 18 +++ .../Tools/ProjectManager/Source/ProjectInfo.h | 3 + .../ProjectManager/Source/ProjectsScreen.cpp | 17 ++- 7 files changed, 155 insertions(+), 7 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp index 00e2e5d68d..33defeec8b 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp @@ -92,10 +92,18 @@ namespace O3DE::ProjectManager // Open application assigned to this file type QDesktopServices::openUrl(QUrl("file:///" + m_worker->GetLogFilePath())); } + + m_projectInfo.m_buildFailed = true; + m_projectInfo.m_logUrl = QUrl("file:///" + m_worker->GetLogFilePath()); + emit NotifyBuildProject(m_projectInfo); } else { QMessageBox::critical(m_parent, tr("Project Failed to Build!"), result); + + m_projectInfo.m_buildFailed = true; + m_projectInfo.m_logUrl = QUrl(); + emit NotifyBuildProject(m_projectInfo); } emit Done(false); diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderController.h b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h index c3e3026b34..15ad5412b3 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderController.h +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h @@ -38,6 +38,7 @@ namespace O3DE::ProjectManager signals: void Done(bool success = true); + void NotifyBuildProject(const ProjectInfo& projectInfo); private: ProjectInfo m_projectInfo; diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp index 45034686c3..63899035e0 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp @@ -14,7 +14,7 @@ namespace O3DE::ProjectManager { - const QString ProjectBuilderWorker::BuildCancelled = ProjectBuilderWorker::tr("Build Cancelled."); + const QString ProjectBuilderWorker::BuildCancelled = QObject::tr("Build Cancelled."); ProjectBuilderWorker::ProjectBuilderWorker(const ProjectInfo& projectInfo) : QObject() diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp index 68a43b3b52..cce9da5734 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -40,8 +42,57 @@ namespace O3DE::ProjectManager m_overlayLabel->setVisible(false); vLayout->addWidget(m_overlayLabel); + m_buildOverlayLayout = new QVBoxLayout(); + m_buildOverlayLayout->addSpacing(10); + + QHBoxLayout* horizontalMessageLayout = new QHBoxLayout(); + + horizontalMessageLayout->addSpacing(10); + m_warningIcon = new QLabel(this); + m_warningIcon->setPixmap(QIcon(":/Warning.svg").pixmap(20, 20)); + m_warningIcon->setAlignment(Qt::AlignTop); + m_warningIcon->setVisible(false); + horizontalMessageLayout->addWidget(m_warningIcon); + + horizontalMessageLayout->addSpacing(10); + + m_warningText = new QLabel("", this); + m_warningText->setObjectName("projectWarningOverlay"); + m_warningText->setWordWrap(true); + m_warningText->setAlignment(Qt::AlignLeft); + m_warningText->setVisible(false); + connect(m_warningText, &QLabel::linkActivated, this, &LabelButton::OnLinkActivated); + horizontalMessageLayout->addWidget(m_warningText); + + QSpacerItem* textSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + horizontalMessageLayout->addSpacerItem(textSpacer); + + m_buildOverlayLayout->addLayout(horizontalMessageLayout); + + QSpacerItem* buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); + m_buildOverlayLayout->addSpacerItem(buttonSpacer); + + QHBoxLayout* horizontalOpenEditorButtonLayout = new QHBoxLayout(); + horizontalOpenEditorButtonLayout->addSpacing(34); + m_openEditorButton = new QPushButton(tr("Open Editor"), this); + m_openEditorButton->setObjectName("openEditorButton"); + m_openEditorButton->setDefault(true); + m_openEditorButton->setVisible(false); + horizontalOpenEditorButtonLayout->addWidget(m_openEditorButton); + horizontalOpenEditorButtonLayout->addSpacing(34); + m_buildOverlayLayout->addLayout(horizontalOpenEditorButtonLayout); + + QHBoxLayout* horizontalButtonLayout = new QHBoxLayout(); + horizontalButtonLayout->addSpacing(34); m_actionButton = new QPushButton(tr("Project Action"), this); m_actionButton->setVisible(false); + horizontalButtonLayout->addWidget(m_actionButton); + horizontalButtonLayout->addSpacing(34); + + m_buildOverlayLayout->addLayout(horizontalButtonLayout); + m_buildOverlayLayout->addSpacing(16); + + vLayout->addItem(m_buildOverlayLayout); m_progressBar = new QProgressBar(this); m_progressBar->setObjectName("labelButtonProgressBar"); @@ -73,16 +124,41 @@ namespace O3DE::ProjectManager return m_overlayLabel; } + void LabelButton::SetLogUrl(const QUrl& url) + { + m_logUrl = url; + } + QProgressBar* LabelButton::GetProgressBar() { return m_progressBar; } + QPushButton* LabelButton::GetOpenEditorButton() + { + return m_openEditorButton; + } + QPushButton* LabelButton::GetActionButton() { return m_actionButton; } + QLabel* LabelButton::GetWarningLabel() + { + return m_warningText; + } + + QLabel* LabelButton::GetWarningIcon() + { + return m_warningIcon; + } + + void LabelButton::OnLinkActivated(const QString& /*link*/) + { + QDesktopServices::openUrl(m_logUrl); + } + ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent, bool processing) : QFrame(parent) , m_projectInfo(projectInfo) @@ -110,7 +186,6 @@ namespace O3DE::ProjectManager m_projectImageLabel = new LabelButton(this); m_projectImageLabel->setFixedSize(ProjectPreviewImageWidth, ProjectPreviewImageHeight); m_projectImageLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - connect(m_projectImageLabel, &LabelButton::triggered, [this]() { emit OpenProject(m_projectInfo.m_path); }); vLayout->addWidget(m_projectImageLabel); QString projectPreviewPath = QDir(m_projectInfo.m_path).filePath(m_projectInfo.m_iconPath); @@ -145,6 +220,8 @@ namespace O3DE::ProjectManager void ProjectButton::ReadySetup() { + connect(m_projectImageLabel->GetOpenEditorButton(), &QPushButton::clicked, [this](){ emit OpenProject(m_projectInfo.m_path); }); + QMenu* menu = new QMenu(this); menu->addAction(tr("Edit Project Settings..."), this, [this]() { emit EditProject(m_projectInfo.m_path); }); menu->addAction(tr("Build"), this, [this]() { emit BuildProject(m_projectInfo); }); @@ -170,9 +247,6 @@ namespace O3DE::ProjectManager QPushButton* projectActionButton = m_projectImageLabel->GetActionButton(); if (!m_actionButtonConnection) { - QSpacerItem* buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); - m_projectImageLabel->layout()->addItem(buttonSpacer); - m_projectImageLabel->layout()->addWidget(projectActionButton); projectActionButton->setVisible(true); } else @@ -186,6 +260,27 @@ namespace O3DE::ProjectManager void ProjectButton::SetProjectBuildButtonAction() { + m_projectImageLabel->GetWarningLabel()->setText(tr("Building project required.")); + m_projectImageLabel->GetWarningIcon()->setVisible(true); + m_projectImageLabel->GetWarningLabel()->setVisible(true); + SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); }); + } + + void ProjectButton::ShowBuildFailed(bool show, const QUrl& logUrl) + { + if (!logUrl.isEmpty()) + { + m_projectImageLabel->GetWarningLabel()->setText(tr("Failed to build. Click to view logs.")); + } + else + { + m_projectImageLabel->GetWarningLabel()->setText(tr("Project failed to build.")); + } + + m_projectImageLabel->GetWarningLabel()->setTextInteractionFlags(Qt::LinksAccessibleByMouse); + m_projectImageLabel->GetWarningIcon()->setVisible(show); + m_projectImageLabel->GetWarningLabel()->setVisible(show); + m_projectImageLabel->SetLogUrl(logUrl); SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); }); } @@ -209,6 +304,16 @@ namespace O3DE::ProjectManager m_projectImageLabel->GetProgressBar()->setValue(progress); } + void ProjectButton::enterEvent(QEvent* /*event*/) + { + m_projectImageLabel->GetOpenEditorButton()->setVisible(true); + } + + void ProjectButton::leaveEvent(QEvent* /*event*/) + { + m_projectImageLabel->GetOpenEditorButton()->setVisible(false); + } + LabelButton* ProjectButton::GetLabelButton() { return m_projectImageLabel; diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h index b3b4b2bcf6..a99984c12f 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h @@ -20,6 +20,9 @@ QT_FORWARD_DECLARE_CLASS(QPixmap) QT_FORWARD_DECLARE_CLASS(QAction) QT_FORWARD_DECLARE_CLASS(QProgressBar) +QT_FORWARD_DECLARE_CLASS(QLayout) +QT_FORWARD_DECLARE_CLASS(QVBoxLayout) +QT_FORWARD_DECLARE_CLASS(QEvent) namespace O3DE::ProjectManager { @@ -34,21 +37,32 @@ namespace O3DE::ProjectManager void SetEnabled(bool enabled); void SetOverlayText(const QString& text); + void SetLogUrl(const QUrl& url); QLabel* GetOverlayLabel(); QProgressBar* GetProgressBar(); + QPushButton* GetOpenEditorButton(); QPushButton* GetActionButton(); + QLabel* GetWarningLabel(); + QLabel* GetWarningIcon(); + QLayout* GetBuildOverlayLayout(); signals: void triggered(); public slots: void mousePressEvent(QMouseEvent* event) override; + void OnLinkActivated(const QString& link); private: + QVBoxLayout* m_buildOverlayLayout; QLabel* m_overlayLabel; QProgressBar* m_progressBar; + QPushButton* m_openEditorButton; QPushButton* m_actionButton; + QLabel* m_warningText; + QLabel* m_warningIcon; + QUrl m_logUrl; bool m_enabled = true; }; @@ -63,6 +77,7 @@ namespace O3DE::ProjectManager void SetProjectButtonAction(const QString& text, AZStd::function lambda); void SetProjectBuildButtonAction(); + void ShowBuildFailed(bool show, const QUrl& logUrl); void SetLaunchButtonEnabled(bool enabled); void SetButtonOverlayText(const QString& text); @@ -81,11 +96,14 @@ namespace O3DE::ProjectManager void BaseSetup(); void ProcessingSetup(); void ReadySetup(); + void enterEvent(QEvent* event) override; + void leaveEvent(QEvent* event) override; void BuildThisProject(); ProjectInfo m_projectInfo; LabelButton* m_projectImageLabel; QFrame* m_projectFooter; + QLayout* m_requiresBuildLayout; QMetaObject::Connection m_actionButtonConnection; }; diff --git a/Code/Tools/ProjectManager/Source/ProjectInfo.h b/Code/Tools/ProjectManager/Source/ProjectInfo.h index d78ef54c83..a6a661420b 100644 --- a/Code/Tools/ProjectManager/Source/ProjectInfo.h +++ b/Code/Tools/ProjectManager/Source/ProjectInfo.h @@ -9,6 +9,7 @@ #if !defined(Q_MOC_RUN) #include +#include #include #include #endif @@ -54,5 +55,7 @@ namespace O3DE::ProjectManager // Used in project creation bool m_needsBuild = false; //! Does this project need to be built + bool m_buildFailed = false; + QUrl m_logUrl; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index da30758308..a31cd8b263 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -193,7 +193,19 @@ namespace O3DE::ProjectManager } else if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end()) { - projectButtonWidget->SetProjectBuildButtonAction(); + auto buildProjectIterator = RequiresBuildProjectIterator(project.m_path); + if (buildProjectIterator != m_requiresBuild.end()) + { + if (buildProjectIterator->m_buildFailed) + { + projectButtonWidget->ShowBuildFailed(true, buildProjectIterator->m_logUrl); + } + else + { + projectButtonWidget->SetProjectBuildButtonAction(); + } + } + } } @@ -418,7 +430,7 @@ namespace O3DE::ProjectManager void ProjectsScreen::SuggestBuildProjectMsg(const ProjectInfo& projectInfo, bool showMessage) { - if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end()) + if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end() || projectInfo.m_buildFailed) { m_requiresBuild.append(projectInfo); } @@ -517,6 +529,7 @@ namespace O3DE::ProjectManager m_currentBuilder = new ProjectBuilderController(projectInfo, nullptr, this); ResetProjectsContent(); connect(m_currentBuilder, &ProjectBuilderController::Done, this, &ProjectsScreen::ProjectBuildDone); + connect(m_currentBuilder, &ProjectBuilderController::NotifyBuildProject, this, &ProjectsScreen::SuggestBuildProject); m_currentBuilder->Start(); } From 2d060d7466b7b34f1615ad2405bfd9a6a6d838a9 Mon Sep 17 00:00:00 2001 From: Terry Michaels Date: Fri, 2 Jul 2021 18:38:28 -0500 Subject: [PATCH 048/156] Updated splash and about screens (#1839) Signed-off-by: Terry Michaels --- Code/Editor/AboutDialog.cpp | 2 +- Code/Editor/StartupLogoDialog.cpp | 4 ++-- Code/Editor/StartupLogoDialog.qrc | 2 +- Code/Editor/splashscreen_background_developer_preview.jpg | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 Code/Editor/splashscreen_background_developer_preview.jpg diff --git a/Code/Editor/AboutDialog.cpp b/Code/Editor/AboutDialog.cpp index f7385b39b7..0ba089cd5d 100644 --- a/Code/Editor/AboutDialog.cpp +++ b/Code/Editor/AboutDialog.cpp @@ -45,7 +45,7 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, CAboutDialog > QLabel#link { text-decoration: underline; color: #94D2FF; }"); // Prepare background image - QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); // Draw the Open 3D Engine logo from svg diff --git a/Code/Editor/StartupLogoDialog.cpp b/Code/Editor/StartupLogoDialog.cpp index d26f174821..68f1c655fb 100644 --- a/Code/Editor/StartupLogoDialog.cpp +++ b/Code/Editor/StartupLogoDialog.cpp @@ -36,11 +36,11 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy s_pLogoWindow = this; - m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); setFixedSize(QSize(600, 300)); // Prepare background image - QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_gradient.jpg")); + QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); // Draw the Open 3D Engine logo from svg diff --git a/Code/Editor/StartupLogoDialog.qrc b/Code/Editor/StartupLogoDialog.qrc index 2493810ad8..38d1d1da2a 100644 --- a/Code/Editor/StartupLogoDialog.qrc +++ b/Code/Editor/StartupLogoDialog.qrc @@ -1,6 +1,6 @@ o3de_logo.svg - splashscreen_background_gradient.jpg + splashscreen_background_developer_preview.jpg diff --git a/Code/Editor/splashscreen_background_developer_preview.jpg b/Code/Editor/splashscreen_background_developer_preview.jpg new file mode 100644 index 0000000000..59f05a64df --- /dev/null +++ b/Code/Editor/splashscreen_background_developer_preview.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7105ec99477f124a8ac8d588f2dfc4ee7bb54f39386c8131b7703c86754c0cb8 +size 248690 From 0edf0e74bcc2751918c69587a54f194c68bfb2da Mon Sep 17 00:00:00 2001 From: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> Date: Fri, 2 Jul 2021 16:54:01 -0700 Subject: [PATCH 049/156] AWS: Migrate attribution endpoint (#1838) * Migrate attribution endpoint and update unit tests --- .../Attribution/AWSCoreAttributionManager.cpp | 17 ++++++++--------- .../AWSCoreAttributionManagerTest.cpp | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp index f2ff7ed816..8f0c07edb5 100644 --- a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp +++ b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp @@ -38,9 +38,8 @@ namespace AWSCore constexpr char AWSAttributionDelaySecondsKey[] = "/Amazon/AWS/Preferences/AWSAttributionDelaySeconds"; constexpr char AWSAttributionLastTimeStampKey[] = "/Amazon/AWS/Preferences/AWSAttributionLastTimeStamp"; constexpr char AWSAttributionConsentShownKey[] = "/Amazon/AWS/Preferences/AWSAttributionConsentShown"; - constexpr char AWSAttributionApiId[] = "2zxvvmv8d7"; - constexpr char AWSAttributionChinaApiId[] = ""; - constexpr char AWSAttributionApiStage[] = "prod"; + constexpr char AWSAttributionEndpoint[] = "https://o3deattribution.us-east-1.amazonaws.com"; + constexpr char AWSAttributionChinaEndpoint[] = ""; const int AWSAttributionDefaultDelayInDays = 7; AWSAttributionManager::AWSAttributionManager() @@ -253,17 +252,17 @@ namespace AWSCore // Assumption to determine China region is the default profile is set to China region. auto profile_name = Aws::Auth::GetConfigProfileName(); Aws::Client::ClientConfiguration clientConfig(profile_name.c_str()); - AZStd::string apiId = AWSAttributionApiId; if (clientConfig.region == Aws::Region::CN_NORTH_1 || clientConfig.region == Aws::Region::CN_NORTHWEST_1) { config->region = Aws::Region::CN_NORTH_1; - apiId = AWSAttributionChinaApiId; + config->endpointOverride = AWSAttributionChinaEndpoint; + } + else + { + config->region = Aws::Region::US_EAST_1; + config->endpointOverride = AWSAttributionEndpoint; } - - config->region = Aws::Region::US_WEST_2; - config->endpointOverride = - AWSResourceMappingUtils::FormatRESTApiUrl(apiId, config->region.value().c_str(), AWSAttributionApiStage).c_str(); } bool AWSAttributionManager::CheckConsentShown() diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp index ca402b9edd..ef75ac7df3 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp @@ -418,8 +418,8 @@ namespace AWSAttributionUnitTest manager.SetApiEndpointAndRegion(config); // THEN - ASSERT_TRUE(config->region == Aws::Region::US_WEST_2); - ASSERT_TRUE(config->endpointOverride->find("execute-api.us-west-2.amazonaws.com") != Aws::String::npos); + ASSERT_TRUE(config->region == Aws::Region::US_EAST_1); + ASSERT_TRUE(config->endpointOverride->find("o3deattribution.us-east-1.amazonaws.com") != Aws::String::npos); delete config; } From d4e4ebc2a7b065f4768f6131b4b7a712b85d323b Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Fri, 2 Jul 2021 19:32:41 -0700 Subject: [PATCH 050/156] Change Standard Project Template to Default and Change Open 3D Foundation to Open 3D Engine in gem catalog (#1842) Made Standard Template Always Show First and Default Selection Changed Open 3D Foundation to Open 3D Engine in Gem Catalog and setup detection of Origin based on gem creator --- .../ProjectManager/Source/CreateProjectCtrl.h | 1 - .../ProjectManager/Source/GemCatalog/GemInfo.cpp | 4 ++-- .../ProjectManager/Source/GemCatalog/GemInfo.h | 2 +- .../Source/NewProjectSettingsScreen.cpp | 15 +++++++++++++-- .../Source/NewProjectSettingsScreen.h | 1 + .../ProjectManager/Source/PythonBindings.cpp | 6 ++++++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h index c453e2d500..7dea0cb9a2 100644 --- a/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h +++ b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h @@ -11,7 +11,6 @@ #include #endif -// due to current limitations, customizing template Gems is disabled #define TEMPLATE_GEM_CONFIGURATION_ENABLED QT_FORWARD_DECLARE_CLASS(QStackedWidget) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp index 2f6491a77d..36f4489081 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp @@ -61,8 +61,8 @@ namespace O3DE::ProjectManager { switch (origin) { - case O3DEFoundation: - return "Open 3D Foundation"; + case Open3DEEngine: + return "Open 3D Engine"; case Local: return "Local"; default: diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h index 6c9580b19a..c82b310fd9 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h @@ -43,7 +43,7 @@ namespace O3DE::ProjectManager enum GemOrigin { - O3DEFoundation = 1 << 0, + Open3DEEngine = 1 << 0, Local = 1 << 1, NumGemOrigins = 2 }; diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp index 26e5e074e5..c0c96d8281 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp @@ -97,10 +97,21 @@ namespace O3DE::ProjectManager { m_templates = templatesResult.GetValue(); - // sort alphabetically by display name because they could be in any order + // sort alphabetically by display name (but putting Standard first) because they could be in any order std::sort(m_templates.begin(), m_templates.end(), [](const ProjectTemplateInfo& arg1, const ProjectTemplateInfo& arg2) { - return arg1.m_displayName.toLower() < arg2.m_displayName.toLower(); + if (arg1.m_displayName == "Standard") + { + return true; + } + else if (arg2.m_displayName == "Standard") + { + return false; + } + else + { + return arg1.m_displayName.toLower() < arg2.m_displayName.toLower(); + } }); for (int index = 0; index < m_templates.size(); ++index) diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h index d812bfd091..924821e534 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h @@ -19,6 +19,7 @@ QT_FORWARD_DECLARE_CLASS(QFrame) namespace O3DE::ProjectManager { QT_FORWARD_DECLARE_CLASS(TagContainerWidget) + class NewProjectSettingsScreen : public ProjectSettingsScreen { diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 00b6940255..50e00e4c84 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -650,6 +650,12 @@ namespace O3DE::ProjectManager gemInfo.m_summary = Py_To_String_Optional(data, "Summary", ""); gemInfo.m_version = Py_To_String_Optional(data, "Version", ""); gemInfo.m_requirement = Py_To_String_Optional(data, "Requirements", ""); + gemInfo.m_creator = Py_To_String_Optional(data, "origin", ""); + + if (gemInfo.m_creator.contains("Open 3D Engine")) + { + gemInfo.m_gemOrigin = GemInfo::GemOrigin::Open3DEEngine; + } if (data.contains("Tags")) { From d73a98aa2f5ad3d712284bb9609c95ce20f9a114 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:46:26 -0500 Subject: [PATCH 051/156] Added detection of gems which are not directly under an external subdirectory root (#1841) * Added proper detection of the list of Gems in the Project Templates enabled_gems.cmake file Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added a CMake alias target for the Atom Gem and the AtomLyIntegration Both of those targets just aliases the Atom_AtomBridge gem Therefore they turn on Atom Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Replacing the Atom_AtomBridge gem in the project template with the Atom gem The Atom gem is just an alias to the Atom_AtomBridge gem Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the manifest.py gem gathering logic to recurse through the external subdirecotories locating gem.json files to discover all gems in a subdirectory Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../ProjectManager/Source/PythonBindings.cpp | 20 +++++++--- Gems/Atom/CMakeLists.txt | 8 ++++ Gems/AtomLyIntegration/CMakeLists.txt | 9 +++++ .../Template/Code/enabled_gems.cmake | 2 +- Templates/DefaultProject/template.json | 1 - .../Template/Code/enabled_gems.cmake | 2 +- cmake/Gems.cmake | 30 ++++++++------ scripts/o3de/o3de/manifest.py | 40 ++++++++++++------- 8 files changed, 76 insertions(+), 36 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 50e00e4c84..ca49542ccf 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -23,6 +23,8 @@ #include #include +#include + namespace Platform { bool InsertPythonLibraryPath( @@ -42,7 +44,7 @@ namespace Platform return false; } - // Implemented in each different platform's PAL implentation files, as it differs per platform. + // Implemented in each different platform's PAL implementation files, as it differs per platform. AZStd::string GetPythonHomePath(const char* pythonPackage, const char* engineRoot); } // namespace Platform @@ -843,11 +845,19 @@ namespace O3DE::ProjectManager templateInfo.m_canonicalTags.push_back(Py_To_String(tag)); } } - if (data.contains("included_gems")) + + QString templateProjectPath = QDir(templateInfo.m_path).filePath("Template"); + auto enabledGemNames = GetEnabledGemNames(templateProjectPath); + if (enabledGemNames) { - for (auto gem : data["included_gems"]) + for (auto gem : enabledGemNames.GetValue()) { - templateInfo.m_includedGems.push_back(Py_To_String(gem)); + // Exclude the template ${Name} placeholder for the list of included gems + // That Gem gets created with the project + if (!gem.contains("${Name}")) + { + templateInfo.m_includedGems.push_back(Py_To_String(gem.c_str())); + } } } } diff --git a/Gems/Atom/CMakeLists.txt b/Gems/Atom/CMakeLists.txt index 3c7a6951f6..8dc38ec7ad 100644 --- a/Gems/Atom/CMakeLists.txt +++ b/Gems/Atom/CMakeLists.txt @@ -14,3 +14,11 @@ add_subdirectory(RPI) add_subdirectory(Tools) add_subdirectory(Utils) +# The "Atom" Gem will alias the real Atom_AtomBridge target variants +# allows the enabling and disabling the "Atom" Gem to build the pre-requisite dependencies +ly_create_alias(NAME Atom.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Clients) +ly_create_alias(NAME Atom.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Servers) +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_create_alias(NAME Atom.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Builders) + ly_create_alias(NAME Atom.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Tools) +endif() diff --git a/Gems/AtomLyIntegration/CMakeLists.txt b/Gems/AtomLyIntegration/CMakeLists.txt index 798cacfb2e..35d4d388a6 100644 --- a/Gems/AtomLyIntegration/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CMakeLists.txt @@ -14,3 +14,12 @@ add_subdirectory(TechnicalArt) add_subdirectory(AtomBridge) add_subdirectory(AtomViewportDisplayInfo) add_subdirectory(AtomViewportDisplayIcons) + +# The "AtomLyIntegration" Gem will also alias the real Atom_AtomBridge target variants +# The Atom Gem does the same at the moment. +ly_create_alias(NAME AtomLyIntegration.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Clients) +ly_create_alias(NAME AtomLyIntegration.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Servers) +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_create_alias(NAME AtomLyIntegration.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Builders) + ly_create_alias(NAME AtomLyIntegration.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Tools) +endif() diff --git a/Templates/DefaultProject/Template/Code/enabled_gems.cmake b/Templates/DefaultProject/Template/Code/enabled_gems.cmake index 99c3b89895..9ccce2905c 100644 --- a/Templates/DefaultProject/Template/Code/enabled_gems.cmake +++ b/Templates/DefaultProject/Template/Code/enabled_gems.cmake @@ -7,7 +7,7 @@ set(ENABLED_GEMS ${Name} - Atom_AtomBridge + Atom AudioSystem AWSCore CameraFramework diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index fabfb0cf18..5eaf66e3af 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -6,7 +6,6 @@ "license": "What license DefaultProject uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "Standard", "summary": "This template has everything you need to build a full online 3D game or application.", - "included_gems": ["Atom","Camera","EMotionFX","UI","Maestro","Input","ImGui"], "canonical_tags": [], "user_tags": [ "DefaultProject" diff --git a/Templates/MinimalProject/Template/Code/enabled_gems.cmake b/Templates/MinimalProject/Template/Code/enabled_gems.cmake index 13774c2831..db63d149ab 100644 --- a/Templates/MinimalProject/Template/Code/enabled_gems.cmake +++ b/Templates/MinimalProject/Template/Code/enabled_gems.cmake @@ -7,7 +7,7 @@ set(ENABLED_GEMS ${Name} - Atom_AtomBridge + Atom CameraFramework ImGui ) diff --git a/cmake/Gems.cmake b/cmake/Gems.cmake index 634e09f596..b120c28db3 100644 --- a/cmake/Gems.cmake +++ b/cmake/Gems.cmake @@ -31,25 +31,29 @@ function(ly_create_alias) "Make sure the target wasn't copy and pasted here or elsewhere.") endif() - # easy version - if its juts one target, we can directly get the target, and make both aliases, + # easy version - if its just one target and it exist at the time of this call, + # we can directly get the target, and make both aliases, # the namespaced and non namespaced one, point at it. list(LENGTH ly_create_alias_TARGETS number_of_targets) if (number_of_targets EQUAL 1) - ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name) - add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) - if (NOT TARGET ${ly_create_alias_NAME}) - add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + if(TARGET ${ly_create_alias_TARGETS}) + ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name) + add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + if (NOT TARGET ${ly_create_alias_NAME}) + add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + endif() + # Store off the arguments needed used ly_create_alias into a DIRECTORY property + # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step + string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + return() endif() - # Store off the arguments needed used ly_create_alias into a DIRECTORY property - # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step - string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") - set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") - return() endif() - # more complex version - one alias to multiple targets. To actually achieve this - # we have to create an interface library with those dependencies, then we have to create an alias to that target. - # by convention we create one without a namespace then alias the namespaced one. + # more complex version - one alias to multiple targets or the alias is being made to a TARGET that doesn't exist yet. + # To actually achieve this we have to create an interface library with those dependencies, + # then we have to create an alias to that target. + # By convention we create one without a namespace then alias the namespaced one. if(TARGET ${ly_create_alias_NAME}) message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n" diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index c4a7cf8f36..3d78c990a2 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -212,6 +212,28 @@ def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> b return False + +def get_gems_from_subdirectories(external_subdirs: list) -> list: + ''' + Helper Method for scanning a set of external subdirectories for gem.json files + ''' + def is_gem_subdirectory(subdir_files): + for name in files: + if name == 'gem.json': + return True + return False + + gem_directories = [] + # Locate all subfolders with gem.json files within them + if external_subdirs: + for subdirectory in external_subdirs: + for root, dirs, files in os.walk(pathlib.Path(subdirectory).resolve()): + if is_gem_subdirectory(files): + gem_directories.append(pathlib.PurePath(root).as_posix()) + + return gem_directories + + # Data query methods def get_this_engine() -> dict: json_data = load_o3de_manifest() @@ -230,11 +252,7 @@ def get_projects() -> list: def get_gems() -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_external_subdirectories() - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_external_subdirectories()) def get_external_subdirectories() -> list: @@ -265,11 +283,7 @@ def get_engine_projects() -> list: def get_engine_gems() -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_engine_external_subdirectories() - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_engine_external_subdirectories()) def get_engine_external_subdirectories() -> list: @@ -295,11 +309,7 @@ def get_engine_restricted() -> list: # project.json queries def get_project_gems(project_path: pathlib.Path) -> list: - def is_gem_subdirectory(subdir): - return (pathlib.Path(subdir) / 'gem.json').exists() - - external_subdirs = get_project_external_subdirectories(project_path) - return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + return get_gems_from_subdirectories(get_project_external_subdirectories(project_path)) def get_project_external_subdirectories(project_path: pathlib.Path) -> list: From 4403e9d4d468bb6ecbec1c1e05f227d67f535dcf Mon Sep 17 00:00:00 2001 From: amzn-phist <52085794+amzn-phist@users.noreply.github.com> Date: Fri, 2 Jul 2021 22:22:34 -0500 Subject: [PATCH 052/156] Fix the CMake configuration for Microphone Gem (#1835) * Fix the CMake configuration for Microphone Gem The configuration was causing AudioSystem Gem to be loaded at runtime regardless of whehter AudioSystem.Editor Gem was set to get loaded as well. Gives Microphone Gem an Editor module to sort out the proper runtime dependencies. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Removes an unnecessary comment Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Fix platforms that don't build tools Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Use aliases to better express runtime depends Cleans it up and removes the need for a Microphone.Editor module. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> --- Gems/Microphone/Code/CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index be71d65e33..077797fdd6 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -22,7 +22,7 @@ ly_add_target( Source BUILD_DEPENDENCIES PRIVATE - Gem::AudioSystem + Gem::AudioSystem.Static PUBLIC 3rdParty::libsamplerate Legacy::CryCommon @@ -39,10 +39,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::Microphone.Static - RUNTIME_DEPENDENCIES - Gem::AudioSystem ) -# The above "Microphone" target is used by all interactive applications -ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone) -ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone) +ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone Gem::AudioSystem) +ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone Gem::AudioSystem.Editor) From b31558a086fc2982591901e783bb471264b7989f Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Sat, 3 Jul 2021 20:42:02 -0700 Subject: [PATCH 053/156] Disable RTT in LyShine until it's fully supported using Atom (#1840) Signed-off-by: abrmich --- Gems/LyShine/Code/Source/UiCanvasComponent.cpp | 4 +++- Gems/LyShine/Code/Source/UiFaderComponent.cpp | 4 ++++ Gems/LyShine/Code/Source/UiMaskComponent.cpp | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 1978aa8909..b3a26de98e 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -3527,6 +3527,7 @@ void UiCanvasComponent::CreateRenderTarget() return; } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Create a render target that this canvas will be rendered to. // The render target size is the canvas size. m_renderTargetHandle = gEnv->pRenderer->CreateRenderTarget(m_renderTargetName.c_str(), @@ -3548,6 +3549,7 @@ void UiCanvasComponent::CreateRenderTarget() ISystem::CrySystemNotificationBus::Handler::BusConnect(); } +#endif } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -3566,7 +3568,7 @@ void UiCanvasComponent::DestroyRenderTarget() //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasComponent::RenderCanvasToTexture() { -#ifdef LYSHINE_ATOM_TODO +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom if (m_renderTargetHandle <= 0) { return; diff --git a/Gems/LyShine/Code/Source/UiFaderComponent.cpp b/Gems/LyShine/Code/Source/UiFaderComponent.cpp index 9f5ca82a9c..08f6c89b3a 100644 --- a/Gems/LyShine/Code/Source/UiFaderComponent.cpp +++ b/Gems/LyShine/Code/Source/UiFaderComponent.cpp @@ -452,6 +452,7 @@ void UiFaderComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligne m_viewportTopLeft = pixelAlignedTopLeft; m_viewportSize = renderTargetSize; +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Check if the render target already exists if (m_renderTargetHandle != -1) { @@ -494,6 +495,7 @@ void UiFaderComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligne DestroyRenderTarget(); } } +#endif // at this point either all render targets and depth surfaces are created or none are. // If all succeeded then update the render target size @@ -637,6 +639,7 @@ void UiFaderComponent::RenderRttFader(LyShine::IRenderGraph* renderGraph, UiElem } } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Add a primitive to render a quad using the render target we have created { // Set the texture and other render state required @@ -650,6 +653,7 @@ void UiFaderComponent::RenderRttFader(LyShine::IRenderGraph* renderGraph, UiElem renderGraph->AddPrimitive(&m_cachedPrimitive, texture, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } +#endif } } diff --git a/Gems/LyShine/Code/Source/UiMaskComponent.cpp b/Gems/LyShine/Code/Source/UiMaskComponent.cpp index 80a8054e89..1c1327ee34 100644 --- a/Gems/LyShine/Code/Source/UiMaskComponent.cpp +++ b/Gems/LyShine/Code/Source/UiMaskComponent.cpp @@ -553,6 +553,7 @@ void UiMaskComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligned m_viewportTopLeft = pixelAlignedTopLeft; m_viewportSize = renderTargetSize; +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Check if the render target already exists if (m_contentRenderTargetHandle != -1) { @@ -618,6 +619,7 @@ void UiMaskComponent::CreateOrResizeRenderTarget(const AZ::Vector2& pixelAligned DestroyRenderTarget(); } } +#endif // at this point either all render targets and depth surfaces are created or none are. // If all succeeded then update the render target size @@ -803,6 +805,7 @@ void UiMaskComponent::RenderUsingGradientMask(LyShine::IRenderGraph* renderGraph } } +#ifdef LYSHINE_ATOM_TODO // [LYN-3359] Support RTT using Atom // Add a primitive to do the alpha mask { // Set the texture and other render state required @@ -817,6 +820,7 @@ void UiMaskComponent::RenderUsingGradientMask(LyShine::IRenderGraph* renderGraph renderGraph->AddAlphaMaskPrimitive(&m_cachedPrimitive, texture, maskTexture, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } +#endif } } From 39239155e35f606c0ef71ea6afe1c97fdfead8d9 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Sat, 3 Jul 2021 20:42:23 -0700 Subject: [PATCH 054/156] Update required mesh service for UiCanvasOnMeshComponent (#1843) Signed-off-by: abrmich --- Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h b/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h index b861d04784..83fc705bf6 100644 --- a/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h +++ b/Gems/LyShine/Code/Source/World/UiCanvasOnMeshComponent.h @@ -62,7 +62,7 @@ public: // static member functions static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { - required.push_back(AZ_CRC("LegacyMeshService", 0xb462a299)); + required.push_back(AZ_CRC("MeshService", 0x71d8a455)); required.push_back(AZ_CRC("UiCanvasRefService", 0xb4cb5ef4)); } From 1dfe65a3efaa16cfbdef56df59e0ca314bb1c4e2 Mon Sep 17 00:00:00 2001 From: amzn-hdoke <61443753+hdoke@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:47:17 -0700 Subject: [PATCH 055/156] Update AWSNativeSDK-Android revision and enable AWS gems (#1837) Signed-off-by: dhrudesh --- AutomatedTesting/Gem/Code/enabled_gems.cmake | 13 +++---------- .../Platform/Android/BuiltInPackages_android.cmake | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake index d4f23ede63..0d4d4b116f 100644 --- a/AutomatedTesting/Gem/Code/enabled_gems.cmake +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -48,14 +48,7 @@ set(ENABLED_GEMS LyShine HttpRequestor Atom_AtomBridge + AWSCore + AWSClientAuth + AWSMetrics ) - -# TODO remove conditional add once AWSNativeSDK libs are fixed for Android and Linux Monolithic release. -set(aws_excluded_platforms Android) -if (NOT (LY_MONOLITHIC_GAME AND ${PAL_PLATFORM_NAME} IN_LIST aws_excluded_platforms)) - list(APPEND ENABLED_GEMS - AWSCore - AWSClientAuth - AWSMetrics - ) -endif() diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index 8c25e34f3f..5224eb4a4b 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -19,7 +19,7 @@ ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-android TARGETS freetype PACKAGE_HASH 74dd75382688323c3a2a5090f473840b5d7e9d2aed1a4fcdff05ed2a09a664f2) ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-android TARGETS tiff PACKAGE_HASH a9b30a1980946390c2fad0ed94562476a1d7ba8c1f36934ae140a89c54a8efd0) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev5-android TARGETS AWSNativeSDK PACKAGE_HASH f90aac69ea5703c1e0ad7ee893cdd5a030a8a376ba527334268ae3679761e6ea) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-android TARGETS AWSNativeSDK PACKAGE_HASH 1624ba9aaf03d001ed0ffc57d2f945ff82590e75a7ea868de35043cf673e82fb) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-android TARGETS Lua PACKAGE_HASH 1f638e94a17a87fe9e588ea456d5893876094b4db191234380e4c4eb9e06c300) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-android TARGETS PhysX PACKAGE_HASH b8cb6aa46b2a21671f6cb1f6a78713a3ba88824d0447560ff5ce6c01014b9f43) ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-android TARGETS mikkelsen PACKAGE_HASH 075e8e4940884971063b5a9963014e2e517246fa269c07c7dc55b8cf2cd99705) From 9d5a9ff92560379784bb5298558408c239dd5d2c Mon Sep 17 00:00:00 2001 From: Aaron Ruiz Mora Date: Mon, 5 Jul 2021 16:52:24 +0100 Subject: [PATCH 056/156] NvCloth automated tests use default renderer to be more stable and complete (#1850) Signed-off-by: moraaar --- .../Gem/PythonTests/NvCloth/CMakeLists.txt | 1 + .../Gem/PythonTests/NvCloth/TestSuite_Active.py | 7 +++++-- .../Gem/PythonTests/automatedtesting_shared/base.py | 7 +++++-- .../Gem/PythonTests/smoke/CMakeLists.txt | 13 ------------- .../Components/EditorScriptCanvasComponent.cpp | 2 +- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt index 5b26424097..4c7e32b683 100644 --- a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt @@ -9,6 +9,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_pytest( NAME AutomatedTesting::NvClothTests_Main TEST_SUITE main + TEST_REQUIRES gpu TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py TIMEOUT 1500 diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py index ce3f04b8f1..60df2343ec 100755 --- a/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/TestSuite_Active.py @@ -20,10 +20,13 @@ from base import TestAutomationBase @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): + use_null_renderer = False # Use default renderer (needs gpu) + extra_cmdline_args = [] + def test_C18977329_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform): from . import C18977329_NvCloth_AddClothSimulationToMesh as test_module - self._run_test(request, workspace, editor, test_module) + self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer) def test_C18977330_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform): from . import C18977330_NvCloth_AddClothSimulationToActor as test_module - self._run_test(request, workspace, editor, test_module) + self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index 41f3ebcfb4..da4380a94a 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -51,7 +51,7 @@ class TestAutomationBase: cls._kill_ly_processes() - def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[]): + def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], use_null_renderer=True): test_starttime = time.time() self.logger = logging.getLogger(__name__) errors = [] @@ -89,7 +89,10 @@ class TestAutomationBase: editor_starttime = time.time() self.logger.debug("Running automated test") testcase_module_filepath = self._get_testcase_module_filepath(testcase_module) - pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", "-rhi=null"] + extra_cmdline_args + pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode"] + if use_null_renderer: + pycmd += ["-rhi=null"] + pycmd += extra_cmdline_args editor.args.extend(pycmd) # args are added to the WinLauncher start command editor.start(backupFiles = False, launch_ap = False) try: diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 6e91ae4ea4..af9fc142e2 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -51,17 +51,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AutomatedTesting.GameLauncher AutomatedTesting.Assets ) - - ly_add_pytest( - NAME AutomatedTesting::GameLauncherWithGPU - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_GameLauncher_EnterExitGameMode_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - ) endif() diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 33dfc0922a..1e879c000a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -513,7 +513,7 @@ namespace ScriptCanvasEditor if (memoryAsset->GetFileAssetId() == m_scriptCanvasAssetHolder.GetAssetId()) { auto assetData = memoryAsset->GetAsset(); - AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); + [[maybe_unused]] AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); BuildGameEntityData(); AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); From 049469463e93856d4f980e0c4648e368afc871c3 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 5 Jul 2021 09:34:41 -0700 Subject: [PATCH 057/156] [LYN-4439] Added tags to gem item delegate (#1853) * Added new helper function to draw the feature tags below the summary for each gem item. * In case no feature tags belong to a gem, the available space will be used by the summary. Signed-off-by: Benjamin Jillich --- .../Source/GemCatalog/GemItemDelegate.cpp | 50 ++++++++++++++++++- .../Source/GemCatalog/GemItemDelegate.h | 7 +++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 035fcb7181..b9dc3e9fcc 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -99,7 +99,13 @@ namespace O3DE::ProjectManager painter->drawText(gemCreatorRect, Qt::TextSingleLine, gemCreator); // Gem summary - const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, contentRect.height()); + + // In case there are feature tags displayed at the bottom, decrease the size of the summary text field. + const QStringList featureTags = GemModel::GetFeatures(modelIndex); + const int summaryHeight = contentRect.height() - (!featureTags.empty() * 30); + + const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, + summaryHeight); const QRect summaryRect = QRect(/*topLeft=*/QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize); painter->setFont(standardFont); @@ -108,9 +114,9 @@ namespace O3DE::ProjectManager const QString summary = GemModel::GetSummary(modelIndex); painter->drawText(summaryRect, Qt::AlignLeft | Qt::TextWordWrap, summary); - DrawButton(painter, contentRect, modelIndex); DrawPlatformIcons(painter, contentRect, modelIndex); + DrawFeatureTags(painter, contentRect, featureTags, standardFont, summaryRect); painter->restore(); } @@ -206,6 +212,46 @@ namespace O3DE::ProjectManager } } + 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; + for (const QString& featureTag : featureTags) + { + QRect featureTagRect = GetTextRect(gemFeatureTagFont, featureTag, s_featureTagFontSize); + featureTagRect.moveTo(contentRect.left() + x + s_featureTagBorderMarginX, + contentRect.top() + 47); + featureTagRect = painter->boundingRect(featureTagRect, Qt::TextSingleLine, featureTag); + + QRect backgroundRect = featureTagRect; + backgroundRect = backgroundRect.adjusted(/*left=*/-s_featureTagBorderMarginX, + /*top=*/-s_featureTagBorderMarginY, + /*right=*/s_featureTagBorderMarginX, + /*bottom=*/s_featureTagBorderMarginY); + + // Skip drawing all following feature tags as there is no more space available. + if (backgroundRect.right() > summaryRect.right()) + { + break; + } + + // Draw border. + painter->setPen(m_textColor); + painter->setBrush(Qt::NoBrush); + painter->drawRect(backgroundRect); + + // Draw text within the border. + painter->setPen(m_textColor); + painter->drawText(featureTagRect, Qt::TextSingleLine, featureTag); + + x += backgroundRect.width() + s_featureTagSpacing; + } + } + void GemItemDelegate::DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const { painter->save(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h index 07c25a5ad4..40d06002de 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h @@ -57,12 +57,19 @@ namespace O3DE::ProjectManager inline constexpr static int s_buttonCircleRadius = s_buttonBorderRadius - 2; inline constexpr static qreal s_buttonFontSize = 10.0; + // Feature tags + inline constexpr static int s_featureTagFontSize = 10; + inline constexpr static int s_featureTagBorderMarginX = 3; + inline constexpr static int s_featureTagBorderMarginY = 3; + inline constexpr static int s_featureTagSpacing = 7; + 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; void DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; void DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; + void DrawFeatureTags(QPainter* painter, const QRect& contentRect, const QStringList& featureTags, const QFont& standardFont, const QRect& summaryRect) const; QAbstractItemModel* m_model = nullptr; From 636ff587c3b10ae024f8cf1e597c6ad6d4450c44 Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Mon, 5 Jul 2021 18:06:20 +0100 Subject: [PATCH 058/156] Shape casts correctly report positions of colliders that intersect or in contact of the initial pose (#1848) Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com> --- .../Physics/Common/PhysicsSceneQueries.h | 2 +- .../Code/Source/Common/PhysXSceneQueryHelpers.cpp | 14 ++++++++++---- Gems/PhysX/Code/Source/Scene/PhysXScene.cpp | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h index af1f5947a4..443315ce92 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSceneQueries.h @@ -188,7 +188,7 @@ namespace AzPhysics AZ::Transform m_start = AZ::Transform::CreateIdentity(); //!< World space start position. Assumes only rotation + translation (no scaling). AZ::Vector3 m_direction = AZ::Vector3::CreateZero(); //!< World space direction (Should be normalized) AZStd::shared_ptr m_shapeConfiguration; //!< Shape information. - SceneQuery::HitFlags m_hitFlags = SceneQuery::HitFlags::Default; //!< Query behavior flags + SceneQuery::HitFlags m_hitFlags = SceneQuery::HitFlags::Default | SceneQuery::HitFlags::MTD; //!< Query behavior flags. MTD Is On by default to correctly report objects that are initially in contact with the start pose. SceneQuery::FilterCallback m_filterCallback = nullptr; //!< Hit filtering function bool m_reportMultipleHits = false; //!< flag to have the cast stop after the first hit or return all hits along the query. }; diff --git a/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp b/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp index 37e37d07e3..c157f14871 100644 --- a/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp +++ b/Gems/PhysX/Code/Source/Common/PhysXSceneQueryHelpers.cpp @@ -45,11 +45,17 @@ namespace PhysX hit.m_distance = pxHit.distance; hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Distance; - hit.m_position = PxMathConvert(pxHit.position); - hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Position; + if (pxHit.flags & physx::PxHitFlag::ePOSITION) + { + hit.m_position = PxMathConvert(pxHit.position); + hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Position; + } - hit.m_normal = PxMathConvert(pxHit.normal); - hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Normal; + if (pxHit.flags & physx::PxHitFlag::eNORMAL) + { + hit.m_normal = PxMathConvert(pxHit.normal); + hit.m_resultFlags |= AzPhysics::SceneQuery::ResultFlags::Normal; + } const ActorData* actorData = Utils::GetUserData(pxHit.actor); hit.m_bodyHandle = actorData->GetBodyHandle(); diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index 6d3d7a2607..76d40ea5fb 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -334,6 +334,8 @@ namespace PhysX { const physx::PxTransform pose = PxMathConvert(shapecastRequest->m_start); const physx::PxVec3 dir = PxMathConvert(shapecastRequest->m_direction.GetNormalized()); + AZ_Warning("PhysXScene", (static_cast(shapecastRequest->m_hitFlags & AzPhysics::SceneQuery::HitFlags::MTD) != 0), + "Not having MTD set for shape scene queries may result in incorrect reporting of colliders that are in contact or intersect the initial pose of the sweep."); const physx::PxHitFlags hitFlags = SceneQueryHelpers::GetPxHitFlags(shapecastRequest->m_hitFlags); bool status = false; From 827805ed8367dc4125f77dbd7c79c3132194cf88 Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Tue, 6 Jul 2021 12:28:24 +0100 Subject: [PATCH 059/156] fix C12712452 - re-link script canvas to correct entities (#1855) Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com> --- .../C12712452_ScriptCanvas_CollisionEvents.ly | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly b/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly index b34e483067..fc576ec459 100644 --- a/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly +++ b/AutomatedTesting/Levels/Physics/C12712452_ScriptCanvas_CollisionEvents/C12712452_ScriptCanvas_CollisionEvents.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec428aee9c49ffd58a00fdcbb0625185a22f5690f7b2e81326ef5443699019e6 -size 10945 +oid sha256:e04b536d187793187b64a55914d92c1a1c18393a0369715269a295c7b7a7d370 +size 8883 From 5fdb33b1d793169b90ec64eed0ff5b9d6893dc4f Mon Sep 17 00:00:00 2001 From: Nicholas Lawson <70027408+lawsonamzn@users.noreply.github.com> Date: Tue, 6 Jul 2021 08:05:11 -0700 Subject: [PATCH 060/156] o3de stabilization/2106 - update licenses (#1661) Not to be committed before 7/6/2021 Signed-off-by: lawsonamzn <70027408+lawsonamzn@users.noreply.github.com> --- LICENSE.txt | 51 +++++------ LICENSE_APACHE2.TXT | 201 ++++++++++++++++++++++++++++++++++++++++++++ LICENSE_MIT.TXT | 7 ++ README.md | 15 +--- 4 files changed, 238 insertions(+), 36 deletions(-) create mode 100644 LICENSE_APACHE2.TXT create mode 100644 LICENSE_MIT.TXT diff --git a/LICENSE.txt b/LICENSE.txt index 7748e6705a..c4315a87fe 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,26 +1,27 @@ -Amazon Project Spectra Private Preview -Copyright (c) 2016-2021 Amazon Technologies, Inc., its affiliates or licensors. All Rights Reserved. - -************************************* -CONFIDENTIAL - LIMITED RELEASE SOFTWARE - SUBJECT TO NONDISCLOSURE TERMS - -Project Spectra is a confidential, pre-release project. Without the prior written consent of Amazon, you may not disclose it or its existence to any third party that is not part of the Open 3D Engine project (each, a "Project Participant"). Please see the terms of your/your organization's nondisclosure agreement with Amazon for detailed terms. By accessing this software, you agree to these terms. - -Each Project Participant acknowledges that other Project Participants may now have, or in the future may develop or receive, information that is the same as, or similar to, Project Spectra without having breached an obligation of confidentiality to the other. Nothing in these terms (a) prevents a Project Participant from using, for any purpose and without compensating other Project Participants (or Amazon), information retained in the unaided memory of a Project Participant's personnel who have had access to Project Spectra or (b) obligates Project Participants to restrict the scope of employment of the Project Participant's Personnel; provided, however, that this section does not create a license under any copyright or patent of Amazon or any Project Participant. - -If you provide any suggestions, ideas, or other feedback in connection with Project Spectra ("Feedback"), all Project Participants will be entitled to use the Feedback without restriction. You agree to license any pull requests or other submissions of copyrighted material related to Project Spectra under the Apache 2.0 and MIT licenses. - -All materials are made available on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. Do not remove or modify any license notices. - -************************************* +OPEN 3D ENGINE LICENSING +The default license for Open 3D Engine is the Apache License, Version 2.0 +(see LICENSE_APACHE2.TXT); you may elect at your option to use the Open 3D +Engine under the MIT License (see LICENSE_MIT.TXT). Contributions must be +made under both licenses. + THIRD PARTY COMPONENTS - -Project Spectra requires the use of and makes available to you software and assets that have been developed by third parties and are subject to separate license terms (such as code licensed under an open source license), including the materials provided in \3rdParty. It is your responsibility to obtain and comply with the applicable licenses, along with any platform policies that may apply to you. Information on third party materials, and the applicable license terms, are referenced in or included with the materials, such as in separate LICENSE.txt files accompanying the materials. - -Please note that certain materials are subject to "copyleft" licenses, which require distribution of source code, including: -- Qt Toolkit https://github.com/qtproject/, which is subject to the GNU Lesser General Public License version 3 (with certain exceptions, see \3rdParty\Qt\). A copy of the source code for Qt Toolkit may be found at https://s3-us-west-2.amazonaws.com/ly-legal/LicenseConformance/Qt/Src.zip -- Chardet https://chardet.github.io/, which is subject to the GNU Lesser General Public License version 2.1. A copy of the source code may be found in \3rdParty\AWS\AWSPythonSDK\1.2.1\botocore\vendored\requests\packages\. - -This software contains Autodesk(R) FBX(R) code developed by Autodesk, Inc. Copyright 2013 Autodesk, Inc. All rights, reserved. Such code is provided "as is" and Autodesk, Inc. disclaims any and all warranties, whether express or implied, including without limitation the implied warranties of merchantability, fitness for a particular purpose or non-infringement of third party rights. In no event shall Autodesk, Inc. be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of such code. - -This product includes components of the PowerVR Tools Software from Imagination Technologies Limited. +Open 3D Engine requires the use of (and in some cases makes available to you) +software and assets that have been developed by third parties and are subject +to separate license terms (such as code licensed under other open source +licenses). It is your responsibility to comply with the applicable licenses. +Information on third party materials, and the applicable license terms, are +referenced in or included with the materials, such as in separate LICENSE.txt +files accompanying the materials. + +Please note that certain materials are subject to "copyleft" licenses, which +require distribution of source code, including: + +- Qt Toolkit https://github.com/qtproject/, which is subject to the GNU +Lesser General Public License version 3 (with certain exceptions). A copy of +the source code for Qt Toolkit may be found at +https://s3-us-west-2.amazonaws.com/ly-legal/LicenseConformance/Qt/Src.zip + +- The AWS Python SDK uses Chardet https://chardet.github.io/, which is +subject to the GNU Lesser General Public License version 2.1. A copy of the +source code may be found at https://github.com/chardet/chardet. + \ No newline at end of file diff --git a/LICENSE_APACHE2.TXT b/LICENSE_APACHE2.TXT new file mode 100644 index 0000000000..b7a7d6c0e5 --- /dev/null +++ b/LICENSE_APACHE2.TXT @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE_MIT.TXT b/LICENSE_MIT.TXT new file mode 100644 index 0000000000..1b16d6d320 --- /dev/null +++ b/LICENSE_MIT.TXT @@ -0,0 +1,7 @@ +Copyright Contributors to the Open 3D Engine + +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. \ No newline at end of file diff --git a/README.md b/README.md index 7a9751529f..9cc816efe9 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,7 @@ -# Project Spectra Private Preview - -## Confidentiality; Pre-Release Access - -Welcome to the Project Spectra Private Preview. This is a confidential pre-release project; your use is subject to the nondisclosure agreement between you (or your organization) and Amazon. Do not disclose the existence of this project, your participation in it, or any of the materials provided, to any unauthorized third party. To request access for a third party, please contact [Royal O'Brien, obriroya@amazon.com](mailto:obriroya@amazon.com). - -## Full instructions can be found here: -### https://docs.o3de.org/docs/welcome-guide/setup/setup-from-github/ -(Note: Contact Royal or [Doug Erickson, dougeric@amazon.com](mailto:dougeric@amazon.com) for access) - ## Updates to this readme +July 06, 2021 +- Switch licenses to APACHE-2.0 OR MIT + May 14, 2021 - Removed instructions for the 3rdParty zip file and downloader URL. This is no longer a requirement. - Updated instructions for dependencies @@ -59,7 +52,7 @@ git config --global credential.helper osxkeychain ### Clone the repository ```shell -> git clone https://github.com/aws-lumberyard/o3de.git +> git clone https://github.com/o3de/o3de.git Cloning into 'o3de'... # initial prompt for credentials to download the repository code From 71c6b3e506a52622ba9f749ab201f8edcd69ba0f Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 6 Jul 2021 14:17:21 -0500 Subject: [PATCH 061/156] Refresh cached transforms before saving. (#1858) If the prefab template saves default values for a cached transform, but *shouldn't* have default values, it will get patch application errors at runtime due to missing cached transform fields. Signed-off-by: mbalfour --- Code/Tools/SerializeContextTools/SliceConverter.cpp | 13 +++++++++++++ Code/Tools/SerializeContextTools/SliceConverter.h | 1 + 2 files changed, 14 insertions(+) diff --git a/Code/Tools/SerializeContextTools/SliceConverter.cpp b/Code/Tools/SerializeContextTools/SliceConverter.cpp index 0ffe7427e7..5730f2c8d6 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.cpp +++ b/Code/Tools/SerializeContextTools/SliceConverter.cpp @@ -330,6 +330,7 @@ namespace AZ prefabPlaceholderEntities.clear(); for (size_t curEntityIdx = 0; curEntityIdx < sliceEntities.size(); curEntityIdx++) { + UpdateCachedTransform(*(sliceEntities[curEntityIdx])); sourceInstance->AddEntity(*(sliceEntities[curEntityIdx]), entityAliases[curEntityIdx]); } @@ -631,12 +632,14 @@ namespace AZ AZ_Assert(false, "Couldn't find nested instance %s", it->c_str()); } } + UpdateCachedTransform(*entity); addingInstance->AddEntity(*entity, mappingStruct.m_entityAlias); addedEntityList.emplace_back(entity, addingInstance); } else { AZ_Assert(false, "Failed to find entity alias."); + UpdateCachedTransform(*entity); nestedInstance->AddEntity(*entity); addedEntityList.emplace_back(entity, nestedInstance.get()); } @@ -781,6 +784,16 @@ namespace AZ } } + void SliceConverter::UpdateCachedTransform(const AZ::Entity& entity) + { + AzToolsFramework::Components::TransformComponent* transformComponent = + entity.FindComponent(); + if (transformComponent) + { + transformComponent->UpdateCachedWorldTransform(); + } + } + void SliceConverter::PrintPrefab(AzToolsFramework::Prefab::TemplateId templateId) { auto prefabSystemComponentInterface = AZ::Interface::Get(); diff --git a/Code/Tools/SerializeContextTools/SliceConverter.h b/Code/Tools/SerializeContextTools/SliceConverter.h index 07fddc8fa1..1e6aec4208 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.h +++ b/Code/Tools/SerializeContextTools/SliceConverter.h @@ -72,6 +72,7 @@ namespace AZ bool ConvertSliceInstance( AZ::SliceComponent::SliceInstance& instance, AZ::Data::Asset& sliceAsset, AzToolsFramework::Prefab::TemplateReference nestedTemplate, AzToolsFramework::Prefab::Instance* topLevelInstance); + void UpdateCachedTransform(const AZ::Entity& entity); void SetParentEntity(const AZ::Entity& entity, const AZ::EntityId& parentId, bool onlySetIfInvalid); void PrintPrefab(AzToolsFramework::Prefab::TemplateId templateId); bool SavePrefab(AZ::IO::PathView outputPath, AzToolsFramework::Prefab::TemplateId templateId); From 360236b89e157c07bd89f4bbadd71d4ebf2f0546 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 6 Jul 2021 13:13:16 -0700 Subject: [PATCH 062/156] The Great ScriptCanvas Purge, Part IV Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetConversionBus.h | 4 - .../Code/Asset/EditorAssetSystemComponent.cpp | 22 -- .../Code/Asset/EditorAssetSystemComponent.h | 3 - .../Builder/ScriptCanvasBuilderComponent.cpp | 6 +- .../Code/Builder/ScriptCanvasBuilderWorker.h | 6 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 55 --- .../ScriptCanvasFunctionBuilderWorker.cpp | 338 ------------------ .../ScriptCanvasFunctionAssetHandler.cpp | 157 -------- .../ScriptCanvasFunctionAssetHolder.cpp | 201 ----------- .../ScriptCanvasFunctionAssetHolder.h | 75 ---- .../Assets/ScriptCanvasAssetHelpers.cpp | 1 - .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 26 -- .../Editor/Assets/ScriptCanvasMemoryAsset.h | 1 - .../Editor/Nodes/ScriptCanvasAssetNode.cpp | 5 - .../Code/Editor/Nodes/ScriptCanvasAssetNode.h | 1 - .../ScriptCanvasNodePaletteDockWidget.cpp | 2 +- .../VariablePanel/GraphVariablesTableView.cpp | 3 +- .../VariablePanel/SlotTypeSelectorWidget.cpp | 1 - .../VariablePanel/VariableDockWidget.cpp | 3 +- .../Functions/ScriptCanvasFunctionAsset.h | 145 -------- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 3 +- .../Code/Include/ScriptCanvas/Core/Graph.h | 8 +- .../Code/Include/ScriptCanvas/Core/GraphBus.h | 46 ++- .../Code/Include/ScriptCanvas/Core/Node.cpp | 117 ++---- .../Code/Include/ScriptCanvas/Core/Node.h | 219 +----------- .../ScriptCanvas/Core/NodeFunctionGeneric.h | 9 - .../Include/ScriptCanvas/Core/SignalBus.h | 36 -- .../Code/Include/ScriptCanvas/Core/Slot.cpp | 14 +- .../Code/Include/ScriptCanvas/Core/Slot.h | 4 - .../ScriptCanvas/Core/SubgraphInterface.h | 10 - .../ScriptCanvas/Execution/RuntimeBus.h | 103 ------ .../Grammar/AbstractCodeModel.cpp | 11 - .../ScriptCanvas/Grammar/AbstractCodeModel.h | 18 - .../Grammar/FunctionsLegacySupport.cpp | 283 --------------- .../Grammar/FunctionsLegacySupport.h | 20 -- .../Grammar/PrimitivesDeclarations.h | 4 - .../Internal/Nodes/BaseTimerNode.cpp | 133 +------ .../Internal/Nodes/BaseTimerNode.h | 24 +- .../Internal/Nodes/ExpressionNodeBase.cpp | 31 -- .../Internal/Nodes/ExpressionNodeBase.h | 5 - .../Libraries/Comparison/EqualTo.h | 16 - .../Libraries/Comparison/Greater.h | 15 - .../Libraries/Comparison/GreaterEqual.h | 15 - .../ScriptCanvas/Libraries/Comparison/Less.h | 16 - .../Libraries/Comparison/LessEqual.h | 16 - .../Libraries/Comparison/NotEqualTo.h | 16 - .../Libraries/Core/BinaryOperator.cpp | 47 --- .../Libraries/Core/BinaryOperator.h | 23 +- .../Libraries/Core/EBusEventHandler.cpp | 151 -------- .../Libraries/Core/EBusEventHandler.h | 21 +- .../Libraries/Core/GetVariable.cpp | 48 +-- .../ScriptCanvas/Libraries/Core/GetVariable.h | 3 - .../Libraries/Core/MethodUtility.cpp | 99 ----- .../Libraries/Core/MethodUtility.h | 193 ---------- .../Libraries/Core/ReceiveScriptEvent.cpp | 232 +----------- .../Libraries/Core/ReceiveScriptEvent.h | 10 - .../ScriptCanvas/Libraries/Core/Repeater.cpp | 22 -- .../ScriptCanvas/Libraries/Core/Repeater.h | 8 +- .../Libraries/Core/ScriptEventBase.cpp | 2 - .../Libraries/Core/ScriptEventBase.h | 4 +- .../Libraries/Core/SendScriptEvent.cpp | 63 ---- .../Libraries/Core/SendScriptEvent.h | 4 - .../Libraries/Core/SetVariable.cpp | 50 +-- .../ScriptCanvas/Libraries/Core/SetVariable.h | 5 +- .../ScriptCanvas/Libraries/Core/Start.cpp | 25 -- .../ScriptCanvas/Libraries/Core/Start.h | 5 - .../ScriptCanvas/Libraries/Logic/And.h | 5 - .../ScriptCanvas/Libraries/Logic/Any.cpp | 6 - .../ScriptCanvas/Libraries/Logic/Any.h | 8 +- .../ScriptCanvas/Libraries/Logic/Cycle.cpp | 20 -- .../ScriptCanvas/Libraries/Logic/Cycle.h | 4 - .../ScriptCanvas/Libraries/Logic/Indexer.cpp | 37 -- .../ScriptCanvas/Libraries/Logic/Indexer.h | 8 - .../ScriptCanvas/Libraries/Logic/IsNull.cpp | 7 - .../ScriptCanvas/Libraries/Logic/IsNull.h | 5 - .../Libraries/Logic/Multiplexer.cpp | 42 --- .../Libraries/Logic/Multiplexer.h | 6 - .../Include/ScriptCanvas/Libraries/Logic/Or.h | 5 - .../Libraries/Logic/Sequencer.cpp | 44 --- .../ScriptCanvas/Libraries/Logic/Sequencer.h | 4 - .../Libraries/Logic/TargetedSequencer.cpp | 25 -- .../Libraries/Logic/TargetedSequencer.h | 1 - .../Logic/WeightedRandomSequencer.cpp | 57 --- .../Libraries/Logic/WeightedRandomSequencer.h | 8 +- .../ScriptCanvas/Libraries/Math/Divide.h | 15 - .../ScriptCanvas/Libraries/Math/Multiply.h | 6 - .../ScriptCanvas/Libraries/Math/Subtract.h | 6 - .../Include/ScriptCanvas/Libraries/Math/Sum.h | 6 - .../Operators/Containers/OperatorAt.cpp | 64 ---- .../Operators/Containers/OperatorAt.h | 3 - .../Operators/Containers/OperatorBack.cpp | 37 -- .../Operators/Containers/OperatorBack.h | 1 - .../Operators/Containers/OperatorClear.cpp | 30 -- .../Operators/Containers/OperatorClear.h | 4 - .../Operators/Containers/OperatorEmpty.cpp | 43 --- .../Operators/Containers/OperatorEmpty.h | 7 - .../Operators/Containers/OperatorErase.cpp | 41 --- .../Operators/Containers/OperatorErase.h | 2 - .../Operators/Containers/OperatorFront.cpp | 37 -- .../Operators/Containers/OperatorFront.h | 1 - .../Operators/Containers/OperatorInsert.cpp | 102 ------ .../Operators/Containers/OperatorInsert.h | 3 - .../Operators/Containers/OperatorPushBack.cpp | 67 ---- .../Operators/Containers/OperatorPushBack.h | 3 - .../Operators/Containers/OperatorSize.cpp | 36 -- .../Operators/Containers/OperatorSize.h | 3 - .../Operators/Math/OperatorArithmetic.cpp | 62 ---- .../Operators/Math/OperatorArithmetic.h | 3 +- .../Operators/Math/OperatorDivideByNumber.cpp | 92 ----- .../Operators/Math/OperatorDivideByNumber.h | 1 - .../Operators/Math/OperatorLength.cpp | 52 --- .../Libraries/Operators/Math/OperatorLength.h | 3 - .../Libraries/Operators/Math/OperatorLerp.cpp | 172 +-------- .../Libraries/Operators/Math/OperatorLerp.h | 90 +---- .../Libraries/Operators/Operator.h | 33 -- .../Libraries/String/.vs/ProjectSettings.json | 3 + .../String/.vs/String/v16/Browse.VC.db | Bin 0 -> 294912 bytes .../String/.vs/VSWorkspaceState.json | 6 + .../Libraries/String/.vs/slnx.sqlite | Bin 0 -> 90112 bytes .../Libraries/String/Contains.cpp | 26 -- .../ScriptCanvas/Libraries/String/Contains.h | 4 - .../ScriptCanvas/Libraries/String/Format.cpp | 15 +- .../ScriptCanvas/Libraries/String/Format.h | 6 +- .../ScriptCanvas/Libraries/String/Print.cpp | 39 -- .../ScriptCanvas/Libraries/String/Print.h | 8 +- .../ScriptCanvas/Libraries/String/Replace.cpp | 22 -- .../ScriptCanvas/Libraries/String/Replace.h | 5 - .../Libraries/String/Utilities.cpp | 93 ----- .../ScriptCanvas/Libraries/String/Utilities.h | 16 +- .../ScriptCanvas/Libraries/Time/Countdown.cpp | 141 -------- .../ScriptCanvas/Libraries/Time/Countdown.h | 25 -- .../ScriptCanvas/Libraries/Time/Duration.cpp | 42 --- .../ScriptCanvas/Libraries/Time/Duration.h | 9 - .../ScriptCanvas/Libraries/Time/HeartBeat.cpp | 16 - .../ScriptCanvas/Libraries/Time/HeartBeat.h | 3 - .../ScriptCanvas/Libraries/Time/Timer.cpp | 43 --- .../ScriptCanvas/Libraries/Time/Timer.h | 6 - .../Libraries/UnitTesting/AddFailure.cpp | 8 +- .../Libraries/UnitTesting/AddFailure.h | 3 - .../Libraries/UnitTesting/AddSuccess.cpp | 30 -- .../Libraries/UnitTesting/AddSuccess.h | 3 - .../Libraries/UnitTesting/Checkpoint.cpp | 28 -- .../Libraries/UnitTesting/Checkpoint.h | 3 - .../Libraries/UnitTesting/ExpectEqual.cpp | 34 -- .../Libraries/UnitTesting/ExpectEqual.h | 2 - .../Libraries/UnitTesting/ExpectFalse.cpp | 14 - .../Libraries/UnitTesting/ExpectFalse.h | 2 - .../UnitTesting/ExpectGreaterThan.cpp | 34 -- .../Libraries/UnitTesting/ExpectGreaterThan.h | 2 - .../UnitTesting/ExpectGreaterThanEqual.cpp | 34 -- .../UnitTesting/ExpectGreaterThanEqual.h | 2 - .../Libraries/UnitTesting/ExpectLessThan.cpp | 35 -- .../Libraries/UnitTesting/ExpectLessThan.h | 2 - .../UnitTesting/ExpectLessThanEqual.cpp | 34 -- .../UnitTesting/ExpectLessThanEqual.h | 2 - .../Libraries/UnitTesting/ExpectNotEqual.cpp | 34 -- .../Libraries/UnitTesting/ExpectNotEqual.h | 2 - .../Libraries/UnitTesting/ExpectTrue.cpp | 10 - .../Libraries/UnitTesting/ExpectTrue.h | 4 +- .../Libraries/UnitTesting/MarkComplete.cpp | 26 -- .../Libraries/UnitTesting/MarkComplete.h | 3 - .../ScriptCanvas/Variable/GraphVariable.cpp | 34 +- .../ScriptCanvas/Variable/GraphVariable.h | 4 +- .../Code/scriptcanvasgem_common_files.cmake | 12 - .../Framework/ScriptCanvasTestNodes.cpp | 112 ------ .../Source/Framework/ScriptCanvasTestNodes.h | 17 +- .../Framework/ScriptCanvasTestUtilities.h | 17 - .../Tests/ScriptCanvas_BehaviorContext.cpp | 139 ------- .../Code/Tests/ScriptCanvas_Core.cpp | 202 ----------- .../Tests/ScriptCanvas_RuntimeInterpreted.cpp | 178 --------- .../Code/Source/InputNode.cpp | 90 ----- .../Code/Source/InputNode.h | 21 +- .../Code/startingpointinput_files.cmake | 1 - 173 files changed, 131 insertions(+), 6154 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Builder/ScriptCanvasFunctionBuilderWorker.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHandler.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/ScriptCanvasFunctionAsset.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SignalBus.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeBus.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.cpp create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.cpp delete mode 100644 Gems/StartingPointInput/Code/Source/InputNode.cpp diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h index 8e53db20b0..26badc528d 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h @@ -19,7 +19,6 @@ namespace AZ namespace ScriptCanvas { - class ScriptCanvasFunctionAsset; class RuntimeAsset; class SubgraphInterfaceAsset; } @@ -27,7 +26,6 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { class ScriptCanvasAsset; - class ScriptCanvasFunctionAsset; class EditorAssetConversionBusTraits : public AZ::EBusTraits @@ -36,10 +34,8 @@ namespace ScriptCanvasEditor static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; virtual AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) = 0; - virtual AZ::Data::Asset LoadFunctionAsset(AZStd::string_view graphPath) = 0; virtual AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) = 0; virtual AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) = 0; - virtual AZ::Outcome, AZStd::string> CreateFunctionRuntimeAsset(const AZ::Data::Asset& editAsset) = 0; }; using EditorAssetConversionBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 4b6b7227a4..97bba9b7e6 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -28,8 +28,6 @@ AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING -#include -#include #include namespace ScriptCanvasEditor @@ -77,7 +75,6 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Activate() { m_editorAssetRegistry.Register(); - m_editorAssetRegistry.Register(); m_editorAssetRegistry.Register(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); @@ -131,30 +128,11 @@ namespace ScriptCanvasEditor } } - AZ::Data::Asset EditorAssetSystemComponent::LoadFunctionAsset(AZStd::string_view graphPath) - { - auto outcome = ScriptCanvasBuilder::LoadEditorFunctionAsset(graphPath); - - if (outcome.IsSuccess()) - { - return outcome.GetValue(); - } - else - { - return {}; - } - } - AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateRuntimeAsset(const AZ::Data::Asset& editAsset) { return ScriptCanvasBuilder::CreateRuntimeAsset(editAsset); } - AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateFunctionRuntimeAsset(const AZ::Data::Asset& editAsset) - { - return ScriptCanvasBuilder::CreateRuntimeFunctionAsset(editAsset); - } - AZ::Outcome EditorAssetSystemComponent::CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) { return ScriptCanvasBuilder::CreateLuaAsset(editAsset->GetScriptCanvasEntity(), editAsset->GetId(), graphPathForRawLuaFile); diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h index 0a8bf830af..4a55a35908 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h @@ -22,7 +22,6 @@ namespace ScriptCanvasEditor { class ScriptCanvasAsset; - class ScriptCanvasFunctionAsset; class EditorAssetSystemComponent : public AZ::Component @@ -57,9 +56,7 @@ namespace ScriptCanvasEditor ////////////////////////////////////////////////////////////////////////// // EditorAssetConversionBus::Handler... AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) override; - AZ::Data::Asset LoadFunctionAsset(AZStd::string_view graphPath) override; AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) override; - AZ::Outcome, AZStd::string> CreateFunctionRuntimeAsset(const AZ::Data::Asset& editAsset) override; AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) override; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index c3e5b03041..ea714f356f 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -13,10 +13,8 @@ #include #include #include -#include -#include +#include #include -#include #include #include @@ -50,7 +48,6 @@ namespace ScriptCanvasBuilder SharedHandlers HandleAssetTypes() { SharedHandlers handlers; - handlers.m_editorFunctionAssetHandler = RegisterHandler("scriptcanvas_fn", false); handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); handlers.m_subgraphInterfaceHandler = RegisterHandler("scriptcanvas_fn_compiled", true); handlers.m_runtimeAssetHandler = RegisterHandler("scriptcanvas_compiled", true); @@ -123,7 +120,6 @@ namespace ScriptCanvasBuilder builderDescriptor.m_productsToKeepOnFailure[s_scriptCanvasProcessJobKey] = { AZ_CRC("SubgraphInterface", 0xdfe6dc72) }; AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, builderDescriptor); ScriptCanvas::Grammar::RequestBus::Handler::BusConnect(); - AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::RegisterSourceAssetType, azrtti_typeid(), ScriptCanvasEditor::ScriptCanvasFunctionAsset::Description::GetFileFilter()); } m_sharedHandlers = HandleAssetTypes(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index fa6ed17a3c..df432578d4 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -36,8 +36,8 @@ namespace ScriptCanvasEditor { class Graph; class ScriptCanvasAsset; - class ScriptCanvasFunctionAsset; } + namespace ScriptCanvasBuilder { constexpr const char* s_scriptCanvasBuilder = "ScriptCanvasBuilder"; @@ -122,8 +122,6 @@ namespace ScriptCanvasBuilder AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& asset); - AZ::Outcome, AZStd::string> CreateRuntimeFunctionAsset(const AZ::Data::Asset& asset); - AZ::Outcome CompileGraphData(AZ::Entity* scriptCanvasEntity); AZ::Outcome CompileVariableData(AZ::Entity* scriptCanvasEntity); @@ -134,8 +132,6 @@ namespace ScriptCanvasBuilder AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB = {}); - AZ::Outcome, AZStd::string> LoadEditorFunctionAsset(AZStd::string_view graphPath); - AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath); AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 94f09b4b9a..73d32ba16a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -8,7 +8,6 @@ #include "precompiled.h" #include -#include #include #include #include @@ -160,18 +159,6 @@ namespace ScriptCanvasBuilder return AZ::Success(runtimeAsset); } - AZ::Outcome, AZStd::string> CreateRuntimeFunctionAsset(const AZ::Data::Asset& editAsset) - { - // Flush asset manager events to ensure no asset references are held by closures queued on Ebuses. - AZ::Data::AssetManager::Instance().DispatchEvents(); - - auto runtimeAssetId = editAsset.GetId(); - runtimeAssetId.m_subId = AZ_CRC("SubgraphInterface", 0xdfe6dc72); - AZ::Data::Asset runtimeAsset; - runtimeAsset.Create(runtimeAssetId); - return AZ::Success(runtimeAsset); - } - AZ::Outcome CompileGraphData(AZ::Entity* scriptCanvasEntity) { typedef AZStd::pair< ScriptCanvas::Node*, AZ::Entity* > NodeEntityPair; @@ -452,48 +439,6 @@ namespace ScriptCanvasBuilder return AZ::Success(asset); } - AZ::Outcome, AZStd::string> LoadEditorFunctionAsset(AZStd::string_view filePath) - { - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream stream(filePath.data(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - return AZ::Failure(AZStd::string::format("File failed to open: %s", filePath.data())); - } - AZStd::vector fileBuffer(stream.GetLength()); - size_t bytesRead = stream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != stream.GetLength()) - { - return AZ::Failure(AZStd::string::format("File failed to open: %s", filePath.data())); - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(filePath.data(), AZ::IO::OpenMode::ModeRead)) - { - return AZ::Failure(AZStd::string::format("File failed to open: %s", filePath.data())); - } - - ScriptCanvasEditor::ScriptCanvasFunctionAssetHandler editorAssetHandler; - - AZ::SerializeContext* context{}; - AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - - if (editorAssetHandler.LoadAssetData(asset, assetDataStream, AZ::Data::AssetFilterCB{}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - return AZ::Failure(AZStd::string::format("Failed to load ScriptCavas Function asset: %s", filePath.data())); - } - - return AZ::Success(asset); - } - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity) { auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasFunctionBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasFunctionBuilderWorker.cpp deleted file mode 100644 index 5ff5069141..0000000000 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasFunctionBuilderWorker.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "precompiled.h" - -#include "platform.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ScriptCanvasBuilder -{ - void FunctionWorker::Activate(const AssetHandlers& handlers) - { - m_editorAssetHandler = handlers.m_editorFunctionAssetHandler; - m_runtimeAssetHandler = handlers.m_runtimeAssetHandler; - m_subgraphInterfaceHandler = handlers.m_subgraphInterfaceHandler; - } - - void FunctionWorker::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const - { - AZ_TracePrintf(s_scriptCanvasBuilder, "Start Creating Job"); - AZStd::string fullPath; - AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); - AzFramework::StringFunc::Path::Normalize(fullPath); - - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); - } - - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - AZStd::vector fileBuffer(stream.GetLength()); - size_t bytesRead = stream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != stream.GetLength()) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be read.", fullPath.data()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - m_sourceDependencies.clear(); - - auto assetFilter = [&response, this](const AZ::Data::AssetFilterInfo& filterInfo) - { - if (filterInfo.m_assetType == azrtti_typeid() || - filterInfo.m_assetType == azrtti_typeid() || - filterInfo.m_assetType == azrtti_typeid() || - filterInfo.m_assetType == azrtti_typeid()) // this required, since nodes reference this, rather than the editor asset - { - AssetBuilderSDK::SourceFileDependency dependency; - dependency.m_sourceFileDependencyUUID = filterInfo.m_assetId.m_guid; - - response.m_sourceFileDependencyList.push_back(dependency); - } - - // Asset filter always returns false to prevent parsing dependencies, but makes note of the script canvas dependencies - return false; - }; - - AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - ScriptCanvasEditor::ScriptCanvasFunctionAssetHandler* functionAssetHandler = azrtti_cast(m_editorAssetHandler); - if (functionAssetHandler->LoadAssetData(asset, assetDataStream, assetFilter) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); - return; - } - - // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. - AZ::Data::AssetManager::Instance().DispatchEvents(); - - auto* scriptCanvasEntity = asset.Get()->GetScriptCanvasEntity(); - auto* sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); - AZ_Assert(sourceGraph, "Graph component is missing from entity."); - size_t fingerprint = 0; - const AZStd::set sortedEntities(sourceGraph->GetGraphData()->m_nodes.begin(), sourceGraph->GetGraphData()->m_nodes.end()); - for (auto& nodeEntity : sortedEntities) - { - if (auto nodeComponent = AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity)) - { - AZStd::hash_combine(fingerprint, nodeComponent->GenerateFingerprint()); - } - } - -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) - { - if (info.HasTag("tools")) - { - AssetBuilderSDK::JobDescriptor copyDescriptor; - copyDescriptor.m_priority = 2; - copyDescriptor.m_critical = true; - copyDescriptor.m_jobKey = s_scriptCanvasCopyJobKey; - copyDescriptor.SetPlatformIdentifier(info.m_identifier.c_str()); - copyDescriptor.m_additionalFingerprintInfo = AZStd::string(GetFingerprintString()).append("|").append(AZStd::to_string(static_cast(fingerprint))); - response.m_createJobOutputs.push_back(copyDescriptor); - } - - AssetBuilderSDK::JobDescriptor jobDescriptor; - jobDescriptor.m_priority = 2; - jobDescriptor.m_critical = true; - jobDescriptor.m_jobKey = s_scriptCanvasProcessJobKey; - jobDescriptor.SetPlatformIdentifier(info.m_identifier.c_str()); - jobDescriptor.m_additionalFingerprintInfo = AZStd::string(GetFingerprintString()).append("|").append(AZStd::to_string(static_cast(fingerprint))); - // Function process job needs to wait until its dependency asset job finished - for (const auto& sourceDependency : response.m_sourceFileDependencyList) - { - AssetBuilderSDK::JobDependency jobDep(s_scriptCanvasBuilder, info.m_identifier.c_str(), AssetBuilderSDK::JobDependencyType::OrderOnce, sourceDependency); - jobDescriptor.m_jobDependencyList.emplace_back(jobDep); - } - response.m_createJobOutputs.push_back(jobDescriptor); - } -#endif - - response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; - AZ_TracePrintf(s_scriptCanvasBuilder, "Finish Creating Job"); - } - - - - const char* FunctionWorker::GetFingerprintString() const - { - if (m_fingerprintString.empty()) - { - // compute it the first time - const AZStd::string runtimeAssetTypeId = azrtti_typeid().ToString(); - m_fingerprintString = AZStd::string::format("%i%s", GetVersionNumber(), runtimeAssetTypeId.c_str()); - } - return m_fingerprintString.c_str(); - } - - int FunctionWorker::GetVersionNumber() const - { - return GetBuilderVersion(); - } - - AZ::Uuid FunctionWorker::GetUUID() - { - return AZ::Uuid::CreateString("{7227E0E1-4113-456A-877B-B2276ACB292B}"); - } - - - void FunctionWorker::ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const - { - AZ_TracePrintf(s_scriptCanvasBuilder, "Start Processing Job"); - // A runtime script canvas component is generated, which creates a .scriptcanvas_compiled file - AZStd::string fullPath; - AZStd::string fileNameOnly; - AzFramework::StringFunc::Path::GetFullFileName(request.m_sourceFile.c_str(), fileNameOnly); - fullPath = request.m_fullPath.c_str(); - AzFramework::StringFunc::Path::Normalize(fullPath); - - bool pathFound = false; - AZStd::string relativePath; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound - , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath - , request.m_fullPath.c_str(), relativePath); - - if (!pathFound) - { - AZ_Error(s_scriptCanvasBuilder, false, "Failed to get engine relative path from %s", request.m_fullPath.c_str()); - return; - } - - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no editor asset handler was registered for script canvas. The ScriptCanvas Gem might not be enabled.)", fullPath.data()); - return; - } - - if (!m_runtimeAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no runtime asset handler was registered for script canvas.)", fullPath.data()); - return; - } - - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream stream(fullPath.data(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "Exporting of .scriptcanvas for \"%s\" failed because the source file could not be opened.", fullPath.c_str()); - return; - } - AZStd::vector fileBuffer(stream.GetLength()); - size_t bytesRead = stream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != stream.GetLength()) - { - AZ_Warning(s_scriptCanvasBuilder, false, "Exporting of .scriptcanvas for \"%s\" failed because the source file could not be opened.", fullPath.c_str()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - AZ::SerializeContext* context{}; - AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - AZ::Data::Asset asset; - asset.Create(request.m_sourceFileUUID); - ScriptCanvasEditor::ScriptCanvasFunctionAssetHandler* functionAssetHandler = azrtti_cast(m_editorAssetHandler); - if (functionAssetHandler->LoadAssetData(asset, assetDataStream, nullptr) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(Loading of ScriptCanvas asset for source file "%s" has failed)", fullPath.data()); - return; - } - - // Flush asset manager events to ensure no asset references are held by closures queued on Ebuses. - AZ::Data::AssetManager::Instance().DispatchEvents(); - - AZStd::string runtimeScriptCanvasOutputPath; - AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), fileNameOnly.c_str(), runtimeScriptCanvasOutputPath, true, true); - AzFramework::StringFunc::Path::ReplaceExtension(runtimeScriptCanvasOutputPath, ScriptCanvas::SubgraphInterfaceAsset::GetFileExtension()); - - if (request.m_jobDescription.m_jobKey == s_scriptCanvasCopyJobKey) - { - // ScriptCanvas Editor Asset Copy job - // The SubID is zero as this represents the main asset - AssetBuilderSDK::JobProduct jobProduct; - jobProduct.m_productFileName = fullPath; - jobProduct.m_productAssetType = azrtti_typeid(); - jobProduct.m_productSubID = 0; - jobProduct.m_dependenciesHandled = true; - response.m_outputProducts.push_back(AZStd::move(jobProduct)); - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else - { - // force load all dependencies into memory - for (auto& dependency : m_sourceDependencies) - { - AZ::Data::AssetManager::Instance().GetAsset(dependency.GetId(), dependency.GetType(), AZ::Data::AssetLoadBehavior::PreLoad); - } - - AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity(); - - ProcessTranslationJobInput input; - input.assetID = AZ::Data::AssetId(request.m_sourceFileUUID, AZ_CRC("RuntimeData", 0x163310ae)); - input.request = &request; - input.response = &response; - input.runtimeScriptCanvasOutputPath = runtimeScriptCanvasOutputPath; - input.assetHandler = m_runtimeAssetHandler; - input.buildEntity = buildEntity; - input.fullPath = fullPath; - input.fileNameOnly = fileNameOnly; - input.namespacePath = relativePath; - input.saveRawLua = true; - - auto translationOutcome = ProcessTranslationJob(input); - if (translationOutcome.IsSuccess()) - { - AzFramework::StringFunc::Path::ReplaceExtension(input.runtimeScriptCanvasOutputPath, ScriptCanvas::RuntimeAsset::GetFileExtension()); - auto saveRuntimAssetOutcome = SaveRuntimeAsset(input, input.runtimeDataOut); - if (saveRuntimAssetOutcome.IsSuccess()) - { - // \todo this file is only required on PC editor builds, cull it in packaging, here or wherever appropriate - AzFramework::StringFunc::Path::StripExtension(fileNameOnly); - - ScriptCanvas::SubgraphInterfaceData functionInterface; - functionInterface.m_name = fileNameOnly; - functionInterface.m_interface = AZStd::move(input.interfaceOut); - - // save function interface - input.assetHandler = m_subgraphInterfaceHandler; - - AzFramework::StringFunc::Path::ReplaceExtension(input.runtimeScriptCanvasOutputPath, ScriptCanvas::SubgraphInterfaceAsset::GetFileExtension()); - auto saveInterfaceOutcome = SaveSubgraphInterface(input, functionInterface); - if (saveInterfaceOutcome.IsSuccess()) - { - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else - { - AZ_Error(s_scriptCanvasBuilder, false, saveInterfaceOutcome.GetError().data()); - } - } - else - { - AZ_Error(s_scriptCanvasBuilder, false, saveRuntimAssetOutcome.GetError().data()); - } - } - else if (AzFramework::StringFunc::Find(translationOutcome.GetError().data(), ScriptCanvas::ParseErrors::SourceUpdateRequired) != AZStd::string::npos) - { - AZ_Warning(s_scriptCanvasBuilder, false, ScriptCanvas::ParseErrors::SourceUpdateRequired); - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else if (AzFramework::StringFunc::Find(fileNameOnly, s_unitTestParseErrorPrefix) != AZStd::string::npos) - { - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else - { - AZ_Warning(s_scriptCanvasBuilder, false, translationOutcome.GetError().data()); - } - } - - AZ_TracePrintf(s_scriptCanvasBuilder, "Finish Processing Job"); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHandler.cpp deleted file mode 100644 index 9f50f32cf5..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHandler.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "precompiled.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace ScriptCanvasEditor -{ - ScriptCanvasFunctionAssetHandler::ScriptCanvasFunctionAssetHandler(AZ::SerializeContext* context) - : ScriptCanvasAssetHandler(context) - { - AZ::AssetTypeInfoBus::MultiHandler::BusConnect(azrtti_typeid()); - } - - ScriptCanvasFunctionAssetHandler::~ScriptCanvasFunctionAssetHandler() - { - AZ::AssetTypeInfoBus::MultiHandler::BusDisconnect(); - } - - AZ::Data::AssetPtr ScriptCanvasFunctionAssetHandler::CreateAsset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) - { - AZ_UNUSED(type); - - ScriptCanvasEditor::ScriptCanvasFunctionAsset* assetData = aznew ScriptCanvasEditor::ScriptCanvasFunctionAsset(id); - - AZ::Entity* scriptCanvasEntity = aznew AZ::Entity(ScriptCanvas::AssetDescription::GetEntityName()); - SystemRequestBus::Broadcast(&SystemRequests::CreateEditorComponentsOnEntity, scriptCanvasEntity, azrtti_typeid()); - assetData->m_cachedComponent = scriptCanvasEntity->CreateComponent(); - - assetData->SetScriptCanvasEntity(scriptCanvasEntity); - - return assetData; - } - - AZ::Data::AssetHandler::LoadResult ScriptCanvasFunctionAssetHandler::LoadAssetData( - const AZ::Data::Asset& asset, - AZStd::shared_ptr stream, - const AZ::Data::AssetFilterCB& assetLoadFilterCB) - { - ScriptCanvasEditor::ScriptCanvasFunctionAsset* scriptCanvasAsset = asset.GetAs(); - AZ_Assert(m_serializeContext, "ScriptCanvasFunctionAssetHandler needs to be initialized with a SerializeContext"); - - if (scriptCanvasAsset) - { - stream->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - - bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, scriptCanvasAsset->GetScriptCanvasData(), m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES)); - if (loadSuccess) - { - scriptCanvasAsset->m_cachedComponent = scriptCanvasAsset->GetScriptCanvasData().GetScriptCanvasEntity()->FindComponent(); - } - - return loadSuccess ? AZ::Data::AssetHandler::LoadResult::LoadComplete : AZ::Data::AssetHandler::LoadResult::Error; - } - return AZ::Data::AssetHandler::LoadResult::Error; - } - - bool ScriptCanvasFunctionAssetHandler::SaveAssetData(const AZ::Data::Asset& asset, AZ::IO::GenericStream* stream) - { - return SaveAssetData(asset.GetAs(), stream); - } - - bool ScriptCanvasFunctionAssetHandler::SaveAssetData(const ScriptCanvasEditor::ScriptCanvasFunctionAsset* assetData, AZ::IO::GenericStream* stream) - { - return SaveAssetData(assetData, stream, AZ::DataStream::ST_XML); - } - - bool ScriptCanvasFunctionAssetHandler::SaveAssetData(const ScriptCanvasEditor::ScriptCanvasFunctionAsset* assetData, AZ::IO::GenericStream* stream, AZ::DataStream::StreamType streamType) - { - if (assetData && m_serializeContext) - { - AZStd::vector byteBuffer; - AZ::IO::ByteContainerStream byteStream(&byteBuffer); - AZ::ObjectStream* objStream = AZ::ObjectStream::Create(&byteStream, *m_serializeContext, streamType); - - const ScriptCanvas::ScriptCanvasData& functionData = assetData->GetScriptCanvasData(); - bool assetSaved = objStream->WriteClass(&functionData); - objStream->Finalize(); - assetSaved = stream->Write(byteBuffer.size(), byteBuffer.data()) == byteBuffer.size() && assetSaved; - return assetSaved; - } - - return false; - } - - AZ::Data::AssetType ScriptCanvasFunctionAssetHandler::GetAssetType() const - { - return ScriptCanvasFunctionAssetHandler::GetAssetTypeStatic(); - } - - const char* ScriptCanvasFunctionAssetHandler::GetAssetTypeDisplayName() const - { - return ScriptCanvas::AssetDescription::GetAssetTypeDisplayName(); - } - - bool ScriptCanvasFunctionAssetHandler::CanCreateComponent([[maybe_unused]] const AZ::Data::AssetId& assetId) const - { - return false; - } - - void ScriptCanvasFunctionAssetHandler::GetAssetTypeExtensions(AZStd::vector& extensions) - { - const AZ::Uuid& assetType = *AZ::AssetTypeInfoBus::GetCurrentBusId(); - if (assetType == AZ::AzTypeInfo::Uuid()) - { - extensions.push_back(ScriptCanvas::AssetDescription::GetExtension()); - } - } - - void ScriptCanvasFunctionAssetHandler::GetHandledAssetTypes(AZStd::vector& assetTypes) - { - assetTypes.push_back(AZ::AzTypeInfo::Uuid()); - } - - - AZ::Data::AssetType ScriptCanvasFunctionAssetHandler::GetAssetTypeStatic() - { - return azrtti_typeid(); - } - - const char* ScriptCanvasFunctionAssetHandler::GetGroup() const - { - return ScriptCanvas::AssetDescription::GetGroup(); - } - - const char* ScriptCanvasFunctionAssetHandler::GetBrowserIcon() const - { - return ScriptCanvas::AssetDescription::GetIconPath(); - } - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.cpp deleted file mode 100644 index a3559f0123..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.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 "precompiled.h" - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace ScriptCanvasEditor -{ - //========================================================================= - void ScriptCanvasFunctionAssetHolder::Reflect(AZ::ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("m_asset", &ScriptCanvasFunctionAssetHolder::m_scriptCanvasAssetId) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Script Canvas", "Script Canvas Function Asset Holder") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->DataElement(AZ::Edit::UIHandlers::Default, &ScriptCanvasFunctionAssetHolder::m_scriptCanvasAssetId, "Script Canvas Function Asset", "Script Canvas asset associated with this component") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &ScriptCanvasFunctionAssetHolder::OnScriptChanged) - ->Attribute("EditButton", "Editor/Icons/PropertyEditor/open_in.png") - ->Attribute("EditDescription", "Open in Script Canvas Editor") - ->Attribute("EditCallback", &ScriptCanvasFunctionAssetHolder::LaunchScriptCanvasEditor) - ; - } - } - } - - ScriptCanvasFunctionAssetHolder::ScriptCanvasFunctionAssetHolder(AZ::Data::AssetId assetId, const ScriptChangedCB& scriptChangedCB) - : m_scriptCanvasAssetId(assetId) - , m_scriptNotifyCallback(scriptChangedCB) - { - } - - ScriptCanvasFunctionAssetHolder::~ScriptCanvasFunctionAssetHolder() - { - AZ::Data::AssetBus::Handler::BusDisconnect(); - } - - void ScriptCanvasFunctionAssetHolder::Init(AZ::EntityId ownerId) - { - m_ownerId = ownerId; - - if (m_scriptCanvasAssetId.IsValid()) - { - AZ::Data::AssetBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::Handler::BusConnect(m_scriptCanvasAssetId); - } - } - - void ScriptCanvasFunctionAssetHolder::LaunchScriptCanvasEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) const - { - OpenEditor(); - } - - void ScriptCanvasFunctionAssetHolder::OpenEditor() const - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - - if (m_scriptCanvasAssetId.IsValid()) - { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAssetId, -1); - - if (!openOutcome) - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - } - else if (m_ownerId.IsValid()) - { - AzToolsFramework::EntityIdList selectedEntityIds; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - // Going to bypass the multiple selected entities flow for right now. - if (selectedEntityIds.size() == 1) - { - GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); - } - } - } - - AZ::EntityId ScriptCanvasFunctionAssetHolder::GetGraphId() const - { - AZ::EntityId graphId; - if (m_scriptCanvasAsset.IsReady()) - { - ScriptCanvas::SystemRequestBus::BroadcastResult(graphId, &ScriptCanvas::SystemRequests::FindGraphId, m_scriptCanvasAsset.Get()->GetScriptCanvasEntity()); - } - return graphId; - } - - void ScriptCanvasFunctionAssetHolder::SetScriptChangedCB(const ScriptChangedCB& scriptChangedCB) - { - m_scriptNotifyCallback = scriptChangedCB; - } - - void ScriptCanvasFunctionAssetHolder::Load(bool loadBlocking) - { - if (!m_scriptCanvasAsset.IsReady()) - { - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, m_scriptCanvasAsset.GetId()); - if (assetInfo.m_assetId.IsValid()) - { - const AZ::Data::AssetType assetTypeId = azrtti_typeid(); - auto& assetManager = AZ::Data::AssetManager::Instance(); - m_scriptCanvasAsset = assetManager.GetAsset(m_scriptCanvasAsset.GetId(), azrtti_typeid(), true, nullptr, loadBlocking); - } - } - } - - AZ::u32 ScriptCanvasFunctionAssetHolder::OnScriptChanged() - { - SetAsset(m_scriptCanvasAsset.GetId()); - Load(false); - - if (m_scriptNotifyCallback) - { - m_scriptNotifyCallback(m_scriptCanvasAsset); - } - return AZ::Edit::PropertyRefreshLevels::EntireTree; - } - - void ScriptCanvasFunctionAssetHolder::OnAssetReady(AZ::Data::Asset asset) - { - SetAsset(asset.GetId()); - EditorScriptCanvasAssetNotificationBus::Event(m_scriptCanvasAsset.GetId(), &EditorScriptCanvasAssetNotifications::OnScriptCanvasAssetReady, m_scriptCanvasAsset); - } - - void ScriptCanvasFunctionAssetHolder::OnAssetReloaded(AZ::Data::Asset asset) - { - SetAsset(asset.GetId()); - EditorScriptCanvasAssetNotificationBus::Event(m_scriptCanvasAsset.GetId(), &EditorScriptCanvasAssetNotifications::OnScriptCanvasAssetReloaded, m_scriptCanvasAsset); - } - - void ScriptCanvasFunctionAssetHolder::OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType) - { - EditorScriptCanvasAssetNotificationBus::Event(assetId, &EditorScriptCanvasAssetNotifications::OnScriptCanvasAssetUnloaded, assetId); - } - - void ScriptCanvasFunctionAssetHolder::OnAssetSaved(AZ::Data::Asset asset, bool isSuccessful) - { - SetAsset(asset.GetId()); - auto currentBusId = AZ::Data::AssetBus::GetCurrentBusId(); - if (currentBusId) - { - EditorScriptCanvasAssetNotificationBus::Event(*currentBusId, &EditorScriptCanvasAssetNotifications::OnScriptCanvasAssetSaved, asset.GetId()); - } - } - - void ScriptCanvasFunctionAssetHolder::SetAsset(AZ::Data::AssetId assetId) - { - m_scriptCanvasAssetId = assetId; - - if (!AZ::Data::AssetBus::Handler::BusIsConnectedId(m_scriptCanvasAssetId)) - { - AZ::Data::AssetBus::Handler::BusDisconnect(); - if (m_scriptCanvasAssetId.IsValid()) - { - AZ::Data::AssetBus::Handler::BusConnect(m_scriptCanvasAssetId); - } - } - } - - //AZ::Data::Asset ScriptCanvasFunctionAssetHolder::GetAsset() const - //{ - // return m_scriptCanvasAsset; - //} - - AZ::Data::AssetId ScriptCanvasFunctionAssetHolder::GetAssetId() const - { - return m_scriptCanvasAssetId; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.h b/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.h deleted file mode 100644 index 1cde981e0d..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/Functions/ScriptCanvasFunctionAssetHolder.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 - -namespace ScriptCanvas -{ - class ScriptCanvasFunctionAsset; -} - -namespace ScriptCanvasEditor -{ - class ScriptCanvasFunctionAsset; - - /*! ScriptCanvasAssetHolder - Wraps a ScriptCanvasAsset reference and registers for the individual AssetBus events - for saving, loading and unloading the asset. - The ScriptCanvasAsset Holder contains functionality for activating the ScriptCanvasEntity stored on the reference asset - as well as attempting to open the ScriptCanvasAsset within the ScriptCanvas Editor. - It also provides the EditContext reflection for opening the asset in the ScriptCanvas Editor via a button - */ - class ScriptCanvasFunctionAssetHolder - : private AZ::Data::AssetBus::Handler - { - public: - AZ_RTTI(ScriptCanvasFunctionAssetHolder, "{21693AFA-5664-4AAE-9213-8B944A398BA1}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasFunctionAssetHolder, AZ::SystemAllocator, 0); - - using ScriptChangedCB = AZStd::function&)>; - - ScriptCanvasFunctionAssetHolder() = default; - ScriptCanvasFunctionAssetHolder(AZ::Data::AssetId assetId, const ScriptChangedCB& = {}); - ~ScriptCanvasFunctionAssetHolder() override; - - static void Reflect(AZ::ReflectContext* context); - void Init(AZ::EntityId ownerId = AZ::EntityId()); - - void SetAsset(AZ::Data::AssetId assetId); - AZ::Data::AssetId GetAssetId() const; - - AZ::EntityId GetGraphId() const; - - void LaunchScriptCanvasEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) const; - void OpenEditor() const; - - void SetScriptChangedCB(const ScriptChangedCB&); - void Load(bool loadBlocking = false); - - protected: - - //===================================================================== - // AZ::Data::AssetBus - void OnAssetReady(AZ::Data::Asset asset) override; - void OnAssetReloaded(AZ::Data::Asset asset) override; - void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType assetType) override; - void OnAssetSaved(AZ::Data::Asset asset, bool isSuccessful) override; - //===================================================================== - - //! Reloads the Script From the AssetData if it has changed - AZ::u32 OnScriptChanged(); - AZ::Data::AssetId m_scriptCanvasAssetId; - AZ::Data::Asset m_scriptCanvasAsset; - - AZ::EntityId m_ownerId; // Id of Entity which stores this AssetHolder object - ScriptChangedCB m_scriptNotifyCallback; - }; - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp index 247a38f58a..caec55e9fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp @@ -8,7 +8,6 @@ #include #include -#include #include namespace ScriptCanvasEditor diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 3304ad7987..c973034fa1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -80,11 +80,6 @@ namespace ScriptCanvasEditor AZ::Data::Asset newAsset = Clone(); memoryAsset.m_inMemoryAsset = newAsset; } - else if (m_assetType == azrtti_typeid()) - { - AZ::Data::Asset newAsset = Clone(); - memoryAsset.m_inMemoryAsset = newAsset; - } else { AZ_Assert(false, "Unsupported Script Canvas Asset Type"); @@ -107,10 +102,6 @@ namespace ScriptCanvasEditor { asset = assetHandler->CreateAsset(assetId, azrtti_typeid()); } - else if (assetType == azrtti_typeid()) - { - asset = assetHandler->CreateAsset(assetId, azrtti_typeid()); - } m_inMemoryAsset = AZ::Data::Asset(asset, AZ::Data::AssetLoadBehavior::PreLoad); @@ -155,8 +146,6 @@ namespace ScriptCanvasEditor streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; streamInfo.m_streamName = m_saveAsPath; - ScriptCanvasEditor::ScriptCanvasDataRequestBus::Event(GetScriptCanvasId(), &ScriptCanvasEditor::ScriptCanvasDataRequests::SetPrettyName, GetTabName().c_str()); - if (!streamInfo.IsValid()) { return; @@ -223,10 +212,6 @@ namespace ScriptCanvasEditor { m_inMemoryAsset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); } - else if (assetInfo.m_assetType == azrtti_typeid()) - { - m_inMemoryAsset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } if (m_inMemoryAsset) { @@ -290,15 +275,8 @@ namespace ScriptCanvasEditor return; } - if (m_assetType == azrtti_typeid()) - { - editorGraph->MarkFunctionGraph(); - } - m_scriptCanvasId = editorGraph->GetScriptCanvasId(); - ScriptCanvasEditor::ScriptCanvasDataRequestBus::Event(m_scriptCanvasId, &ScriptCanvasEditor::ScriptCanvasDataRequests::SetPrettyName, GetTabName().c_str()); - EditorGraphNotificationBus::Handler::BusDisconnect(); EditorGraphNotificationBus::Handler::BusConnect(m_scriptCanvasId); @@ -538,10 +516,6 @@ namespace ScriptCanvasEditor { return CloneAssetData(newAssetId); } - else if (m_assetType == azrtti_typeid()) - { - return CloneAssetData(newAssetId); - } AZ_Assert(false, "The provides asset type is not supported as a valid Script Canvas memory asset"); return AZ::Data::Asset(); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index 8f44a7f4b8..4449bcb62a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp index 3bc1f1b033..9363d5a337 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp @@ -61,11 +61,6 @@ namespace ScriptCanvasEditor { } - void ScriptCanvasAssetNode::OnInputSignal(const ScriptCanvas::SlotId&) - { - - } - void ScriptCanvasAssetNode::OnInit() { if (GetAsset().GetId().IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h index 8d3a5bf3d8..5b3e07cfbd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h @@ -74,7 +74,6 @@ namespace ScriptCanvasEditor //// protected: - void OnInputSignal(const ScriptCanvas::SlotId&) override; // AssetBus::Handler void OnAssetReloaded(AZ::Data::Asset asset) override; void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 3d6c9012cc..dfeb439c3d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -223,7 +223,7 @@ namespace ScriptCanvasEditor void ScriptCanvasRootPaletteTreeItem::SetActiveScriptCanvasId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { - ScriptCanvas::RuntimeRequestBus::EventResult(m_previousAssetId, scriptCanvasId, &ScriptCanvas::RuntimeRequests::GetAssetId); + ScriptCanvas::RuntimeRequestBus::EventResult(m_previousAssetId, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetId); for (auto functionTreePair : m_globalFunctionTreeItems) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp index b6062423ee..aad178b91d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -722,7 +721,7 @@ namespace ScriptCanvasEditor ScriptCanvas::GraphVariableManagerNotificationBus::Handler::BusDisconnect(); m_assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::RuntimeRequestBus::EventResult(m_assetType, scriptCanvasId, &ScriptCanvas::RuntimeRequests::GetAssetType); + ScriptCanvas::GraphRequestBus::EventResult(m_assetType, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); m_scriptCanvasId = scriptCanvasId; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp index 2d23b942df..f98c896f69 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp @@ -50,7 +50,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp index d88c16ba24..9307084e2a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp @@ -50,7 +50,6 @@ #include #include -#include #include #include @@ -757,7 +756,7 @@ namespace ScriptCanvasEditor AZStd::vector selection; - ScriptCanvas::RuntimeRequests* runtimeRequests = ScriptCanvas::RuntimeRequestBus::FindFirstHandler(m_scriptCanvasId); + auto owningGraph = ScriptCanvas::GraphRequestBus::FindFirstHandler(m_scriptCanvasId); if (runtimeRequests == nullptr) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/ScriptCanvasFunctionAsset.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/ScriptCanvasFunctionAsset.h deleted file mode 100644 index 58c99e719e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/ScriptCanvasFunctionAsset.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 -{ - class Entity; -} - -namespace ScriptCanvasEditor -{ - class ScriptCanvasFunctionAsset; - class Graph; - - class ScriptCanvasFunctionDescription : public ScriptCanvas::AssetDescription - { - public: - - AZ_TYPE_INFO(ScriptCanvasFunctionDescription, "{B53569F6-8408-40FC-9A72-ED873BEF162E}"); - - ScriptCanvasFunctionDescription() - : AssetDescription( - azrtti_typeid(), - "Script Canvas Function", - "Script Canvas Function Graph Asset", - "@devassets@/scriptcanvas/functions", - ".scriptcanvas_fn", - "Script Canvas Function", - "Untitled-Function-%i", - "Script Canvas Function Files (*.scriptcanvas_fn)", - "Script Canvas Function", - "Script Canvas Function", - "Icons/ScriptCanvas/Viewport/ScriptCanvas_Function.png", - AZ::Color(0.192f, 0.149f, 0.392f, 1.0f), - true - ) - {} - }; - - // TODO-LS: move these to their own file - class ScriptCanvasDataRequests : public AZ::ComponentBus - { - public: - - virtual void SetPrettyName(const char* name) = 0; - virtual AZStd::string GetPrettyName() = 0; - }; - - using ScriptCanvasDataRequestBus = AZ::EBus; - - - class ScriptCanvasFunctionDataComponent - : public AZ::Component - , ScriptCanvasDataRequestBus::MultiHandler - { - public: - AZ_COMPONENT(ScriptCanvasFunctionDataComponent, "{440BB6DC-4E70-4304-A926-252925F77433}"); - - void Activate() override - { - AZ::EntityId entityId = GetEntityId(); - ScriptCanvasDataRequestBus::MultiHandler::BusConnect(entityId); - } - - void Deactivate() override - { - ScriptCanvasDataRequestBus::MultiHandler::BusDisconnect(); - - AZ::EntityId entityId = GetEntityId(); - } - - void SetPrettyName(const char* name) override - { - m_assetPrettyName = name; - } - - AZStd::string GetPrettyName() override - { - return m_assetPrettyName; - } - - static void Reflect(AZ::ReflectContext* reflectContext) - { - if (auto serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(2) - ->Field("m_assetPrettyName", &ScriptCanvasFunctionDataComponent::m_assetPrettyName) - ->Field("m_version", &ScriptCanvasFunctionDataComponent::m_functionDataComponentVersion) - ; - } - } - - size_t m_functionDataComponentVersion = 0; - AZStd::string m_assetPrettyName; - }; - - class ScriptCanvasFunctionAsset - : public ScriptCanvas::ScriptCanvasAssetBase - { - public: - AZ_RTTI(ScriptCanvasFunctionAsset, "{ED078D3C-938D-41F8-A5F6-CC04311ECF4F}", ScriptCanvasAssetBase); - AZ_CLASS_ALLOCATOR(ScriptCanvasFunctionAsset, AZ::SystemAllocator, 0); - - ScriptCanvasFunctionAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : ScriptCanvasAssetBase(assetId, status) - { - m_data = aznew ScriptCanvas::ScriptCanvasData(); - } - - ~ScriptCanvasFunctionAsset() override - {} - - ScriptCanvas::AssetDescription GetAssetDescription() const override - { - return ScriptCanvasFunctionDescription(); - } - - using Description = ScriptCanvasFunctionDescription; - - ScriptCanvasFunctionDataComponent* m_cachedComponent = nullptr; - - ScriptCanvasFunctionDataComponent* GetFunctionData() - { - if (m_cachedComponent == nullptr) - { - m_cachedComponent = GetScriptCanvasEntity()->FindComponent(); - } - - return m_cachedComponent; - } - }; - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 443e6864a9..4545063f56 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -122,8 +122,6 @@ namespace ScriptCanvas { const auto& scriptCanvasId = GetScriptCanvasId(); GraphRequestBus::Handler::BusConnect(scriptCanvasId); - RuntimeRequestBus::Handler::BusConnect(scriptCanvasId); - ValidationRequestBus::Handler::BusConnect(scriptCanvasId); for (auto& nodeEntity : m_graphData.m_nodes) @@ -142,6 +140,7 @@ namespace ScriptCanvas } m_graphData.BuildEndpointMap(); + for (auto& connectionEntity : m_graphData.m_connections) { if (connectionEntity) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index e54704e95e..92de8f3c3e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -35,7 +34,6 @@ namespace ScriptCanvas class Graph : public AZ::Component , protected GraphRequestBus::Handler - , protected RuntimeRequestBus::Handler , protected StatusRequestBus::Handler , private AZ::EntityBus::Handler , private ValidationRequestBus::Handler @@ -174,14 +172,12 @@ namespace ScriptCanvas void RefreshConnectionValidity(bool warnOnRemoval = false); - //// RuntimeRequestBus::Handler AZ::Data::AssetId GetAssetId() const override { return AZ::Data::AssetId(); } GraphIdentifier GetGraphIdentifier() const override { return GraphIdentifier(GetAssetId(), 0); } AZStd::string GetAssetName() const override { return ""; } AZ::EntityId GetRuntimeEntityId() const override { return GetEntity() ? GetEntityId() : AZ::EntityId(); } VariableId FindAssetVariableIdByRuntimeVariableId(VariableId runtimeId) const override { return runtimeId; } - VariableId FindRuntimeVariableIdByAssetVariableId(VariableId assetId) const override { return assetId; } AZ::EntityId FindAssetNodeIdByRuntimeNodeId(AZ::EntityId editorNode) const override { return editorNode; } AZ::EntityId FindRuntimeNodeIdByAssetNodeId(AZ::EntityId runtimeNode) const override { return runtimeNode; } @@ -190,8 +186,8 @@ namespace ScriptCanvas const GraphVariableMapping* GetVariables() const override; GraphVariable* FindVariable(AZStd::string_view propName) override; GraphVariable* FindVariableById(const VariableId& variableId) override; - Data::Type GetVariableType(const VariableId& variableId) const override; - AZStd::string_view GetVariableName(const VariableId& variableId) const override; + Data::Type GetVariableType(const VariableId& variableId) const; + AZStd::string_view GetVariableName(const VariableId& variableId) const; bool IsGraphObserved() const override; void SetIsGraphObserved(bool isObserved) override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h index c85c76e54e..b01e23419c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h @@ -11,6 +11,7 @@ #include "Endpoint.h" #include +#include #include #include @@ -23,6 +24,8 @@ namespace ScriptCanvas class Graph; class Slot; + using EndpointMapConstIterator = AZStd::unordered_multimap::const_iterator; + //! These are public graph requests class GraphRequests : public AZ::EBusTraits { @@ -104,8 +107,49 @@ namespace ScriptCanvas virtual void SetIsGraphObserved(bool observed) = 0; virtual bool IsGraphObserved() const = 0; - }; + virtual VariableId FindAssetVariableIdByRuntimeVariableId(VariableId runtimeId) const = 0; + + virtual AZ::EntityId FindAssetNodeIdByRuntimeNodeId(AZ::EntityId editorNode) const = 0; + + virtual AZ::Data::AssetId GetAssetId() const = 0; + + virtual GraphIdentifier GetGraphIdentifier() const = 0; + + virtual AZStd::string GetAssetName() const = 0; + + //! Looks up the nodeId within the bus handler + virtual Node* FindNode(AZ::EntityId nodeId) const = 0; + + virtual AZ::EntityId FindRuntimeNodeIdByAssetNodeId(AZ::EntityId runtimeNode) const = 0; + + //! Returns the entity id of the execution component + virtual AZ::EntityId GetRuntimeEntityId() const = 0; + + virtual AZStd::pair< EndpointMapConstIterator, EndpointMapConstIterator > GetConnectedEndpointIterators(const Endpoint& endpoint) const = 0; + + //! Returns whether the given endpoint has any connections + virtual bool IsEndpointConnected(const Endpoint& endpoint) const = 0; + + //! Retrieves VariableData structure which manages variable data for the execution component + virtual VariableData* GetVariableData() = 0; + virtual const VariableData* GetVariableDataConst() const = 0; + + //! Retrieves a map of variable id to variable name and variable datums pair + virtual const GraphVariableMapping* GetVariables() const = 0; + + //! Searches for a variable with the specified name + //! returns pointer to the first variable with the specified name or nullptr + virtual GraphVariable* FindVariable(AZStd::string_view varName) = 0; + + //! Searches for a variable by VariableId + //! returns a pair of with the supplied id + //! The variable datum pointer is non-null if the variable has been found + virtual GraphVariable* FindVariableById(const VariableId& variableId) = 0; + + virtual AZ::Data::AssetType GetAssetType() const = 0; + + }; using GraphRequestBus = AZ::EBus; class GraphNotifications : public AZ::EBusTraits diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index 8d61eef3a0..8250eb1763 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -487,23 +487,16 @@ namespace ScriptCanvas void Node::Activate() { - SignalBus::Handler::BusConnect(GetEntityId()); - - SetRuntimeBus(RuntimeRequestBus::FindFirstHandler(m_scriptCanvasId)); - AZ_Assert(m_runtimeBus, "Invalid m_executionUniqueId given for RuntimeRequestBus"); - + m_graphRequestBus = GraphRequestBus::FindFirstHandler(m_scriptCanvasId); + AZ_Assert(m_graphRequestBus, "Invalid m_executionUniqueId given for RuntimeRequestBus"); OnActivate(); - MarkDefaultableInput(); } void Node::Deactivate() { OnDeactivate(); - - SignalBus::Handler::BusDisconnect(); - - SetRuntimeBus(RuntimeRequestBus::FindFirstHandler(m_scriptCanvasId)); + m_graphRequestBus = GraphRequestBus::FindFirstHandler(m_scriptCanvasId); } void Node::PostActivate() @@ -737,7 +730,7 @@ namespace ScriptCanvas bool Node::IsInEventHandlingScope(const ID& possibleEventHandler) const { - Node* node = m_runtimeBus->FindNode(possibleEventHandler); + Node* node = m_graphRequestBus->FindNode(possibleEventHandler); if (auto eventHandler = azrtti_cast(node)) { @@ -844,7 +837,7 @@ namespace ScriptCanvas GraphVariable* Node::FindGraphVariable(const VariableId& variableId) const { - return m_runtimeBus->FindVariableById(variableId); + return m_graphRequestBus->FindVariableById(variableId); } void Node::OnSlotConvertedToValue(const SlotId& slotId) @@ -1598,24 +1591,6 @@ namespace ScriptCanvas NodeNotificationsBus::Event(GetEntityId(), &NodeNotifications::OnSlotDisplayTypeChanged, slotId, dataType); } - void Node::SignalInput(const SlotId& slotId) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - SC_EXECUTION_TRACE_SIGNAL_INPUT((*this), (InputSignal(CreateNodeInputSignal(slotId)))); - - { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::%s::SignalInput", GetNodeName().c_str()); - OnInputSignal(slotId); - } - - } - - void Node::SignalOutput(const SlotId& slotId, ExecuteMode mode) - { - AZ_UNUSED(slotId); - AZ_UNUSED(mode); - } - AZ::Outcome Node::SlotAcceptsType(const SlotId& slotID, const Data::Type& type) const { if (auto slot = GetSlot(slotID)) @@ -1914,7 +1889,7 @@ namespace ScriptCanvas if (slot.GetDescriptor() == slotDescriptor && (allowLatentSlots || !slot.IsLatent())) { - AZStd::vector connectedEndpoints = m_runtimeBus->GetConnectedEndpoints(Endpoint{ GetEntityId(), slot.GetId() }); + AZStd::vector connectedEndpoints = m_graphRequestBus->GetConnectedEndpoints(Endpoint{ GetEntityId(), slot.GetId() }); endpoints.insert(endpoints.end(), connectedEndpoints.begin(), connectedEndpoints.end()); } } @@ -2339,9 +2314,7 @@ namespace ScriptCanvas void Node::SetOwningScriptCanvasId(ScriptCanvasId scriptCanvasId) { m_scriptCanvasId = scriptCanvasId; - - SetRuntimeBus(RuntimeRequestBus::FindFirstHandler(m_scriptCanvasId)); - + m_graphRequestBus = GraphRequestBus::FindFirstHandler(m_scriptCanvasId); OnGraphSet(); } @@ -2426,7 +2399,7 @@ namespace ScriptCanvas AZ::EntityId Node::GetGraphEntityId() const { - return m_runtimeBus->GetRuntimeEntityId(); + return m_graphRequestBus->GetRuntimeEntityId(); } NodePtrConstList Node::FindConnectedNodesByDescriptor(const SlotDescriptor& slotDescriptor, bool followLatentConnections) const @@ -2437,7 +2410,7 @@ namespace ScriptCanvas for (const auto& endpoint : GetAllEndpointsByDescriptor(slotDescriptor, followLatentConnections)) { - Node* connectedNode = m_runtimeBus->FindNode(endpoint.GetNodeId()); + Node* connectedNode = m_graphRequestBus->FindNode(endpoint.GetNodeId()); if (connectedNode) { @@ -2456,7 +2429,7 @@ namespace ScriptCanvas for (const auto& endpoint : GetAllEndpointsByDescriptor(slotDescriptor, followLatentConnections)) { - Node* connectedNode = m_runtimeBus->FindNode(endpoint.GetNodeId()); + Node* connectedNode = m_graphRequestBus->FindNode(endpoint.GetNodeId()); if (connectedNode) { @@ -2469,7 +2442,7 @@ namespace ScriptCanvas AZ::Data::AssetId Node::GetGraphAssetId() const { - return m_runtimeBus->GetAssetId(); + return m_graphRequestBus->GetAssetId(); } AZStd::string Node::GetGraphAssetName() const @@ -2482,7 +2455,7 @@ namespace ScriptCanvas GraphIdentifier Node::GetGraphIdentifier() const { - return m_runtimeBus->GetGraphIdentifier(); + return m_graphRequestBus->GetGraphIdentifier(); } bool Node::IsSanityCheckRequired() const @@ -2652,7 +2625,7 @@ namespace ScriptCanvas return; } - auto node = m_runtimeBus->FindNode(endpoint.GetNodeId()); + auto node = m_graphRequestBus->FindNode(endpoint.GetNodeId()); if (node) { @@ -2840,7 +2813,7 @@ namespace ScriptCanvas bool Node::IsConnected(const Slot& slot) const { AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::IsConnected"); - return slot.IsVariableReference() || m_runtimeBus->IsEndpointConnected(slot.GetEndpoint()); + return slot.IsVariableReference() || m_graphRequestBus->IsEndpointConnected(slot.GetEndpoint()); } bool Node::IsConnected(const SlotId& slotId) const @@ -2880,7 +2853,7 @@ namespace ScriptCanvas bool Node::IsActivated() const { - return m_runtimeBus; + return m_graphRequestBus; } EndpointsResolved Node::GetConnectedNodes(const Slot& slot) const @@ -2889,17 +2862,17 @@ namespace ScriptCanvas EndpointsResolved connectedNodes; - auto endpointIters = m_runtimeBus->GetConnectedEndpointIterators(Endpoint{ GetEntityId(), slot.GetId() }); + auto endpointIters = m_graphRequestBus->GetConnectedEndpointIterators(Endpoint{ GetEntityId(), slot.GetId() }); for (auto endpointIter = endpointIters.first; endpointIter != endpointIters.second; ++endpointIter) { const Endpoint& endpoint = endpointIter->second; - auto node = m_runtimeBus->FindNode(endpoint.GetNodeId()); + auto node = m_graphRequestBus->FindNode(endpoint.GetNodeId()); if (node == nullptr) { - AZStd::string assetName = m_runtimeBus->GetAssetName(); - AZ::EntityId assetNodeId = m_runtimeBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); + AZStd::string assetName = m_graphRequestBus->GetAssetName(); + AZ::EntityId assetNodeId = m_graphRequestBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); AZ_Warning("Script Canvas", false, "Unable to find node with id (id: %s) in the graph '%s'. Most likely the node was serialized with a type that is no longer reflected", assetNodeId.ToString().data(), assetName.data()); @@ -2913,8 +2886,8 @@ namespace ScriptCanvas auto endpointSlot = node->GetSlot(endpoint.GetSlotId()); if (!endpointSlot) { - AZStd::string assetName = m_runtimeBus->GetAssetName(); - AZ::EntityId assetNodeId = m_runtimeBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); + AZStd::string assetName = m_graphRequestBus->GetAssetName(); + AZ::EntityId assetNodeId = m_graphRequestBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); AZ_Warning("Script Canvas", false, "Endpoint was missing slot. id (id: %s) in the graph '%s'.", assetNodeId.ToString().data(), assetName.data()); @@ -2937,18 +2910,18 @@ namespace ScriptCanvas void Node::ModConnectedNodes(const Slot& slot, AZStd::vector>& connectedNodes) const { - auto endpointIters = m_runtimeBus->GetConnectedEndpointIterators(Endpoint{ GetEntityId(), slot.GetId() }); + auto endpointIters = m_graphRequestBus->GetConnectedEndpointIterators(Endpoint{ GetEntityId(), slot.GetId() }); for (auto endpointIter = endpointIters.first; endpointIter != endpointIters.second; ++endpointIter) { const Endpoint& endpoint = endpointIter->second; - auto node = m_runtimeBus->FindNode(endpoint.GetNodeId()); + auto node = m_graphRequestBus->FindNode(endpoint.GetNodeId()); if (node == nullptr) { - AZStd::string assetName = m_runtimeBus->GetAssetName(); - AZ::EntityId assetNodeId = m_runtimeBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); + AZStd::string assetName = m_graphRequestBus->GetAssetName(); + AZ::EntityId assetNodeId = m_graphRequestBus->FindAssetNodeIdByRuntimeNodeId(endpoint.GetNodeId()); AZ_Error("Script Canvas", false, "Unable to find node with id (id: %s) in the graph '%s'. Most likely the node was serialized with a type that is no longer reflected", assetNodeId.ToString().data(), assetName.data()); @@ -2961,41 +2934,7 @@ namespace ScriptCanvas bool Node::HasConnectedNodes(const Slot& slot) const { - return m_runtimeBus->IsEndpointConnected(Endpoint{ GetEntityId(), slot.GetId() }); - } - - void Node::OnInputChanged(Node& node, const Datum& input, const SlotId& slotID) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - node.OnInputChanged(input, slotID); - } - - void Node::PushOutput(const Datum& output, const Slot& slot) const - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - - if (slot.IsVariableReference()) - { - GraphVariable* variable = slot.GetVariable(); - - if (variable) - { - ModifiableDatumView datumView; - variable->ConfigureDatumView(datumView); - - datumView.AssignToDatum(output); - } - } - else - { - auto endpointIters = m_runtimeBus->GetConnectedEndpointIterators(Endpoint{ GetEntityId(), slot.GetId() }); - - for (auto endpointIter = endpointIters.first; endpointIter != endpointIters.second; ++endpointIter) - { - Node* node = m_runtimeBus->FindNode(endpointIter->second.GetNodeId()); - node->SetInput(output, endpointIter->second.GetSlotId()); - } - } + return m_graphRequestBus->IsEndpointConnected(Endpoint{ GetEntityId(), slot.GetId() }); } void Node::ForEachConnectedNode(const Slot& slot, AZStd::function callable) const @@ -3018,9 +2957,8 @@ namespace ScriptCanvas FindModifiableDatumView(slotId, datumView); if (datumView.IsValid()) - { + { datumView.AssignToDatum(newInput); - OnInputChanged((*datumView.GetDatum()), slotId); } } @@ -3034,7 +2972,6 @@ namespace ScriptCanvas if (datumView.IsValid()) { datumView.AssignToDatum(newInput); - OnInputChanged((*datumView.GetDatum()), slotId); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h index 74707916f3..55379e29b9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h @@ -22,12 +22,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -400,7 +398,6 @@ namespace ScriptCanvas class Node : public AZ::Component , public DatumNotificationBus::Handler - , private SignalBus::Handler , public NodeRequestBus::Handler , public EndpointNotificationBus::MultiHandler { @@ -542,7 +539,6 @@ namespace ScriptCanvas AZStd::vector> FindConnectedNodesAndSlotsByDescriptor(const SlotDescriptor& slotType, bool followLatentConnections = false) const; AZStd::vector GetSlotsByType(CombinedSlotType slotType) const; - AZStd::vector GetConnectedEndpoints(SlotId outSlot) const; bool IsConnected(const Slot& slot) const; bool IsConnected(const SlotId& slotId) const; @@ -845,7 +841,6 @@ namespace ScriptCanvas void SignalSlotsReordered(); - static void OnInputChanged(Node& node, const Datum& input, const SlotId& slotID); static void SetInput(Node& node, const SlotId& id, const Datum& input); static void SetInput(Node& node, const SlotId& id, Datum&& input); @@ -892,7 +887,6 @@ protected: void Configure(); protected: - TransientSlotIdentifier ConstructTransientIdentifier(const Slot& slot) const; DatumVector GatherDatumsForDescriptor(SlotDescriptor descriptor) const; @@ -900,7 +894,6 @@ protected: SlotDataMap CreateInputMap() const; SlotDataMap CreateOutputMap() const; - Signal CreateNodeInputSignal(const SlotId& slotId) const; Signal CreateNodeOutputSignal(const SlotId& slotId) const; @@ -954,6 +947,7 @@ protected: //! This is a used by CodeGen to configure slots just prior to OnInit. virtual void ConfigureSlots() {} + //! Entity level initialization, perform any resource allocation here that should be available throughout the node's existence. virtual void OnInit() {} @@ -968,13 +962,11 @@ protected: //! Entity level activation, perform entity lifetime setup here, i.e. connect to EBuses virtual void OnActivate() {} + //! Entity level deactivation, perform any entity lifetime release here, i.e disconnect from EBuses virtual void OnDeactivate() {} virtual void OnPostActivate() {} - //! Any node that is not pure data will perform its operation assuming that all input has been pushed and is reasonably valid - // perform your derived nodes work in OnInputSignal(const SlotId&) - virtual void OnInputSignal(const SlotId& /*slot*/) {} //! Signal sent once the OwningScriptCanvasId is set. virtual void OnGraphSet() {} @@ -1000,25 +992,12 @@ protected: void ModConnectedNodes(const Slot& slot, AZStd::vector>&) const; bool HasConnectedNodes(const Slot& slot) const; - virtual void OnInputChanged(const Datum& /*input*/, const SlotId& /*slotID*/) {} - - ////////////////////////////////////////////////////////////////////////// - //! The body of the node's execution, implement the node's work here. - void PushOutput(const Datum& output, const Slot& slot) const; void SetOwningScriptCanvasId(ScriptCanvasId scriptCanvasId); void SetGraphEntityId(AZ::EntityId graphEntityId); - // on activate, simple expressions need to push this data virtual void SetInput(const Datum& input, const SlotId& id); virtual void SetInput(Datum&& input, const SlotId& id); - //! Any node that is not pure data will perform its operation assuming that all input has been pushed and is reasonably valid - // perform your derived nodes work in OnInputSignal(const SlotId&) - void SignalInput(const SlotId& slot) override final; - - //! This must be called manually to send execution out of a specific slot - void SignalOutput(const SlotId& slot, ExecuteMode mode = ExecuteMode::Normal) override final; - bool SlotExists(AZStd::string_view name, const SlotDescriptor& slotDescriptor) const; bool IsTargetInDataFlowPath(const ID& targetNodeId, AZStd::unordered_set& path) const; @@ -1027,10 +1006,6 @@ protected: void PopulateNodeType(); - void SetRuntimeBus(RuntimeRequests* runtimeBus) { m_runtimeBus = runtimeBus; } - RuntimeRequests* GetRuntimeBus() const { return m_runtimeBus; } - - GraphScopedNodeId GetScopedNodeId() const { return GraphScopedNodeId(GetOwningScriptCanvasId(), GetEntityId()); } private: @@ -1070,102 +1045,17 @@ protected: AZStd::vector< VisualExtensionSlotConfiguration > m_visualExtensions; // Cache pointer to the owning Graph - RuntimeRequests* m_runtimeBus = nullptr; + GraphRequests* m_graphRequestBus = nullptr; ScriptCanvas::SlotId m_removingSlot; public: - template - const t_Value* GetInput_UNIT_TEST(AZStd::string_view slotName) - { - return GetInput_UNIT_TEST(GetSlotId(slotName)); - } - - template - t_Value* ModInput_UNIT_TEST(AZStd::string_view slotName) - { - return ModInput_UNIT_TEST(GetSlotId(slotName)); - } - - template - const t_Value* GetInput_UNIT_TEST(const SlotId& slotId) - { - const Datum* input = FindDatum(slotId); - return input ? input->GetAs() : nullptr; - } - - template - t_Value* ModInput_UNIT_TEST(const SlotId& slotId) - { - auto slotIter = m_slotIdIteratorCache.find(slotId); - - if (slotIter != m_slotIdIteratorCache.end()) - { - Slot* slot = &(*slotIter->second.m_slotIterator); - - if (slot->IsVariableReference()) - { - AZ_Assert(false, "Variable references are not supported in Unit Test methods."); - } - else - { - return slotIter->second.GetDatumIter()->ModAs(); - } - } - - return nullptr; - } - - const Datum* GetInput_UNIT_TEST(AZStd::string_view slotName) - { - return GetInput_UNIT_TEST(GetSlotId(slotName)); - } - - const Datum* GetInput_UNIT_TEST(const SlotId& slotId) - { - return FindDatum(slotId); - } - - // initializes the node input to the value passed in, not a pointer to it - template - void SetInput_UNIT_TEST(AZStd::string_view slotName, const t_Value& value) - { - SetInput_UNIT_TEST(GetSlotId(slotName), value); - } - - template - void SetInput_UNIT_TEST(const SlotId& slotId, const t_Value& value) - { - SetInput(Datum(value), slotId); - } - - void SetInput_UNIT_TEST(AZStd::string_view slotName, const Datum& value) - { - SetInput_UNIT_TEST(GetSlotId(slotName), value); - } - - void SetInput_UNIT_TEST(AZStd::string_view slotName, Datum&& value) - { - SetInput_UNIT_TEST(GetSlotId(slotName), AZStd::move(value)); - } - - void SetInput_UNIT_TEST(const SlotId& slotId, Datum&& value) - { - SetInput(AZStd::move(value), slotId); - } - template friend struct Internal::MultipleOutputHelper; template friend struct Internal::OutputSlotHelper; - template - friend struct Internal::PushOutputHelper; - - template - friend struct Internal::CallHelper; - template friend struct SetDefaultValuesByIndex; }; @@ -1238,104 +1128,6 @@ protected: } }; - template> - struct PushOutputHelper - { - template - static void PushOutput(Node& node, ResultType&& result, AZStd::index_sequence) - { - // protect against changes to the function that generated the node - if (auto slot = node.GetSlotByIndex(t_Traits::s_resultsSlotIndicesStart)) - { - node.PushOutput(Datum(AZStd::forward(result)), *slot); - } - } - }; - - template - struct PushOutputHelper - { - template static void PushOutput(Node& node, AZStd::ignore_t result, AZStd::index_sequence) {} - }; - - template - struct PushOutputHelper::value>> - { - template - static void PushOutputFold(Node& node, ResultType&& tupleResult) - { - // protect against changes to the function that generated the node - if (auto slot = node.GetSlotByIndex(t_Traits::s_resultsSlotIndicesStart + t_Index)) - { - node.PushOutput(Datum(AZStd::get(AZStd::forward(tupleResult))), *slot); - } - } - - template - static void PushOutput(Node& node, ResultType&& tupleResult, AZStd::index_sequence) - { - (PushOutputFold(node, AZStd::forward(tupleResult)), ...); - } - }; - - template - struct CallHelper - { - // protect against changes to the function that generated the node - template - static bool IsIndexSafe(Node& node, const AZStd::index_sequence&) - { - return (true && ... && (node.FindDatumByIndex(Indices) != nullptr && node.FindDatumByIndex(Indices)->GetAs>() != nullptr)); - } - - template - static void Call(Node& node, AZStd::Internal::pack_traits_arg_sequence, [[maybe_unused]] AZStd::index_sequence sequence) - { -#if !defined(_RELEASE) - if (IsIndexSafe(node, sequence)) - { - PushOutputHelper::PushOutput(node, AZStd::invoke(function, *node.FindDatumByIndex(ArgIndices)->GetAs>()...), ResultIndexSequence()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((node), "Generic function Node (%s) could not be executed, due to missing slot for source definition." - "this is likely due to changing the function signature. See serialization log for potential errors & warnings.", node.GetNodeName().c_str()); - } -#else - PushOutputHelper::PushOutput(node, AZStd::invoke(function, *node.FindDatumByIndex(ArgIndices)->GetAs>()...), ResultIndexSequence()); -#endif//!defined(_RELEASE) - } - }; - - template - struct CallHelper - { - // protect against changes to the function that generated the node - template - static bool IsIndexSafe(Node& node, const AZStd::index_sequence&) - { - return true && (... && (node.FindDatumByIndex(Indices) != nullptr && node.FindDatumByIndex(Indices)->GetAs>() != nullptr)); - } - - template - static void Call(Node& node, AZStd::Internal::pack_traits_arg_sequence, [[maybe_unused]] AZStd::index_sequence sequence) - { -#if !defined(_RELEASE) - if (IsIndexSafe(node, sequence)) - { - AZStd::invoke(function, *node.FindDatumByIndex(ArgIndices)->GetAs>()...); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((node), "Generic function Node (%s) could not be executed, due to missing slot for source definition." - "this is likely due to changing the function signature. See serialization log for potential errors & warnings.", node.GetNodeName().c_str()); - } -#else - AZStd::invoke(function, *node.FindDatumByIndex(ArgIndices)->GetAs>()...); -#endif//!defined(_RELEASE) - } - }; - template struct MultipleOutputHelper { @@ -1346,11 +1138,6 @@ protected: { OutputSlotHelper::AddOutputSlot(node, ResultIndexSequence()); } - - static void Call(Node& node) - { - CallHelper::Call(node, typename AZStd::function_traits::arg_sequence{}, AZStd::make_index_sequence::arity>{}); - } }; template> diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h index 95fc23c5d5..e3e0c1a7a3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeFunctionGeneric.h @@ -248,8 +248,6 @@ namespace ScriptCanvas return AZ::Success(scope); } - - protected: template @@ -298,13 +296,6 @@ namespace ScriptCanvas MultipleOutputInvoker::Add(*this); } - void OnInputSignal(const SlotId&) override - { - MultipleOutputInvoker::Call(*this); - SignalOutput(GetSlotId("Out")); - } - - static bool VersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement); static bool ConvertOldNodeGeneric(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SignalBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SignalBus.h deleted file mode 100644 index 1a39c0f4d6..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SignalBus.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 - -#include "Core.h" - -#include - -namespace ScriptCanvas -{ - enum class ExecuteMode - { - Normal, - UntilNodeIsFoundInStack - }; - - class SignalInterface : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - typedef ID BusIdType; - ////////////////////////////////////////////////////////////////////////// - - virtual void SignalInput(const SlotId& slot) = 0; - virtual void SignalOutput(const SlotId& slot, ExecuteMode mode = ExecuteMode::Normal) = 0; - }; - - using SignalBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index 2517c0c7ed..204a087ab3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -384,15 +384,10 @@ namespace ScriptCanvas if (m_variable) { VariableNotificationBus::Handler::BusConnect(m_variable->GetGraphScopedId()); - - if (IsInput()) - { - m_node->OnInputChanged((*m_variable->GetDatum()), GetId()); - } } - else + else if (m_node) { - SCRIPTCANVAS_REPORT_ERROR((*m_node), "Node (%s) is attempting to execute using an invalid Variable Reference", m_node->GetNodeName().c_str()); + AZ_Warning("ScriptCanvas", false, "Node (%s) is attempting to initialize an invalid Variable Reference", m_node->GetNodeName().c_str()); } } } @@ -584,11 +579,6 @@ namespace ScriptCanvas return m_isLatentSlot; } - void Slot::OnVariableValueChanged() - { - m_node->OnInputChanged((*m_variable->GetDatum()), GetId()); - } - void Slot::SetDynamicDataType(DynamicDataType dynamicDataType) { AZ_Assert(m_dynamicDataType == DynamicDataType::None, "Set Dynamic Data Type is meant to be used for a node wise version conversion step. Not as a run time reconfiguration of a dynamic type."); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h index 1eeddb8898..0e5889e4ba 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h @@ -167,10 +167,6 @@ namespace ScriptCanvas bool IsLatent() const; - // VariableNotificationBus - void OnVariableValueChanged() override; - //// - // Here to allow conversion of the previously untyped any slots into the dynamic type any. void SetDynamicDataType(DynamicDataType dynamicDataType); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterface.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterface.h index 024f3e7483..19ff2e1d65 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterface.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterface.h @@ -266,16 +266,6 @@ namespace ScriptCanvas const In* FindIn(const AZStd::string& inSlotId) const; const Out* FindLatentOut(const AZStd::string& latent) const; LexicalScope GetLexicalScope(bool isSourcePure) const; - -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - public: - bool IsAllInputOutputShared() const; - - // all input/output are used in every in/out/latent slot? - bool m_isAllInputOutputShared = false; - - void MarkAllInputOutputShared(); -#endif }; AZStd::string ToString(const In& in, size_t tabs = 0); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeBus.h deleted file mode 100644 index eb3956c4e5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeBus.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 - * - */ - -#pragma once - -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace ScriptCanvas -{ - struct GraphData; - class GraphVariable; - class VariableData; - - using EndpointMapConstIterator = AZStd::unordered_multimap::const_iterator; - - //! Runtime Request Bus for interfacing with the runtime execution component - class RuntimeRequests : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - //! BusIdType represents a unique id for the execution component - //! Because multiple Script Canvas graphs can execute on the same entity - //! this is not an "EntityId" in the sense that it uniquely identifies an entity. - using BusIdType = ScriptCanvasId; - - virtual VariableId FindAssetVariableIdByRuntimeVariableId(VariableId runtimeId) const = 0; - - virtual VariableId FindRuntimeVariableIdByAssetVariableId(VariableId assetId) const = 0; - - virtual AZ::EntityId FindAssetNodeIdByRuntimeNodeId(AZ::EntityId editorNode) const = 0; - - virtual AZ::Data::AssetId GetAssetId() const = 0; - virtual GraphIdentifier GetGraphIdentifier() const = 0; - virtual AZStd::string GetAssetName() const = 0; - - //! Looks up the nodeId within the bus handler - virtual Node* FindNode(AZ::EntityId nodeId) const = 0; - - virtual AZ::EntityId FindRuntimeNodeIdByAssetNodeId(AZ::EntityId runtimeNode) const = 0; - - //! Returns the entity id of the execution component - virtual AZ::EntityId GetRuntimeEntityId() const = 0; - - //! Returns a container of nodes - virtual AZStd::vector GetNodes() const = 0; - //! Returns a container of connections - virtual AZStd::vector GetConnections() const = 0; - - //! Returns a container of all endpoints to which the supplied endpoint is connected point - virtual AZStd::vector GetConnectedEndpoints(const Endpoint& endpoint) const = 0; - - virtual AZStd::pair< EndpointMapConstIterator, EndpointMapConstIterator > GetConnectedEndpointIterators(const Endpoint& endpoint) const = 0; - - //! Returns whether the given endpoint has any connections - virtual bool IsEndpointConnected(const Endpoint& endpoint) const = 0; - - //! Retrieves GraphData structure which manages the nodes and connections of an executing graph - virtual GraphData* GetGraphData() = 0; - virtual const GraphData* GetGraphDataConst() const = 0; - - //! Retrieves VariableData structure which manages variable data for the execution component - virtual VariableData* GetVariableData() = 0; - virtual const VariableData* GetVariableDataConst() const = 0; - - //! Retrieves a map of variable id to variable name and variable datums pair - virtual const GraphVariableMapping* GetVariables() const = 0; - - //! Searches for a variable with the specified name - //! returns pointer to the first variable with the specified name or nullptr - virtual GraphVariable* FindVariable(AZStd::string_view varName) = 0; - - //! Searches for a variable by VariableId - //! returns a pair of with the supplied id - //! The variable datum pointer is non-null if the variable has been found - virtual GraphVariable* FindVariableById(const VariableId& variableId) = 0; - - //! Returns the type associated with the specified variable. - virtual Data::Type GetVariableType(const VariableId& variableId) const = 0; - - //! Looks up the variable name that the variable data is associated with in the handler of the bus - virtual AZStd::string_view GetVariableName(const VariableId& variableId) const = 0; - - virtual bool IsGraphObserved() const = 0; - virtual void SetIsGraphObserved(bool isObserved) = 0; - - virtual AZ::Data::AssetType GetAssetType() const = 0; - }; - - using RuntimeRequestBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 2ba248bb5e..348c89f45f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -2248,17 +2248,6 @@ namespace ScriptCanvas m_subgraphInterface.SetNamespacePath(m_source.m_namespacePath); -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - if (m_source.m_graph->IsFunctionGraph()) - { - m_variableScopeMeaning = VariableScopeMeaning_LegacyFunctions::FunctionPrototype; - m_subgraphInterface.MarkAllInputOutputShared(); - } - else - { - m_variableScopeMeaning = VariableScopeMeaning_LegacyFunctions::ValueInitialization; - } -#endif // The Order Matters: begin // add all data to the ACM for easy look up in input/output processing for ACM nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h index 92de21ff97..06854fdbfd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.h @@ -594,24 +594,6 @@ namespace ScriptCanvas void ParseExecutionIfStatementBooleanExpression(ExecutionTreePtr booleanExpressionExecution, AZStd::string executionName, LexicalScope lexicalScope); void ParseExecutionIfStatementInternalFunction(ExecutionTreePtr internalFunctionExecution); - -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - public: - AZStd::vector FindAllVariablesInVariableFlagScope(VariableFlags::Scope scope) const; - - // scrape variables for scope, every Scope::In and InOut - AZStd::vector FindSubGraphInputValues() const; - - // scrape variables for scope, every Scope::Out and InOut - AZStd::vector FindSubGraphOutputValues() const; - - AZStd::vector GetLocalVariablesUser() const; - - VariableScopeMeaning_LegacyFunctions GetVariableScopeMeaning() const; - - private: - VariableScopeMeaning_LegacyFunctions m_variableScopeMeaning = VariableScopeMeaning_LegacyFunctions::ValueInitialization; -#endif }; // class AbstractCodeModel template diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.cpp deleted file mode 100644 index 5d16bd7f9c..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "PrimitivesDeclarations.h" - -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "AbstractCodeModel.h" -#include "FunctionsLegacySupport.h" -#include "GrammarContextBus.h" -#include "ParsingUtilities.h" -#include "Primitives.h" - -namespace ScriptCanvas -{ - namespace Grammar - { - - void AbstractCodeModel::AddAllVariablesPreParse_LegacyFunctions() - { - // all variables assumed to be NOT persistent - in the live code they are reset when activated - // variables with no scope In/Out is assumed to be persistent, this is a mess with tick handlers - // warn on any variable attempted to be read before written - AZ_Assert(m_variableScopeMeaning == VariableScopeMeaning_LegacyFunctions::FunctionPrototype, "new graph type added without full support"); - auto& sourceVariables = m_source.m_variableData->GetVariables(); - - AZStd::set sortedVariables; - for (const auto& variablePair : sourceVariables) - { - sortedVariables.insert(&variablePair.second); - } - - for (auto& sourceVariable : sortedVariables) - { - auto datum = sourceVariable->GetDatum(); - AZ_Assert(datum != nullptr, "the datum must be valid"); - AddVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId()); - } - } - - AZStd::vector AbstractCodeModel::FindSubGraphInputValues() const - { - return FindAllVariablesInVariableFlagScope(VariableFlags::Scope::Input); - } - - AZStd::vector AbstractCodeModel::FindSubGraphOutputValues() const - { - return FindAllVariablesInVariableFlagScope(VariableFlags::Scope::Output); - } - - AZStd::vector AbstractCodeModel::FindAllVariablesInVariableFlagScope(VariableFlags::Scope scope) const - { - AZStd::vector variables; - auto& sourceVariables = m_source.m_variableData->GetVariables(); - - for (auto& variable : m_variables) - { - if (IsSourceInScope(variable, scope)) - { - variables.push_back(variable); - } - } - - // sort by variable id - AZStd::sort(variables.begin(), variables.end(), [](const auto& lhs, const auto& rhs) { return lhs->m_sourceVariableId < rhs->m_sourceVariableId; }); - return variables; - } - - AZStd::vector AbstractCodeModel::GetLocalVariablesUser() const - { - AZStd::vector userLocalVariables; - - if (m_variableScopeMeaning == VariableScopeMeaning_LegacyFunctions::FunctionPrototype) - { - for (auto variable : m_variables) - { - if (!variable->m_isMember - && variable->m_sourceVariableId.IsValid() - && !IsSourceInScope(variable, VariableFlags::Scope::Input) - && !IsSourceInScope(variable, VariableFlags::Scope::Output)) - { - userLocalVariables.push_back(variable); - } - } - } - - return userLocalVariables; - } - - VariableScopeMeaning_LegacyFunctions AbstractCodeModel::GetVariableScopeMeaning() const - { - return m_variableScopeMeaning; - } - - bool SubgraphInterface::IsAllInputOutputShared() const - { - return m_isAllInputOutputShared; - } - - void SubgraphInterface::MarkAllInputOutputShared() - { - m_isAllInputOutputShared = true; - } - } // namespace Grammar - - namespace Nodes - { - namespace Core - { - void FunctionCallNode::BuildNodeFromSubgraphInterface - (const AZ::Data::Asset& runtimeAsset - , const SlotExecution::Map& previousMap) - { - // build the node here, from the asset topology, take the node/variable ordering from the function runtime data as a suggestion - // deal with updates and conversions after - const Grammar::SubgraphInterface& subgraphInterface = runtimeAsset.Get()->m_runtimeData.m_interface; - m_prettyName = runtimeAsset.Get()->m_runtimeData.m_name; - - if (!subgraphInterface.IsAllInputOutputShared()) - { - AZ_Error("ScriptCanvas", false, "the current assumption is that there is no way to distinguish between the input/output of different nodelings"); - return; - } - - // for now, all outputs are shared - Grammar::Outputs outputs; - bool sharedOutputInitialized = false; - - SlotExecution::Ins slotMapIns; - SlotExecution::Outs slotMapLatents; - - int slotOffset = 0; - - // add all ins->outs, in their display groups - for (size_t indexIn = 0; indexIn < subgraphInterface.GetInCount(); ++indexIn) - { - const Grammar::In& interfaceIn = subgraphInterface.GetIn(indexIn); - - SlotExecution::In slotMapIn = AddExecutionInSlotFromInterface(interfaceIn, slotOffset++, previousMap.FindInSlotIdBySource(interfaceIn.sourceID)); - if (!slotMapIn.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Execution In slot from sub graph interface"); - return; - } - slotMapIn.inputs = AddDataInputSlotFromInterface(interfaceIn.inputs, interfaceIn.sourceID, interfaceIn.displayName, previousMap, slotOffset); - for (auto& input : slotMapIn.inputs) - { - if (!input.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Input slot from sub graph interface"); - return; - } - } - - for (auto& interfaceOut : interfaceIn.outs) - { - SlotExecution::Out slotMapOut = AddExecutionOutSlotFromInterface(interfaceIn, interfaceOut, slotOffset++, previousMap.FindOutSlotIdBySource(interfaceIn.sourceID, interfaceOut.sourceID)); - if (!slotMapOut.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Execution Out slot from sub graph interface"); - return; - } - if (!sharedOutputInitialized) - { - outputs = interfaceOut.outputs; - sharedOutputInitialized = true; - } - - slotMapIn.outs.push_back(slotMapOut); - } - - slotMapIns.push_back(slotMapIn); - } - - // add all latents in their display groups - for (size_t indexLatent = 0; indexLatent < subgraphInterface.GetLatentOutCount(); ++indexLatent) - { - const Grammar::Out& interfaceLatent = subgraphInterface.GetLatentOut(indexLatent); - - SlotExecution::Out slotMapLatentOut = AddExecutionLatentOutSlotFromInterface(interfaceLatent, slotOffset++, previousMap.FindLatentSlotIdBySource(interfaceLatent.sourceID)); - if (!slotMapLatentOut.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Latent Out slot from sub graph interface"); - return; - } - slotMapLatentOut.returnValues.values = AddDataInputSlotFromInterface(interfaceLatent.returnValues, interfaceLatent.sourceID, interfaceLatent.displayName, previousMap, slotOffset); - for (auto& input : slotMapLatentOut.returnValues.values) - { - if (!input.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Input slot from sub graph interface"); - return; - } - } - - if (!sharedOutputInitialized) - { - outputs = interfaceLatent.outputs; - sharedOutputInitialized = true; - } - - slotMapLatents.push_back(slotMapLatentOut); - } - - // add all outputs one time, since they are currently all required to be part of all the signatures [\todo must fix] , in a variable display group - SlotExecution::Outputs slotMapOutputs = AddDataOutputSlotFromInterface(outputs, "", previousMap, slotOffset); - for (auto& output : slotMapOutputs) - { - if (!output.slotId.IsValid()) - { - AZ_Error("ScriptCanvas", false, "Failed to add Output slot from sub graph interface"); - return; - } - } - if (!subgraphInterface.IsLatent()) - { - for (auto& slotMapIn : slotMapIns) - { - for (auto& slotMapOut : slotMapIn.outs) - { - slotMapOut.outputs = slotMapOutputs; - } - } - } - else - { - for (auto& slotMapLatent : slotMapLatents) - { - slotMapLatent.outputs = slotMapOutputs; - } - } - - // when returning variables: sort variables by source slot id, they are sorted in the slot map, so just take them from the slot map - m_slotExecutionMap = AZStd::move(SlotExecution::Map(AZStd::move(slotMapIns), AZStd::move(slotMapLatents))); - m_slotExecutionMapSourceInterface = subgraphInterface; - m_asset = runtimeAsset; - SignalSlotsReordered(); - } - } // namespace Core - } // namespace Nodes -} - -#endif diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.h deleted file mode 100644 index 756537fcc7..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/FunctionsLegacySupport.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 - -namespace ScriptCanvas -{ - namespace Grammar - { - enum class VariableScopeMeaning_LegacyFunctions : AZ::u32 - { - ValueInitialization, - FunctionPrototype, - }; - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h index 6ff1010509..12f4199bc4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h @@ -19,10 +19,6 @@ #include #include -#if defined (FUNCTION_LEGACY_SUPPORT_ENABLED) -#include "FunctionsLegacySupport.h" -#endif - namespace AZ { class ReflectContext; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp index 598671becb..3980fbd044 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp @@ -23,15 +23,6 @@ namespace ScriptCanvas } } - ////////////////// - // BaseTimerNode - ////////////////// - - BaseTimerNode::~BaseTimerNode() - { - StopTimer(); - } - void BaseTimerNode::OnInit() { AZStd::string slotName = GetTimeSlotName(); @@ -74,11 +65,6 @@ namespace ScriptCanvas AddTimeDataSlot(); } - void BaseTimerNode::OnDeactivate() - { - StopTimer(); - } - void BaseTimerNode::ConfigureVisualExtensions() { { @@ -103,54 +89,7 @@ namespace ScriptCanvas return nullptr; } - - void BaseTimerNode::OnSystemTick() - { - AZ::SystemTickBus::Handler::BusDisconnect(); - - if (!AZ::TickBus::Handler::BusIsConnected()) - { - AZ::TickBus::Handler::BusConnect(); - } - } - - void BaseTimerNode::OnTick(float delta, AZ::ScriptTimePoint) - { - if (m_timeUnits == TimeUnits::Ticks) - { - m_timerCounter += 1; - } - switch (m_timeUnits) - { - case TimeUnits::Ticks: - m_timerCounter += 1; - break; - case TimeUnits::Milliseconds: - case TimeUnits::Seconds: - m_timerCounter += delta; - break; - default: - break; - } - - while (m_timerCounter > m_timerDuration) - { - if (!m_isActive) - { - break; - } - - m_timerCounter -= m_timerDuration; - - OnTimeElapsed(); - } - } - - int BaseTimerNode::GetTickOrder() - { - return m_tickOrder; - } - + void BaseTimerNode::AddTimeDataSlot() { if (!m_timeSlotId.IsValid()) @@ -174,70 +113,6 @@ namespace ScriptCanvas } } - void BaseTimerNode::StartTimer() - { - StopTimer(); - - m_isActive = true; - - const Datum* datum = FindDatum(m_timeSlotId); - - if (datum) - { - const Data::NumberType* timeAmount = datum->GetAs(); - - if (timeAmount) - { - m_timerDuration = (*timeAmount); - m_timerCounter = 0; - - // Manage the different unit types - if (m_timeUnits == TimeUnits::Ticks) - { - // Remove all of the floating points - m_timerDuration = aznumeric_cast(aznumeric_cast(m_timerDuration)); - } - else if (m_timeUnits == TimeUnits::Milliseconds) - { - m_timerDuration /= 1000.0; - } - } - } - - if (AZ::TickBus::Handler::BusIsConnected()) - { - AZ::TickBus::Handler::BusDisconnect(); - } - - if (AZ::SystemTickBus::Handler::BusIsConnected()) - { - AZ::SystemTickBus::Handler::BusDisconnect(); - } - - if (!AZ::IsClose(m_timerDuration, 0.0, DBL_EPSILON)) - { - AZ::SystemTickBus::Handler::BusConnect(); - } - else if (AllowInstantResponse()) - { - while (m_isActive) - { - OnTimeElapsed(); - } - } - } - - void BaseTimerNode::StopTimer() - { - m_isActive = false; - - m_timerCounter = 0.0; - m_timerDuration = 0.0; - - AZ::SystemTickBus::Handler::BusDisconnect(); - AZ::TickBus::Handler::BusDisconnect(); - } - AZStd::string BaseTimerNode::GetTimeSlotName() const { return GetBaseTimeSlotName(); @@ -283,11 +158,7 @@ namespace ScriptCanvas { return false; } - - void BaseTimerNode::OnTimeElapsed() - { - } - + void BaseTimerNode::ConfigureTimeSlot(DataSlotConfiguration& configuration) { AZ_UNUSED(configuration); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h index ca4306cb6e..172569561c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h @@ -7,10 +7,7 @@ #pragma once -#include - #include - #include namespace ScriptCanvas @@ -23,8 +20,6 @@ namespace ScriptCanvas class BaseTimerNode : public Node , public NodePropertyInterfaceListener - , public AZ::TickBus::Handler - , public AZ::SystemTickBus::Handler { public: @@ -44,32 +39,16 @@ namespace ScriptCanvas "Seconds" }; - virtual ~BaseTimerNode(); - // Node... void OnInit() override; void OnConfigured() override; - void OnDeactivate() override; void ConfigureVisualExtensions() override; NodePropertyInterface* GetPropertyInterface(AZ::Crc32 propertyId) override; - //// - - // SystemTickBus... - void OnSystemTick() override; - //// - - // TickBus... - void OnTick(float delta, AZ::ScriptTimePoint timePoint) override; - int GetTickOrder() override; - //// - + // Method that will handle displaying and viewing of the time slot void AddTimeDataSlot(); - void StartTimer(); - void StopTimer(); - AZStd::string GetTimeSlotName() const; protected: @@ -83,7 +62,6 @@ namespace ScriptCanvas bool IsActive() const; virtual bool AllowInstantResponse() const; - virtual void OnTimeElapsed(); // Store until versioning is complete virtual const char* GetTimeSlotFormat() const { return "Time (%s)"; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp index aef18a9255..d383afe02f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp @@ -112,37 +112,6 @@ namespace ScriptCanvas } } - void ExpressionNodeBase::OnInputSignal(const SlotId& slotId) - { - if (slotId == ExpressionNodeBaseProperty::GetInSlotId(this)) - { - for (const SlotId& dirtySlotId : m_dirtyInputs) - { - auto variableIter = m_slotToVariableMap.find(dirtySlotId); - - if (variableIter != m_slotToVariableMap.end()) - { - PushVariable(variableIter->second, (*FindDatum(dirtySlotId))); - } - } - - m_dirtyInputs.clear(); - - if (m_parseError.IsValidExpression() && m_expressionTree.GetTreeSize() != 0) - { - ExpressionEvaluation::ExpressionResult expressionResult; - ExpressionEvaluation::ExpressionEvaluationRequestBus::BroadcastResult(expressionResult, &ExpressionEvaluation::ExpressionEvaluationRequests::Evaluate, m_expressionTree); - - OnResult(expressionResult); - } - } - } - - void ExpressionNodeBase::OnInputChanged([[maybe_unused]] const Datum& input, const SlotId& slotId) - { - m_dirtyInputs.insert(slotId); - } - bool ExpressionNodeBase::CanDeleteSlot([[maybe_unused]] const SlotId& slotId) const { return m_handlingExtension; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h index 4f8949ba4b..04d5400061 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h @@ -53,10 +53,6 @@ namespace ScriptCanvas void OnInit() override; void OnPostActivate() override; void ConfigureVisualExtensions() override; - - void OnInputSignal(const SlotId& slotId) override; - void OnInputChanged(const Datum& input, const SlotId& slotId) override; - bool CanDeleteSlot(const SlotId& slotId) const override; SlotId HandleExtension(AZ::Crc32 extensionId) override; @@ -110,7 +106,6 @@ namespace ScriptCanvas bool m_isInError = false; AZStd::unordered_map m_slotToVariableMap; - AZStd::unordered_set m_dirtyInputs; AZStd::unordered_map m_slotsByVariables; ExpressionEvaluation::ParsingError m_parseError; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h index 8d597884ed..1e9a821761 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h @@ -41,22 +41,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs == rhs); - - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h index baa4762911..d70158ccd1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h @@ -40,21 +40,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs > rhs); - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h index e9f5c06501..8546956aa6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h @@ -41,21 +41,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs >= rhs); - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h index b16f447d92..2c54247580 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h @@ -40,22 +40,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs < rhs); - - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h index 35364b918f..7f0077588f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h @@ -40,22 +40,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs <= rhs); - - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h index c11ff1ba05..b3f6158aa2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h @@ -40,22 +40,6 @@ namespace ScriptCanvas } } } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - ComparisonOutcome result(lhs != rhs); - - if (result.IsSuccess()) - { - return Datum(result.GetValue()); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str()); - return Datum(false); - } - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp index 7b840862bd..8afb5138e1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp @@ -75,20 +75,6 @@ namespace ScriptCanvas } } - void ArithmeticExpression::OnInputSignal(const SlotId& slotId) - { - if (slotId == GetSlotId(k_evaluateName)) - { - const Datum output = Evaluate(*FindDatumByIndex(k_datumIndexLHS), *FindDatumByIndex(k_datumIndexRHS)); - if (auto slot = GetSlot(GetOutputSlotId())) - { - PushOutput(output, *slot); - } - - SignalOutput(GetSlotId(k_outName)); - } - } - void ArithmeticExpression::Reflect(AZ::ReflectContext* reflection) { if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) @@ -107,17 +93,6 @@ namespace ScriptCanvas } } - Datum BinaryOperator::Evaluate([[maybe_unused]] const Datum& lhs, [[maybe_unused]] const Datum& rhs) - { - AZ_Assert(false, "Evaluate must be overridden"); - return Datum(); - }; - - void BinaryOperator::OnInputSignal([[maybe_unused]] const SlotId& slot) - { - AZ_Assert(false, "OnInputSignal must be overridden"); - } - void BinaryOperator::OnInit() { { @@ -159,28 +134,6 @@ namespace ScriptCanvas AZ_Assert(false, "InitializeBooleanExpression must be overridden"); } - void BooleanExpression::OnInputSignal(const SlotId& slotId) - { - if (slotId == GetSlotId(k_evaluateName)) - { - const Datum output = Evaluate(*FindDatumByIndex(k_datumIndexLHS), *FindDatumByIndex(k_datumIndexRHS)); - if (auto slot = GetSlot(GetOutputSlotId())) - { - PushOutput(output, *slot); - } - - const bool* result = output.GetAs(); - if (result && *result) - { - SignalOutput(GetSlotId(k_onTrue)); - } - else - { - SignalOutput(GetSlotId(k_onFalse)); - } - } - } - void BooleanExpression::OnInit() { { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h index eb44ce5db1..0558decaeb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h @@ -31,9 +31,7 @@ namespace ScriptCanvas static const char* k_evaluateName; static const char* k_outName; static const char* k_onTrue; - static const char* k_onFalse; - - + static const char* k_onFalse; protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override @@ -47,12 +45,6 @@ namespace ScriptCanvas void OnInit() override; - // must be overridden with the binary operations - virtual Datum Evaluate(const Datum& lhs, const Datum& rhs); - - // Triggered by the execution signal - void OnInputSignal(const SlotId& slot) override; - SlotId GetOutputSlotId() const; }; @@ -71,10 +63,6 @@ namespace ScriptCanvas protected: // adds Number inputs, adds Number output type void OnInit() override; - - void OnInputSignal(const SlotId& slot) override; - - }; class BooleanExpression @@ -107,9 +95,7 @@ namespace ScriptCanvas protected: // initialize boolean expression, adds boolean output type calls void OnInit() override; - virtual void InitializeBooleanExpression(); - void OnInputSignal(const SlotId& slot) override; - + virtual void InitializeBooleanExpression(); }; // accepts any type, checks for type equality, and then value equality or pointer equality @@ -126,10 +112,8 @@ namespace ScriptCanvas void InitializeBooleanExpression() override; private: - SlotId m_firstSlotId; SlotId m_secondSlotId; - ScriptCanvas::Data::Type m_displayType; }; @@ -144,8 +128,7 @@ namespace ScriptCanvas protected: // adds number types - void InitializeBooleanExpression() override; - + void InitializeBooleanExpression() override; }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp index fb43e41ad8..1575cd2c75 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -59,16 +58,6 @@ namespace ScriptCanvas SetAutoConnectToGraphOwner(m_autoConnectToGraphOwner); } - void EBusEventHandler::OnPostActivate() - { - - } - - void EBusEventHandler::OnDeactivate() - { - Disconnect(); - } - void EBusEventHandler::OnGraphSet() { GraphScopedNodeId scopedNodeId(GetOwningScriptCanvasId(), GetEntityId()); @@ -127,14 +116,6 @@ namespace ScriptCanvas } } - void EBusEventHandler::Connect() - { - } - - void EBusEventHandler::Disconnect() - { - } - AZ::Outcome EBusEventHandler::GetDependencies() const { return AZ::Success(DependencyReport{}); @@ -515,7 +496,6 @@ namespace ScriptCanvas const AZ::BehaviorEBusHandler::BusForwarderEvent& event = events[eventIndex]; AZ_Assert(!event.m_parameters.empty(), "No parameters in event!"); - m_handler->InstallGenericHook(events[eventIndex].m_name, &OnEventGenericHook, this); if (m_eventMap.find(AZ::Crc32(event.m_name)) != m_eventMap.end()) { @@ -621,137 +601,6 @@ namespace ScriptCanvas } } - void EBusEventHandler::OnEvent(const char* eventName, const int /*eventIndex*/, AZ::BehaviorValueParameter* result, const int numParameters, AZ::BehaviorValueParameter* parameters) - { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "EBusEventHandler::OnEvent %s", eventName); - - SCRIPTCANVAS_RETURN_IF_ERROR_STATE((*this)); - - auto iter = m_eventMap.find(AZ::Crc32(eventName)); - if (iter == m_eventMap.end()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Invalid event index in Ebus handler"); - return; - } - - EBusEventEntry& ebusEventEntry = iter->second; - - if (!ebusEventEntry.m_shouldHandleEvent || ebusEventEntry.m_isHandlingEvent) - { - AZ_Warning("ScriptCanvas", !ebusEventEntry.m_isHandlingEvent, "Found situation where in handling event(%s::%s) triggered the same event. Possible infinite loop, not handling second call.", GetEBusName().c_str(), eventName); - return; - } - - ebusEventEntry.m_isHandlingEvent = true; - - ebusEventEntry.m_resultEvaluated = !ebusEventEntry.IsExpectingResult(); - - AZ_Assert(ebusEventEntry.m_eventName.compare(eventName) == 0, "Wrong event handled by this EBusEventHandler! received %s, expected %s", eventName, ebusEventEntry.m_eventName.c_str()); - AZ_Assert(numParameters == ebusEventEntry.m_numExpectedArguments, "Wrong number of events passed into EBusEventHandler %s", eventName); - - // route my parameters to the connect nodes input - AZ_Assert(ebusEventEntry.m_parameterSlotIds.size() == numParameters, "Node %s-%s Num parameters = %d, but num output slots = %d", m_ebusName.c_str(), ebusEventEntry.m_eventName.c_str(), numParameters, ebusEventEntry.m_parameterSlotIds.size()); - - for (int parameterIndex(0); parameterIndex < numParameters; ++parameterIndex) - { - const Slot* slot = GetSlot(ebusEventEntry.m_parameterSlotIds[parameterIndex]); - const auto& value = *(parameters + parameterIndex); - const Datum input(value); - - PushOutput(input, (*slot)); - } - - // now, this should pass execution off to the nodes that will push their output into this result input - SignalOutput(ebusEventEntry.m_eventSlotId, ExecuteMode::UntilNodeIsFoundInStack); - - // route executed nodes output to my input, and my input to the result - if (ebusEventEntry.IsExpectingResult()) - { - if (result) - { - if (const Datum* resultInput = FindDatum(ebusEventEntry.m_resultSlotId)) - { - ebusEventEntry.m_resultEvaluated = resultInput->ToBehaviorContext(*result); - AZ_Warning("Script Canvas", ebusEventEntry.m_resultEvaluated, "Script Canvas failed to write a value back to the caller!"); - } - else - { - AZ_Warning("Script Canvas", false, "Script Canvas handler expecting a result, but had no ability to return it"); - } - } - else - { - AZ_Warning("Script Canvas", false, "Script Canvas handler is expecting a result, but was called without expecting one!"); - } - } - else - { - AZ_Warning("Script Canvas", !result, "Script Canvas handler is not expecting a result, but was called expecting one!"); - } - - // route executed nodes output to my input, and my input to the result - AZ_Warning("Script Canvas", (result != nullptr) == ebusEventEntry.IsExpectingResult(), "Node %s-%s mismatch between expecting a result and getting one!", m_ebusName.c_str(), ebusEventEntry.m_eventName.c_str()); - AZ_Warning("Script Canvas", ebusEventEntry.m_resultEvaluated, "Node %s-%s result not evaluated properly!", m_ebusName.c_str(), ebusEventEntry.m_eventName.c_str()); - - ebusEventEntry.m_isHandlingEvent = false; - } - - void EBusEventHandler::OnInputSignal(const SlotId& slotId) - { - SlotId connectSlot = EBusEventHandlerProperty::GetConnectSlotId(this); - SlotId disconnectSlot = EBusEventHandlerProperty::GetDisconnectSlotId(this); - - if (connectSlot == slotId) - { - if (IsIDRequired()) - { - const Datum* busIdDatum = FindDatum(GetSlotId(c_busIdName)); - - if (!busIdDatum || busIdDatum->Empty()) - { - SlotId failureSlot = EBusEventHandlerProperty::GetOnFailureSlotId(this); - SignalOutput(failureSlot); - SCRIPTCANVAS_REPORT_ERROR((*this), "In order to connect this node, a valid BusId must be provided."); - return; - } - } - - Disconnect(); - Connect(); - - SlotId onConnectSlotId = EBusEventHandlerProperty::GetOnConnectedSlotId(this); - SignalOutput(onConnectSlotId); - return; - } - else if (disconnectSlot == slotId) - { - Disconnect(); - - SlotId onDisconnectSlotId = EBusEventHandlerProperty::GetOnDisconnectedSlotId(this); - SignalOutput(onDisconnectSlotId); - return; - } - } - - void EBusEventHandler::OnInputChanged(const Datum& /*input*/, const SlotId& /*slotId*/) - { - /* - if (GetExecutionType() == ExecutionType::Runtime - && m_autoConnectToGraphOwner - && slotId == FindSlotIdForDescriptor(c_busIdName, SlotDescriptors::DataIn())) - { - Disconnect(); - Connect(); - } - */ - } - - void EBusEventHandler::OnEventGenericHook(void* userData, const char* eventName, int eventIndex, AZ::BehaviorValueParameter* result, int numParameters, AZ::BehaviorValueParameter* parameters) - { - EBusEventHandler* handler(reinterpret_cast(userData)); - handler->OnEvent(eventName, eventIndex, result, numParameters, parameters); - } - void EBusEventHandler::OnWriteEnd() { AZStd::lock_guard lock(m_mutex); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h index 5fad1ecec2..54776f18de 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h @@ -78,9 +78,6 @@ namespace ScriptCanvas void OnInit() override; void OnActivate() override; - void OnPostActivate() override; - void OnDeactivate() override; - void OnGraphSet() override; void CollectVariableReferences(AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const override; @@ -96,16 +93,10 @@ namespace ScriptCanvas void InitializeEvent(int eventIndex); - bool IsOutOfDate(const VersionData& graphVersion) const override; - - + bool IsOutOfDate(const VersionData& graphVersion) const override; bool CreateHandler(AZStd::string_view ebusName); - - void Connect(); - - void Disconnect(); - + const EBusEventEntry* FindEventWithSlot(const Slot& slot) const; AZ::Outcome GetFunctionCallName(const Slot* /*slot*/) const override; @@ -166,16 +157,10 @@ namespace ScriptCanvas inline bool IsConfigured() const { return !m_eventMap.empty(); } - void OnEvent(const char* eventName, const int eventIndex, AZ::BehaviorValueParameter* result, const int numParameters, AZ::BehaviorValueParameter* parameters); - - void OnInputSignal(const SlotId&) override; - void OnInputChanged(const Datum& input, const SlotId& slotID) override; - private: EBusEventHandler(const EBusEventHandler&) = delete; - static void OnEventGenericHook(void* userData, const char* eventName, int eventIndex, AZ::BehaviorValueParameter* result, int numParameters, AZ::BehaviorValueParameter* parameters); - + EventMap m_eventMap; AZStd::string m_ebusName; ScriptCanvas::EBusBusId m_busId; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index c8defb77ec..43fc8ed54b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -63,43 +63,6 @@ namespace ScriptCanvas } } - void GetVariableNode::OnInputSignal(const SlotId& slotID) - { - if (slotID == GetSlotId("In")) - { - SC_EXECUTION_TRACE_ANNOTATE_NODE((*this), CreateAnnotationData()); - - if (m_variableView.IsValid()) - { - Slot* resultSlot = GetSlot(m_variableDataOutSlotId); - if (resultSlot) - { - const Datum* inputDatum = m_variableView.GetDatum(); - - PushOutput(*inputDatum, *resultSlot); - - // Push the data for each property slot out as well - for (auto&& propertyAccount : m_propertyAccounts) - { - Slot* propertySlot = GetSlot(propertyAccount.m_propertySlotId); - if (propertySlot && propertyAccount.m_getterFunction) - { - auto outputOutcome = propertyAccount.m_getterFunction(*inputDatum); - if (!outputOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), outputOutcome.TakeError().data()); - return; - } - PushOutput(outputOutcome.TakeValue(), *propertySlot); - } - } - } - } - - SignalOutput(GetSlotId("Out")); - } - } - void GetVariableNode::CollectVariableReferences(AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const { if (m_variableId.IsValid()) @@ -324,8 +287,9 @@ namespace ScriptCanvas ScriptCanvas::Data::Type baseType = ScriptCanvas::Data::Type::Invalid(); VariableRequestBus::EventResult(baseType, GetScopedVariableId(), &VariableRequests::GetType); - const GraphVariableMapping* variableMap = GetRuntimeBus()->GetVariables(); - + const GraphVariableMapping* variableMap = nullptr; + GraphRequestBus::EventResult(variableMap, *GraphNotificationBus::GetCurrentBusId(), &GraphRequests::GetVariables); + if (variableMap && baseType.IsValid()) { for (const auto& variablePair : *variableMap) @@ -360,12 +324,6 @@ namespace ScriptCanvas VariableNodeNotificationBus::Event(GetEntityId(), &VariableNodeNotifications::OnVariableRemovedFromNode, removedVariableId); } - AnnotateNodeSignal GetVariableNode::CreateAnnotationData() - { - AZ::EntityId assetNodeId = GetRuntimeBus()->FindAssetNodeIdByRuntimeNodeId(GetEntityId()); - return AnnotateNodeSignal(CreateGraphInfo(GetOwningScriptCanvasId(), GetGraphIdentifier()), AnnotateNodeSignal::AnnotationLevel::Info, m_variableName, AZ::NamedEntityId(assetNodeId, GetNodeName())); - } - VariableId GetVariableNode::GetVariableIdRead(const Slot*) const { return m_variableId; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h index e5011de5c6..a73d6b27b3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h @@ -64,7 +64,6 @@ namespace ScriptCanvas void OnInit() override; void OnPostActivate() override; - void OnInputSignal(const SlotId&) override; void AddOutputSlot(); void RemoveOutputSlot(); @@ -78,8 +77,6 @@ namespace ScriptCanvas void OnVariableRemoved() override; //// - AnnotateNodeSignal CreateAnnotationData(); - // Adds/Remove Property Slots from the GetVariable node void AddPropertySlots(const Data::Type& type); void ClearPropertySlots(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp index 144427d74c..ea3f2015b1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp @@ -11,105 +11,6 @@ namespace ScriptCanvas { - int CountMatchingInputTypes(const Grammar::FunctionPrototype& a, const Grammar::FunctionPrototype& b, const AZStd::vector& checkedIndices) - { - AZ_Warning("ScriptCanvas", a.m_inputs.size() == b.m_inputs.size(), "Function inputs are not the same size"); - - int matching = 0; - - if (a.m_inputs.size() == b.m_inputs.size()) - { - if (checkedIndices.empty()) - { - for (size_t index = 0; index < a.m_inputs.size(); ++index) - { - if (!a.m_inputs[index]->m_datum.GetType().IsValid() - || a.m_inputs[index]->m_datum.GetType() == b.m_inputs[index]->m_datum.GetType()) - { - ++matching; - } - } - } - else - { - for (const auto checkedIndex : checkedIndices) - { - const auto index = checkedIndices[checkedIndex]; - - if (index < a.m_inputs.size()) - { - if (!a.m_inputs[index]->m_datum.GetType().IsValid() - || a.m_inputs[index]->m_datum.GetType() == b.m_inputs[index]->m_datum.GetType()) - { - ++matching; - } - } - else - { - AZ_Error("ScriptCanvas", false, "Overload checked index is no longer valid"); - } - } - } - } - - return matching; - } - - BehaviorContextMethodHelper::CallResult BehaviorContextMethodHelper::Call(Node& node, bool isExpectingMultipleResults, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, AZStd::vector& resultSlotIds) - { - if (isExpectingMultipleResults) - { - return BehaviorContextMethodHelper::Call(node, method, paramBegin, paramEnd, resultSlotIds); - } - else - { - return BehaviorContextMethodHelper::Call(node, method, paramBegin, paramEnd, resultSlotIds[0]); - } - } - - BehaviorContextMethodHelper::CallResult BehaviorContextMethodHelper::Call(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, SlotId resultSlotId) - { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Method::OnInputSignal::Call %s", method->m_name.c_str()); - return CallGeneric(node, method, paramBegin, paramEnd, &AttemptCallWithResults, resultSlotId); - } - - BehaviorContextMethodHelper::CallResult BehaviorContextMethodHelper::Call(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, AZStd::vector& resultSlotIds) - { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Method::OnInputSignal::Call %s", method->m_name.c_str()); - return CallGeneric(node, method, paramBegin, paramEnd, &AttemptCallWithTupleResults, resultSlotIds); - } - - AZ::Outcome BehaviorContextMethodHelper::AttemptCallWithResults(Node&, const AZ::BehaviorMethod*, AZ::BehaviorValueParameter*, unsigned int, SlotId) - { - return AZ::Failure(AZStd::string("This method is slated for deletion")); - } - - AZ::Outcome BehaviorContextMethodHelper::AttemptCallWithTupleResults(Node&, const AZ::BehaviorMethod*, AZ::BehaviorValueParameter*, unsigned int, AZStd::vector) - { - return AZ::Failure(AZStd::string("This method is slated for deletion")); - } - - AZ::Outcome BehaviorContextMethodHelper::CallTupleGetMethod(const AZ::BehaviorMethod*, Datum&) - { - return AZ::Failure(AZStd::string("This method is slated for deletion")); - } - - AZ::Outcome BehaviorContextMethodHelper::CallOutcomeTupleMethod(Node&, const SlotId&, Datum&, size_t, AZStd::string) - { - return AZ::Failure(AZStd::string("to be deleted")); - } - - AZ::BehaviorValueParameter BehaviorContextMethodHelper::ToBehaviorValueParameter(const AZ::BehaviorMethod* method, size_t index, const Datum& datum) - { - const AZ::BehaviorParameter* datumParam = method->GetArgument(index); - auto toParamOutcome = datumParam ? datum.ToBehaviorValueParameter(*datumParam) : AZ::Failure(AZStd::string::format("BehaviorMethod contains nullptr BehaviorParameter at index %zu", index)); - if (toParamOutcome) - { - return AZ::BehaviorValueParameter(toParamOutcome.TakeValue()); - } - return AZ::BehaviorValueParameter(); - } - AZStd::unordered_map GetTupleGetMethodsFromResult(const AZ::BehaviorMethod& method) { if (method.HasResult()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h index 92248d3ac6..890cb2427d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h @@ -19,202 +19,9 @@ namespace ScriptCanvas::Grammar namespace ScriptCanvas { - int CountMatchingInputTypes(const Grammar::FunctionPrototype& a, const Grammar::FunctionPrototype& b, const AZStd::vector& checkedIndices); - - struct BehaviorContextMethodHelper - { - enum BehaviorContextInputOutput : size_t - { - MaxCount = 40, - }; - - enum class MethodCallStatus - { - NotAttempted = 0, - Attempted, - Failed, - Succeeded, - }; - - struct CallResult - { - const MethodCallStatus m_status = MethodCallStatus::NotAttempted; - const AZStd::string m_executionOutOverride = "Out"; - - AZ_INLINE CallResult(const MethodCallStatus status, AZStd::string executionOutOverride = "Out") - : m_status(status) - , m_executionOutOverride(executionOutOverride) - {} - }; - - template - static CallResult CallGeneric(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, t_Call attempt, t_Slots& slots); - - static CallResult Call(Node& node, bool isExpectingMultipleResults, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, AZStd::vector& resultSlotIds); - static CallResult Call(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, SlotId resultSlotId); - static CallResult Call(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, AZStd::vector& resultSlotIds); - static AZ::Outcome AttemptCallWithResults(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* params, unsigned int numExpectedArgs, SlotId resultSlotId); - static AZ::Outcome AttemptCallWithTupleResults(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* params, unsigned int numExpectedArgs, AZStd::vector resultSlotIds); - - template - static AZ::Outcome CallMethodOnDatum(const Datum& input, AZStd::string_view methodName, Args&& ... args); - - template - static AZ::Outcome CallMethodOnDatumUnpackOutcomeSuccess(const Datum& input, AZStd::string_view methodName, Args&& ... args); - - template - static AZStd::vector CreateParameterList(const AZ::BehaviorMethod* method, Args&&... args); - - static AZ::Outcome CallTupleGetMethod(const AZ::BehaviorMethod* method, Datum& thisPointer); - - private: - static AZ::Outcome CallOutcomeTupleMethod(Node& node, const SlotId& resultSlotId, Datum& outcomeDatum, size_t index, AZStd::string outSlotName); - static AZ::BehaviorValueParameter ToBehaviorValueParameter(const AZ::BehaviorMethod* method, size_t index, const Datum& datum); - - template - static AZ::BehaviorValueParameter ToBehaviorValueParameter(const AZ::BehaviorMethod*, size_t, const T& arg); - - template - static AZStd::vector CreateParameterListInternal(const AZ::BehaviorMethod* method, AZStd::index_sequence, Args&&... args); - }; - 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); - - template - BehaviorContextMethodHelper::CallResult BehaviorContextMethodHelper::CallGeneric(Node& node, const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* paramBegin, AZ::BehaviorValueParameter* paramEnd, t_Call attempt, t_Slots& slots) - { - const auto numExpectedArgs(static_cast(method->GetNumArguments())); - if ((paramEnd - paramBegin) == numExpectedArgs) - { - AZ::Outcome withResultsOutcome = attempt(node, method, paramBegin, numExpectedArgs, slots); - - if (!withResultsOutcome.IsSuccess()) - { - SCRIPTCANVAS_REPORT_ERROR((node), "Script Canvas attempt to call %s with a result failed: %s", method->m_name.data(), withResultsOutcome.GetError().data()); - return CallResult(MethodCallStatus::Failed); - } - else if (withResultsOutcome.GetValue().m_status == MethodCallStatus::Attempted) - { - return CallResult(MethodCallStatus::Succeeded, withResultsOutcome.GetValue().m_executionOutOverride); - } - else if (method->Call(paramBegin, numExpectedArgs)) - { - return CallResult(MethodCallStatus::Succeeded); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((node), "Script Canvas attempt to call %s failed", method->m_name.data()); - return CallResult(MethodCallStatus::Failed); - } - } - else - { - SCRIPTCANVAS_REPORT_ERROR((node), "Script Canvas attempt to call %s failed, it expects %d args but called with %d", method->m_name.c_str(), numExpectedArgs, paramEnd - paramBegin); - return CallResult(MethodCallStatus::NotAttempted); - } - } - - template - AZ::Outcome BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(const Datum& input, AZStd::string_view methodName, Args&& ... args) - { - AZ::Outcome methodCallResult = CallMethodOnDatum(input, methodName, args...); - if (methodCallResult.IsSuccess()) - { - // Even when successfully called, the method will return an outcome as the result, we need to test that - // outcome in case any errors were returned from the invoked function call. - const Datum& methodCallResultDatum = methodCallResult.GetValue(); - - const auto* actualOutcome = methodCallResultDatum.GetAs>(); - if (actualOutcome && !actualOutcome->IsSuccess()) - { - return AZ::Failure(AZStd::string::format("%s returned an error: %s", methodName.data(), actualOutcome->GetError().c_str())); - } - - AZ::Outcome isSuccessCallResult = CallMethodOnDatum(methodCallResult.GetValue(), "IsSuccess"); - if (isSuccessCallResult.IsSuccess()) - { - if (*isSuccessCallResult.GetValue().GetAs()) - { - return CallMethodOnDatum(methodCallResult.GetValue(), "GetValue"); - } - else - { - return AZ::Failure(AZStd::string::format("%s returned an error", methodName.data())); - } - } - else - { - return AZ::Failure(AZStd::string::format("Script Canvas attempt to call %s failed, Failed to query result Outcome success", methodName.data())); - } - } - else - { - return AZ::Failure(methodCallResult.GetError()); - } - - return methodCallResult; - } - - template - AZ::Outcome BehaviorContextMethodHelper::CallMethodOnDatum(const Datum& input, AZStd::string_view methodName, Args&& ... args) - { - const AZ::BehaviorClass* behaviorClass = AZ::BehaviorContextHelper::GetClass(input.GetType().GetAZType()); - if (behaviorClass) - { - auto methodIt = behaviorClass->m_methods.find(methodName); - - if (methodIt != behaviorClass->m_methods.end()) - { - AZ::BehaviorMethod* method = methodIt->second; - - const AZ::BehaviorParameter* resultType = method->HasResult() ? method->GetResult() : nullptr; - - if (resultType) - { - // Populate parameters - AZStd::vector parameters = CreateParameterList(method, input, AZStd::forward(args)...); - return Datum::CallBehaviorContextMethodResult(method, resultType, parameters.begin(), (unsigned int)AZStd::GetMin(parameters.size(), method->GetNumArguments()), behaviorClass->m_name); - } - else - { - AZStd::vector parameters = CreateParameterList(method, input, AZStd::forward(args)...); - if (Datum::CallBehaviorContextMethod(method, parameters.begin(), (unsigned int)AZStd::GetMin(parameters.size(), method->GetNumArguments())).IsSuccess()) - { - return AZ::Success(Datum()); - } - } - } - else - { - return AZ::Failure(AZStd::string::format("ScriptCanvas Behavior Context method call failed; method named \"%s\" not found.", methodName.data())); - } - } - - return AZ::Failure(AZStd::string::format("ScriptCanvas Behavior Context method call failed; unable to retrieve Behavior Class.")); - } - - template - AZStd::vector BehaviorContextMethodHelper::CreateParameterList(const AZ::BehaviorMethod* method, Args&&... args) - { - // Create an index sequence for the parameters and forward the arguments - return CreateParameterListInternal(method, AZStd::make_index_sequence{}, AZStd::forward(args)...); - } - - template - AZ::BehaviorValueParameter BehaviorContextMethodHelper::ToBehaviorValueParameter(const AZ::BehaviorMethod*, size_t, const T& arg) - { - return AZ::BehaviorValueParameter(&arg); - } - - template - AZStd::vector BehaviorContextMethodHelper::CreateParameterListInternal(const AZ::BehaviorMethod* method, AZStd::index_sequence, Args&&... args) - { - // Unpack the arguments and the index sequence to populate the parameter list - return { ToBehaviorValueParameter(method, Indices, args)... }; - } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp index b797174f59..17f2242b90 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp @@ -12,8 +12,8 @@ #include #include +#include #include -#include #include #include @@ -75,7 +75,7 @@ namespace ScriptCanvas AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, asset.GetId()); AZStd::string graphAssetName; - RuntimeRequestBus::EventResult(graphAssetName, GetOwningScriptCanvasId(), &RuntimeRequests::GetAssetName); + GraphRequestBus::EventResult(graphAssetName, GetOwningScriptCanvasId(), &GraphRequests::GetAssetName); AZ_Error("Script Event", false, "The Script Event asset (%s) has been modified. Open the graph (%s) and re-save it.", assetInfo.m_relativePath.c_str(), graphAssetName.c_str()); return; @@ -325,197 +325,16 @@ namespace ScriptCanvas } } - void ReceiveScriptEvent::OnEvent(const char* eventName, const int, AZ::BehaviorValueParameter* result, const int numParameters, AZ::BehaviorValueParameter* parameters) - { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "ReceiveScriptEvent::OnEvent %s", eventName); - - SCRIPTCANVAS_RETURN_IF_ERROR_STATE((*this)); - - ScriptEvents::Method method; - if (!GetScriptEvent().FindMethod(eventName, method)) - { - AZ_Warning("Script Events", false, "Failed to find method: %s when trying to handle it.", eventName); - return; - } - - auto iter = m_eventMap.find(AZ::Crc32(method.GetNameProperty().GetId().ToString().c_str())); - if (iter == m_eventMap.end()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Invalid event index in Ebus handler"); - return; - } - - Internal::ScriptEventEntry& scriptEventEntry = iter->second; - - if (!scriptEventEntry.m_shouldHandleEvent || scriptEventEntry.m_isHandlingEvent) - { - AZ_Warning("ScriptCanvas", !scriptEventEntry.m_isHandlingEvent, "Found situation where in handling event(%s::%s) triggered the same event. Possible infinite loop, not handling second call.", GetScriptEvent().GetName().c_str(), eventName); - return; - } - - scriptEventEntry.m_isHandlingEvent = true; - - scriptEventEntry.m_resultEvaluated = !scriptEventEntry.IsExpectingResult(); - - // route the parameters to the connect nodes input - if (scriptEventEntry.m_parameterSlotIds.size() != numParameters) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "The Script Event, %s, has %d parameters. While the ScriptCanvas Node (%s) has (%zu) slots. Make sure the node is updated in the Script Canvas graph.", eventName, numParameters, GetNodeName().c_str(), scriptEventEntry.m_parameterSlotIds.size()); - } - else - { - for (int parameterIndex(0); parameterIndex < numParameters; ++parameterIndex) - { - const Slot* slot = GetSlot(scriptEventEntry.m_parameterSlotIds[parameterIndex]); - const auto& value = *(parameters + parameterIndex); - const Datum input(value); - - if (slot->IsTypeMatchFor(input.GetType())) - { - PushOutput(input, *slot); - } - else - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Type mismatch in Script Event %s on ScriptCanvas Node (%s). Make sure the nodes is updated in the Script Canvas graph", eventName, GetNodeName().c_str()); - } - } - } - - { - // now, this should pass execution off to the nodes that will push their output into this result input - SignalOutput(scriptEventEntry.m_eventSlotId, ExecuteMode::UntilNodeIsFoundInStack); - } - - // route executed nodes output to my input, and my input to the result - if (scriptEventEntry.IsExpectingResult()) - { - if (result) - { - if (const Datum* resultInput = FindDatum(scriptEventEntry.m_resultSlotId)) - { - scriptEventEntry.m_resultEvaluated = resultInput->ToBehaviorContext(*result); - AZ_Warning("Script Canvas", scriptEventEntry.m_resultEvaluated, "%s expects a result value of type %s to be provided, got %s", scriptEventEntry.m_eventName.c_str(), Data::GetName(resultInput->GetType()).c_str(), result->m_name); - } - else - { - AZ_Warning("Script Canvas", false, "Script Canvas handler expecting a result, but had no ability to return it"); - } - } - else - { - AZ_Warning("Script Canvas", false, "Script Canvas handler is expecting a result, but was called without receiving one!"); - } - } - else - { - AZ_Warning("Script Canvas", !result, "Script Canvas handler is not expecting a result, but was called receiving one!"); - } - - // route executed nodes output to my input, and my input to the result - AZ_Warning("Script Canvas", (result != nullptr) == scriptEventEntry.IsExpectingResult(), "Node %s-%s mismatch between expecting a result and getting one!", m_ebus->m_name.c_str(), scriptEventEntry.m_eventName.c_str()); - AZ_Warning("Script Canvas", scriptEventEntry.m_resultEvaluated, "Node %s-%s result not evaluated properly!", m_ebus->m_name.c_str(), scriptEventEntry.m_eventName.c_str()); - - scriptEventEntry.m_isHandlingEvent = false; - } - void ReceiveScriptEvent::OnActivate() { SetAutoConnectToGraphOwner(m_autoConnectToGraphOwner); ScriptEventBase::OnActivate(); } - void ReceiveScriptEvent::OnPostActivate() - { - - } - void ReceiveScriptEvent::OnDeactivate() { - Disconnect(false); - ScriptEventBase::OnDeactivate(); - } - - void ReceiveScriptEvent::Connect() - { - AZ::EntityId connectToEntityId; - AZ::BehaviorValueParameter busIdParameter; - busIdParameter.Set(m_ebus->m_idParam); - const AZ::Uuid busIdType = m_ebus->m_idParam.m_typeId; - - const Datum* busIdDatum = IsIDRequired() ? FindDatum(GetSlotId(c_busIdName)) : nullptr; - if (busIdDatum && !busIdDatum->Empty()) - { - if (busIdDatum->IS_A(Data::FromAZType(busIdType)) || busIdDatum->IsConvertibleTo(Data::FromAZType(busIdType))) - { - auto busIdOutcome = busIdDatum->ToBehaviorValueParameter(m_ebus->m_idParam); - if (busIdOutcome.IsSuccess()) - { - busIdParameter = busIdOutcome.TakeValue(); - } - } - - if (busIdType == azrtti_typeid()) - { - if (auto busEntityId = busIdDatum->GetAs()) - { - if (!busEntityId->IsValid() || *busEntityId == ScriptCanvas::GraphOwnerId) - { - RuntimeRequestBus::EventResult(connectToEntityId, GetOwningScriptCanvasId(), &RuntimeRequests::GetRuntimeEntityId); - busIdParameter.m_value = &connectToEntityId; - } - } - } - } - - if (!IsIDRequired() || busIdParameter.GetValueAddress()) - { - if (m_connected) - { - // Ensure we disconnect if this bus is already connected, this could happen if a different bus Id is provided - // and this node is connected through the Connect slot. - m_handler->Disconnect(); - } - - AZ_VerifyError("Script Canvas", m_handler->Connect(&busIdParameter), - "Unable to connect to EBus with BusIdType %s. The BusIdType of the Script Event (%s) does not match the BusIdType provided.", - busIdType.ToString().data(), m_definition.GetName().c_str()); - - m_connected = true; - } - } - - void ReceiveScriptEvent::CompleteDisconnection() - { - m_handler->Disconnect(); - m_connected = false; - - if (IsActivated()) - { - SlotId onDisconnectSlotId = ReceiveScriptEventProperty::GetOnDisconnectedSlotId(this); - SignalOutput(onDisconnectSlotId); - } - } - - void ReceiveScriptEvent::Disconnect(bool queueDisconnect) - { - if (m_connected && m_handler) - { - if (queueDisconnect) - { - AZ::SystemTickBus::QueueFunction( - [this]() - { - CompleteDisconnection(); - } - ); - } - else - { - CompleteDisconnection(); - } - } - } + } const Internal::ScriptEventEntry* ReceiveScriptEvent::FindEventWithSlot(const Slot& slot) const { @@ -771,51 +590,6 @@ namespace ScriptCanvas return true; } - void ReceiveScriptEvent::OnInputSignal(const SlotId& slotId) - { - SlotId connectSlot = ReceiveScriptEventProperty::GetConnectSlotId(this); - - if (connectSlot == slotId) - { - const Datum* busIdDatum = FindDatum(GetSlotId(c_busIdName)); - if (IsIDRequired() && (!busIdDatum || busIdDatum->Empty())) - { - SlotId failureSlot = ReceiveScriptEventProperty::GetOnFailureSlotId(this); - SignalOutput(failureSlot); - SCRIPTCANVAS_REPORT_ERROR((*this), "In order to connect this node, a valid BusId must be provided."); - return; - } - else - { - Connect(); - SlotId onConnectSlotId = ReceiveScriptEventProperty::GetOnConnectedSlotId(this); - SignalOutput(onConnectSlotId); - return; - } - } - - SlotId disconnectSlot = ReceiveScriptEventProperty::GetDisconnectSlotId(this); - if (disconnectSlot == slotId) - { - Disconnect(); - - return; - } - } - - void ReceiveScriptEvent::OnInputChanged(const Datum&, const SlotId&) - { - /* - if (GetExecutionType() == ExecutionType::Runtime - && m_autoConnectToGraphOwner - && slotId == FindSlotIdForDescriptor(c_busIdName, SlotDescriptors::DataIn())) - { - Disconnect(false); - Connect(); - } - */ - } - bool ReceiveScriptEvent::IsOutOfDate(const VersionData& graphVersion) const { AZ_UNUSED(graphVersion); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h index e541f428db..d1aa439b42 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h @@ -87,16 +87,9 @@ namespace ScriptCanvas private: - void Connect(); - void Disconnect(bool queueDisconnect = true); - void CompleteDisconnection(); - bool CreateEbus(); bool SetupHandler(); - void OnInputSignal(const SlotId& slotId) override; - void OnInputChanged(const Datum& input, const SlotId& slotId) override; - AZ::BehaviorEBusHandler* m_handler = nullptr; AZ::BehaviorEBus* m_ebus = nullptr; AZStd::recursive_mutex m_mutex; // post-serialization @@ -105,9 +98,6 @@ namespace ScriptCanvas void InitializeEvent(AZ::Data::Asset asset, int eventIndex, SlotIdMapping& populationMapping); - static void OnEventGenericHook(void* userData, const char* eventName, int eventIndex, AZ::BehaviorValueParameter* result, int numParameters, AZ::BehaviorValueParameter* parameters); - void OnEvent(const char* eventName, const int eventIndex, AZ::BehaviorValueParameter* result, const int numParameters, AZ::BehaviorValueParameter* parameters); - bool IsEventConnected(const Internal::ScriptEventEntry& entry) const; Internal::ScriptEventEntry ConfigureEbusEntry(const ScriptEvents::Method& methodDefinition, const AZ::BehaviorEBusHandler::BusForwarderEvent& event, SlotIdMapping& populationMapping); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp index 3ff8545746..964c2b8454 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp @@ -74,28 +74,6 @@ namespace ScriptCanvas } } } - - void Repeater::OnInputSignal(const SlotId&) - { - m_repetionCount = aznumeric_cast(RepeaterProperty::GetRepetitions(this)); - - if (m_repetionCount > 0) - { - StartTimer(); - } - } - - void Repeater::OnTimeElapsed() - { - m_repetionCount--; - SignalOutput(RepeaterProperty::GetActionSlotId(this), ScriptCanvas::ExecuteMode::UntilNodeIsFoundInStack); - - if (m_repetionCount == 0) - { - StopTimer(); - SignalOutput(RepeaterProperty::GetCompleteSlotId(this)); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h index 3d094feb78..0cd9c73c98 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h @@ -17,6 +17,7 @@ namespace ScriptCanvas namespace Core { //! A node that repeats an execution signal over the specified time + //! Deprecated for nodeable version class Repeater : public ScriptCanvas::Nodes::Internal::BaseTimerNode { @@ -27,18 +28,11 @@ namespace ScriptCanvas void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - void OnTimeElapsed(); - const char* GetTimeSlotFormat() const override { return "Delay (%s)"; } - const char* GetBaseTimeSlotName() const override { return "Interval"; } const char* GetBaseTimeSlotToolTip() const override { return "The Interval between repetitions"; } protected: - - bool AllowInstantResponse() const override { return true; } - int m_repetionCount; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp index ac946dc037..45314b73f3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp @@ -10,8 +10,6 @@ #include #include #include - -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h index d2ec893b5b..5b2104f5dd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h @@ -106,9 +106,7 @@ namespace ScriptCanvas AZStd::pair, bool> IsAssetOutOfDate() const; - virtual void Initialize(const AZ::Data::AssetId assetId); - - + virtual void Initialize(const AZ::Data::AssetId assetId); protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp index ee1d00e646..345fb5e5e8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp @@ -28,64 +28,6 @@ namespace ScriptCanvas ScriptEvents::ScriptEventNotificationBus::Handler::BusDisconnect(); } - void SendScriptEvent::OnInputSignal(const SlotId&) - { - if (!m_method) - { - if (!m_asset.IsReady()) - { - m_asset = AZ::Data::AssetManager::Instance().GetAsset(m_scriptEventAssetId, AZ::Data::AssetLoadBehavior::PreLoad); - } - - CreateSender(m_asset); - } - - if (!m_method) - { - AZStd::string error = AZStd::string::format("Script Event sender node called with no initialized method (%s::%s)!", m_busName.c_str(), m_eventName.c_str()); - SCRIPTCANVAS_REPORT_ERROR((*this), error.c_str()); - } - - if (m_method) - { - Node::DatumVector inputDatums = GatherDatumsForDescriptor(SlotDescriptors::DataIn()); - - if (m_method->GetNumArguments() != inputDatums.size()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "The Script Event %s number of parameters %d do not correspond to the number of slots %zu in the Script Canvas node (%s). Make sure the node is updated in the Script Canvas graph.", m_method->m_name.c_str(), m_method->GetNumArguments(), inputDatums.size(), GetNodeName().c_str()); - return; - } - - AZStd::array params; - AZ::BehaviorValueParameter* paramFirst(params.begin()); - AZ::BehaviorValueParameter* paramIter = paramFirst; - { - // all input should have been pushed into this node already - int argIndex(0); - for (const Datum* datum : inputDatums) - { - AZ::Outcome inputParameter = datum->ToBehaviorValueParameter(*m_method->GetArgument(argIndex)); - if (!inputParameter.IsSuccess()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "BehaviorContext method input problem at parameter index %d: %s", argIndex, inputParameter.GetError().data()); - return; - } - - paramIter->Set(inputParameter.GetValue()); - ++paramIter; - ++argIndex; - } - - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::ScriptEvents::OnInputSignal::Call %s::%s", m_busName.c_str(), m_eventName.c_str()); - { - BehaviorContextMethodHelper::Call(*this, m_method, paramFirst, paramIter, m_resultSlotID); - } - } - } - - SignalOutput(GetSlotId("Out")); - } - ScriptCanvas::EBusBusId SendScriptEvent::GetBusId() const { return m_busId; @@ -155,11 +97,6 @@ namespace ScriptCanvas AZ::Outcome IsExposable(const AZ::BehaviorMethod& method) { - if (method.GetNumArguments() > BehaviorContextMethodHelper::MaxCount) - { - return AZ::Failure(AZStd::string("Too many arguments for a Script Canvas method")); - } - for (size_t argIndex(0), sentinel(method.GetNumArguments()); argIndex != sentinel; ++argIndex) { if (const AZ::BehaviorParameter* argument = method.GetArgument(argIndex)) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.h index 27cd309386..7490fef650 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.h @@ -79,11 +79,7 @@ namespace ScriptCanvas bool IsConfigured() const { return m_method != nullptr; } void ConfigureMethod(AZ::BehaviorMethod& method); bool RegisterScriptEvent(AZ::Data::Asset asset); - - void OnInputSignal(const SlotId&) override; - void AddInputSlot(size_t slotIndex, size_t argIndex, const AZStd::string_view argName, const AZStd::string_view tooltip, AZ::BehaviorMethod* method, const AZ::BehaviorParameter* argument, AZ::Uuid slotKey, SlotIdMapping& populationMapping); - void OnRegistered(const ScriptEvents::ScriptEvent&) override; SlotId m_resultSlotID; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp index 7096f5024e..25a73bc7ce 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp @@ -59,47 +59,6 @@ namespace ScriptCanvas } } - void SetVariableNode::OnInputSignal(const SlotId& slotID) - { - if (slotID == GetSlotId(GetInputSlotName())) - { - const Datum* sourceDatum = FindDatum(m_variableDataInSlotId); - - if (sourceDatum && m_variableView.IsValid()) - { - m_variableView.AssignToDatum((*sourceDatum)); - - SC_EXECUTION_TRACE_VARIABLE_CHANGE((m_variableId), (CreateVariableChange((*m_variableView.GetDatum()), m_variableId))); - } - - Slot* resultSlot = GetSlot(m_variableDataOutSlotId); - if (resultSlot && m_variableView.IsValid()) - { - const Datum* variableDatum = m_variableView.GetDatum(); - - PushOutput((*variableDatum), *resultSlot); - - // Push the data for each property slot out as well - for (auto&& propertyAccount : m_propertyAccounts) - { - Slot* propertySlot = GetSlot(propertyAccount.m_propertySlotId); - if (propertySlot && propertyAccount.m_getterFunction) - { - auto outputOutcome = propertyAccount.m_getterFunction((*variableDatum)); - - if (!outputOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), outputOutcome.TakeError().data()); - return; - } - PushOutput(outputOutcome.TakeValue(), *propertySlot); - } - } - } - - SignalOutput(GetSlotId(GetOutputSlotName())); - } - } VariableId SetVariableNode::GetVariableIdRead(const Slot*) const { return m_variableId; @@ -283,7 +242,8 @@ namespace ScriptCanvas ScriptCanvas::Data::Type baseType = ScriptCanvas::Data::Type::Invalid(); VariableRequestBus::EventResult(baseType, GetScopedVariableId(), &VariableRequests::GetType); - const AZStd::unordered_map* variableMap = GetRuntimeBus()->GetVariables(); + const GraphVariableMapping* variableMap = nullptr; + GraphRequestBus::EventResult(variableMap, *GraphNotificationBus::GetCurrentBusId(), &GraphRequests::GetVariables); if (variableMap && baseType.IsValid()) { @@ -319,12 +279,6 @@ namespace ScriptCanvas VariableNodeNotificationBus::Event(GetEntityId(), &VariableNodeNotifications::OnVariableRemovedFromNode, removedVariableId); } - AnnotateNodeSignal SetVariableNode::CreateAnnotationData() - { - AZ::EntityId assetNodeId = GetRuntimeBus()->FindAssetNodeIdByRuntimeNodeId(GetEntityId()); - return AnnotateNodeSignal(CreateGraphInfo(GetOwningScriptCanvasId(), GetGraphIdentifier()), AnnotateNodeSignal::AnnotationLevel::Info, m_variableName, AZ::NamedEntityId(assetNodeId, GetNodeName())); - } - void SetVariableNode::AddPropertySlots(const Data::Type& type) { Data::GetterContainer getterFunctions = Data::ExplodeToGetters(type); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h index bc97fa6a08..b985cabfa8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h @@ -67,8 +67,7 @@ namespace ScriptCanvas void OnInit() override; void OnPostActivate() override; - void OnInputSignal(const SlotId&) override; - + void AddSlots(); void RemoveSlots(); void AddPropertySlots(const Data::Type& type); @@ -86,8 +85,6 @@ namespace ScriptCanvas void OnVariableRemoved() override; //// - AnnotateNodeSignal CreateAnnotationData(); - VariableId m_variableId; SlotId m_variableDataInSlotId; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.cpp deleted file mode 100644 index 66dfe424c5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.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 "Start.h" - -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Core - { - void Start::OnInputSignal(const SlotId&) - { - SignalOutput(StartProperty::GetOutSlotId(this)); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.h index bc5ca997e8..f4ba99746a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Start.h @@ -25,11 +25,6 @@ namespace ScriptCanvas public: SCRIPTCANVAS_NODE(Start); - - - - void OnInputSignal(const SlotId&) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/And.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/And.h index fa553036f5..f33c6acde4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/And.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/And.h @@ -52,11 +52,6 @@ namespace ScriptCanvas ////////////////////////////////////////////////////////////////////////// protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - return Datum(*lhs.GetAs() && *rhs.GetAs()); - } - void InitializeBooleanExpression() override { { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp index 29fd8a5075..465c336815 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp @@ -60,12 +60,6 @@ namespace ScriptCanvas RegisterExtension(visualExtensions); } } - - void Any::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const SlotId outSlotId = AnyProperty::GetOutSlotId(this); - SignalOutput(outSlotId); - } SlotId Any::HandleExtension(AZ::Crc32 extensionId) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h index aca5b2bb51..9fd676c22a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h @@ -44,8 +44,6 @@ namespace ScriptCanvas void OnInit() override; void ConfigureVisualExtensions() override; - void OnInputSignal(const SlotId& slot) override; - SlotId HandleExtension(AZ::Crc32 extensionId) override; bool CanDeleteSlot(const SlotId& slotId) const override; @@ -54,9 +52,7 @@ namespace ScriptCanvas //// /// Translation - bool IsNoOp() const override; - - + bool IsNoOp() const override; AZ::Outcome GetDependencies() const override; @@ -69,9 +65,7 @@ namespace ScriptCanvas AZ::Crc32 GetInputExtensionId() const { return AZ_CRC("Output", 0xccde149e); } private: - AZStd::string GenerateInputName(int counter); - SlotId AddInputSlot(); void FixupStateNames(); }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.cpp index a5a75e259c..1149c19230 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.cpp @@ -98,26 +98,6 @@ namespace ScriptCanvas return AddSlot(executionConfiguration); } - void Cycle::OnInputSignal(const SlotId& slot) - { - if (slot != CycleProperty::GetInSlotId(this)) - { - return; - } - - if (!m_orderedOutputSlots.empty()) - { - const SlotId& slotId = m_orderedOutputSlots[m_executionSlot]; - SignalOutput(slotId); - - if (++m_executionSlot >= m_orderedOutputSlots.size()) - { - m_executionSlot = 0; - } - } - - } - void Cycle::OnSlotRemoved([[maybe_unused]] const SlotId& slotId) { FixupStateNames(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h index c275b8031c..2d26a1f816 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h @@ -43,13 +43,9 @@ namespace ScriptCanvas ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override; - - protected: AZStd::string GetDisplayGroup() const { return "OutputGroup"; } - - void OnInputSignal(const SlotId& slot) override; void OnSlotRemoved(const SlotId& slotId) override; private: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.cpp deleted file mode 100644 index 85898ad042..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.cpp +++ /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 - * - */ - -#include "Indexer.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Logic - { - void Indexer::OnInputSignal(const SlotId& slotId) - { - auto slotIndex = FindSlotIndex(slotId); - if (slotIndex < 0) - { - AZ_Warning("Script Canvas", false, "Could not find slot with id %s", slotId.ToString().c_str()); - return; - } - - const Datum output(slotIndex); - - const SlotId outSlotId = IndexerProperty::GetOutSlotId(this); - if (auto outSlot = GetSlot(outSlotId)) - { - PushOutput(output, *outSlot); - } - - SignalOutput(outSlotId); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.h index bea41a4e14..6a6d335a87 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Indexer.h @@ -21,16 +21,8 @@ namespace ScriptCanvas class Indexer : public Node { - public: - SCRIPTCANVAS_NODE(Indexer); - - Indexer() = default; - - protected: - - void OnInputSignal(const SlotId& slot) override; }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp index 480d51643b..85cefcf5aa 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp @@ -61,13 +61,6 @@ namespace ScriptCanvas AddSlot(slotConfiguration); } } - - void IsNull::OnInputSignal(const SlotId&) - { - const bool isNull = FindDatum(GetSlotId("Reference"))->Empty(); - PushOutput(Datum(isNull), *GetSlot(GetSlotId("Is Null"))); - SignalOutput(isNull ? IsNullProperty::GetTrueSlotId(this) : IsNullProperty::GetFalseSlotId(this)); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.h index 12f996003c..36d608191f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.h @@ -34,8 +34,6 @@ namespace ScriptCanvas bool IsIfBranchPrefacedWithBooleanExpression() const override; - - protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot*) const override { @@ -43,9 +41,6 @@ namespace ScriptCanvas } void OnInit() override; - - void OnInputSignal(const SlotId&) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.cpp deleted file mode 100644 index c8af5ae7a4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.cpp +++ /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 - * - */ - -#include "Multiplexer.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Logic - { - Multiplexer::Multiplexer() - {} - - void Multiplexer::OnInputSignal(const SlotId& slotId) - { - auto slotIndex = FindSlotIndex(slotId); - if (!slotIndex) - { - AZ_Warning("Script Canvas", false, "Could not find slot with Id %s", slotId.ToString().c_str()); - return; - } - - // These are generated from CodeGen, they essentially - // check if there's anything connected on the slot and - // they assign the local member with the value, otherwise - // they use the default property value. - const AZ::s64 selectedIndex = MultiplexerProperty::GetIndex(this); - - if (selectedIndex == slotIndex) - { - const SlotId outSlotId = MultiplexerProperty::GetOutSlotId(this); - SignalOutput(outSlotId); - } - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.h index 00a974ab8a..e6df414398 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Multiplexer.h @@ -26,12 +26,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(Multiplexer); - Multiplexer(); - - protected: - - void OnInputSignal(const SlotId& slot) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Or.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Or.h index 6868dc6e6b..315d254d50 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Or.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Or.h @@ -50,11 +50,6 @@ namespace ScriptCanvas ////////////////////////////////////////////////////////////////////////// protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - return Datum(*lhs.GetAs() || *rhs.GetAs()); - } - void InitializeBooleanExpression() override { { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp index 75693f994c..ca32a5eb5a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp @@ -107,50 +107,6 @@ namespace ScriptCanvas } } - void Sequencer::OnInputSignal(const SlotId& slot) - { - m_selectedIndex = SequencerProperty::GetIndex(this); - m_order = SequencerProperty::GetOrder(this); - - const SlotId inSlot = SequencerProperty::GetInSlotId(this); - const SlotId nextSlot = SequencerProperty::GetNextSlotId(this); - - if (slot == inSlot) - { - m_currentIndex = m_selectedIndex; - } - else if (slot == nextSlot) - { - int step = m_order == Order::Forward ? 1 : -1; - - m_outputIsValid = false; - int startIndex = m_currentIndex; - while (!m_outputIsValid) - { - m_currentIndex = (m_currentIndex + step + NUMBER_OF_OUTPUTS) % NUMBER_OF_OUTPUTS; - SlotId outSlotId = GetCurrentSlotId(); - Slot* outSlot = GetSlot(outSlotId); - if (outSlot) - { - m_outputIsValid = !GetConnectedNodes(*outSlot).empty(); - } - - //Avoid infinite loop when none of the outputs or only the current output connects to other nodes. - if (m_currentIndex == startIndex) - { - m_outputIsValid = false; - break; - } - } - } - - if (m_outputIsValid) - { - SlotId outSlotId = GetCurrentSlotId(); - SignalOutput(outSlotId); - } - } - SlotId Sequencer::GetCurrentSlotId() const { AZStd::string slotName = "Out" + AZStd::to_string(m_currentIndex); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.h index 347d21baa2..a4fe3f358d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.h @@ -43,10 +43,6 @@ namespace ScriptCanvas int m_order; int m_selectedIndex; - protected: - - void OnInputSignal(const SlotId& slot) override; - private: int m_currentIndex; bool m_outputIsValid; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp index ec55784a33..445c91e1fc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp @@ -71,31 +71,6 @@ namespace ScriptCanvas return AddSlot(executionConfiguration); } - void TargetedSequencer::OnInputSignal(const SlotId& slot) - { - if (slot != TargetedSequencerProperty::GetInSlotId(this)) - { - return; - } - - int targetIndex = TargetedSequencerProperty::GetIndex(this); - - if (targetIndex < 0 - || targetIndex >= m_numOutputs) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Switch node was given an out of bound index."); - return; - } - - AZStd::string slotName = GenerateOutputName(targetIndex); - SlotId outSlotId = GetSlotId(slotName.c_str()); - - if (outSlotId.IsValid()) - { - SignalOutput(outSlotId); - } - } - void TargetedSequencer::OnSlotRemoved([[maybe_unused]] const SlotId& slotId) { FixupStateNames(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h index 7f50fbeb11..68bf1601f7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h @@ -54,7 +54,6 @@ namespace ScriptCanvas AZStd::string GetDisplayGroup() const { return "OutputGroup"; } - void OnInputSignal(const SlotId& slot) override; void OnSlotRemoved(const SlotId& slotId) override; private: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp index 80646e66a1..21b2ead10e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp @@ -131,63 +131,6 @@ namespace ScriptCanvas return isValid; } - void WeightedRandomSequencer::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = WeightedRandomSequencerProperty::GetInSlotId(this); - - if (slotId == inSlotId) - { - int runningTotal = 0; - - AZStd::vector< WeightedStruct > weightedStructs; - weightedStructs.reserve(m_weightedPairings.size()); - - for (const WeightedPairing& weightedPairing : m_weightedPairings) - { - const Datum* datum = FindDatum(weightedPairing.m_weightSlotId); - - if (datum) - { - WeightedStruct weightedStruct; - weightedStruct.m_executionSlotId = weightedPairing.m_executionSlotId; - - if (datum->GetType().IS_A(ScriptCanvas::Data::Type::Number())) - { - int weight = aznumeric_cast((*datum->GetAs())); - - runningTotal += weight; - weightedStruct.m_totalWeight = runningTotal; - } - - weightedStructs.emplace_back(weightedStruct); - } - } - - // We have no weights. So just trigger the first execution output - // Weighted pairings is controlled to never be empty. - if (runningTotal == 0) - { - if (!m_weightedPairings.empty()) - { - SignalOutput(m_weightedPairings.front().m_executionSlotId); - } - - return; - } - - int weightedResult = MathNodeUtilities::GetRandomIntegral(1, runningTotal); - - for (const WeightedStruct& weightedStruct : weightedStructs) - { - if (weightedResult <= weightedStruct.m_totalWeight) - { - SignalOutput(weightedStruct.m_executionSlotId); - break; - } - } - } - } - SlotId WeightedRandomSequencer::HandleExtension(AZ::Crc32 extensionId) { auto weightedPairing = AddWeightedPair(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h index f58f89690d..d8be2a95c6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h @@ -22,9 +22,7 @@ namespace ScriptCanvas class WeightedRandomSequencer : public Node { - public: - SCRIPTCANVAS_NODE(WeightedRandomSequencer); static void ReflectDataTypes(AZ::ReflectContext* reflectContext); @@ -42,11 +40,7 @@ namespace ScriptCanvas bool OnValidateNode(ValidationResults& validationResults); - void OnInputSignal(const SlotId& slot); - - SlotId HandleExtension(AZ::Crc32 extensionId) override; - - + SlotId HandleExtension(AZ::Crc32 extensionId) override; bool CanDeleteSlot(const SlotId& slotId) const override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Divide.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Divide.h index 7320fff037..fad147241a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Divide.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Divide.h @@ -51,21 +51,6 @@ namespace ScriptCanvas nodeConfig.m_type = AZ::Uuid("DC17E19F-3829-410D-9A0B-AD60C6066DAA"); return nodeConfig; } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - const Data::NumberType lhsValue = *lhs.GetAs(); - const Data::NumberType rhsValue = *rhs.GetAs(); - - if (AZ::IsClose(rhsValue, 0.0, 0.0001)) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Divide by zero"); - return Datum(); - } - - return Datum(lhsValue / rhsValue); - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Multiply.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Multiply.h index c0761502c0..76ccf3cd96 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Multiply.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Multiply.h @@ -50,12 +50,6 @@ namespace ScriptCanvas nodeConfig.m_type = AZ::Uuid("E9BB45A1-AE96-47B0-B2BF-2927D420A28C"); return nodeConfig; } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - return Datum(*lhs.GetAs() * *rhs.GetAs()); - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Subtract.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Subtract.h index ecffc724cc..65563bec0b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Subtract.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Subtract.h @@ -50,12 +50,6 @@ namespace ScriptCanvas nodeConfig.m_type = AZ::Uuid("D0615D0A-027F-47F6-A02B-E35DAF22F431"); return nodeConfig; } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - return Datum(*lhs.GetAs() - *rhs.GetAs()); - } }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h index ed53b66878..bcff3378c9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h @@ -52,12 +52,6 @@ namespace ScriptCanvas nodeConfig.m_type = AZ::Uuid("C1B42FEC-0545-4511-9FAC-11E0387FEDF0"); return nodeConfig; } - - protected: - Datum Evaluate(const Datum& lhs, const Datum& rhs) override - { - return Datum(*lhs.GetAs() + *rhs.GetAs()); - } }; } } 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 6b5b2770de..ed676034d8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp @@ -91,70 +91,6 @@ namespace ScriptCanvas } } } - - void OperatorAt::KeyNotFound(const Datum* containerDatum) - { - Datum defaultDatum; - AZStd::vector types = ScriptCanvas::Data::GetContainedTypes(GetSourceAZType()); - - int index = Data::IsMapContainerType(containerDatum->GetType()) ? 1 : 0; - - Data::Type type = Data::FromAZType(types[index]); - defaultDatum.SetType(type); - - PushOutput(defaultDatum, *GetSlot(*m_outputSlots.begin())); - SignalOutput(GetSlotId("Key Not Found")); - } - - void OperatorAt::InvokeOperator() - { - Slot* inputSlot = GetFirstInputSourceSlot(); - - if (inputSlot) - { - SlotId sourceSlotId = inputSlot->GetId(); - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - const Datum* inputKeyDatum = FindDatum(*m_inputSlots.begin()); - AZ::Outcome valueOutcome = BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(*containerDatum, "At", *inputKeyDatum); - if (!valueOutcome.IsSuccess()) - { - KeyNotFound(containerDatum); - return; - } - - if (Data::IsVectorContainerType(containerDatum->GetType())) - { - PushOutput(valueOutcome.TakeValue(), *GetSlot(*m_outputSlots.begin())); - SignalOutput(GetSlotId("Out")); - } - else if (Data::IsSetContainerType(containerDatum->GetType()) || Data::IsMapContainerType(containerDatum->GetType())) - { - Datum keyDatum = valueOutcome.TakeValue(); - if (keyDatum.Empty()) - { - KeyNotFound(containerDatum); - } - else - { - PushOutput(keyDatum, *GetSlot(*m_outputSlots.begin())); - SignalOutput(GetSlotId("Out")); - } - } - } - } - } - - void OperatorAt::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.h index e20de1a02b..ceae2211a0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.h @@ -36,9 +36,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; - void InvokeOperator(); - void KeyNotFound(const Datum* containerDatum); }; } 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 99607c37f3..dcfe5fed56 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp @@ -48,43 +48,6 @@ namespace ScriptCanvas } } - void OperatorBack::InvokeOperator() - { - const SlotSet& slotSets = GetSourceSlots(); - - if (!slotSets.empty()) - { - SlotId sourceSlotId = (*slotSets.begin()); - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - const Datum* inputKeyDatum = FindDatum(*m_inputSlots.begin()); - AZ::Outcome valueOutcome = BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(*containerDatum, "Back", *inputKeyDatum); - if (!valueOutcome.IsSuccess()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to call Back on container: %s", valueOutcome.GetError().c_str()); - return; - } - - if (Data::IsVectorContainerType(containerDatum->GetType())) - { - PushOutput(valueOutcome.TakeValue(), *GetSlot(*m_outputSlots.begin())); - } - } - } - - SignalOutput(GetSlotId("Out")); - } - - void OperatorBack::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h index 41c4b2cbc1..2b6746156d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h @@ -35,7 +35,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; void InvokeOperator(); }; 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 36890c9720..38118ed8c1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp @@ -67,36 +67,6 @@ namespace ScriptCanvas } //// } - - void OperatorClear::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - - if (slotId != inSlotId) - { - return; - } - - SlotId sourceSlotId = OperatorClearProperty::GetSourceSlotId(this); - - if (const Datum* containerDatum = FindDatum(sourceSlotId)) - { - if (Datum::IsValidDatum(containerDatum)) - { - AZ::Outcome clearOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(*containerDatum, "Clear"); - if (!clearOutcome.IsSuccess()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to call Clear on container: %s", clearOutcome.GetError().c_str()); - return; - } - - // Push the source container as an output to support chaining - PushOutput(*containerDatum, *OperatorClearProperty::GetContainerSlot(this)); - } - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.h index a0ccad1379..2b7e24682f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.h @@ -41,10 +41,6 @@ namespace ScriptCanvas OperatorClear() = default; void OnInit() override; - - protected: - - void OnInputSignal(const SlotId& slotId) override; }; } 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 71ee545397..e62b671268 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp @@ -70,49 +70,6 @@ namespace ScriptCanvas } //// } - - void OperatorEmpty::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorEmptyProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - SlotId sourceSlotId = OperatorEmptyProperty::GetSourceSlotId(this); - - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - // Is the container empty? - auto emptyOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(*containerDatum, "Empty"); - if (!emptyOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to call Empty on container: %s", emptyOutcome.GetError().c_str()); - return; - } - - Datum emptyResult = emptyOutcome.TakeValue(); - bool isEmpty = *emptyResult.GetAs(); - - PushOutput(Datum(isEmpty), *GetSlot(OperatorEmptyProperty::GetIsEmptySlotId(this))); - - if (isEmpty) - { - SignalOutput(OperatorEmptyProperty::GetTrueSlotId(this)); - } - else - { - SignalOutput(OperatorEmptyProperty::GetFalseSlotId(this)); - } - } - else - { - PushOutput(Datum(true), *GetSlot(OperatorEmptyProperty::GetIsEmptySlotId(this))); - SignalOutput(OperatorEmptyProperty::GetFalseSlotId(this)); - } - - SignalOutput(OperatorEmptyProperty::GetOutSlotId(this)); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.h index 5cc26c126e..148142d3c8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.h @@ -21,22 +21,15 @@ namespace ScriptCanvas class OperatorEmpty : public Node { public: - SCRIPTCANVAS_NODE(OperatorEmpty); - void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; static bool OperatorEmptyVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); OperatorEmpty() = default; - // Node... void OnInit() override; - //// - - void OnInputSignal(const SlotId& slotId) override; - }; } } 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 15328b42fb..92c753c5b8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp @@ -95,47 +95,6 @@ namespace ScriptCanvas } } - void OperatorErase::InvokeOperator() - { - Slot* inputSlot = GetFirstInputSourceSlot(); - Slot* outputSlot = GetFirstOutputSourceSlot(); - - if (inputSlot && outputSlot) - { - SlotId sourceSlotId = inputSlot->GetId(); - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - const Datum* inputKeyDatum = FindDatum(*m_inputSlots.begin()); - AZ::Outcome valueOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(*containerDatum, "Erase", *inputKeyDatum); - - if (valueOutcome.IsSuccess()) - { - // Push the source container as an output to support chaining - PushOutput(*containerDatum, (*outputSlot)); - - auto outcomeInnerResult = valueOutcome.GetValue().GetAs< AZ::Outcome>(); - if (outcomeInnerResult && !outcomeInnerResult->IsSuccess()) - { - SignalOutput(GetSlotId("Element Not Found")); - return; - } - } - } - } - - SignalOutput(GetSlotId("Out")); - } - - void OperatorErase::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.h index dc5d8c4c0c..95ddfcb275 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.h @@ -39,8 +39,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; - void InvokeOperator(); private: bool m_missedElementNotFound = false; 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 794ee8aeb0..bd97e4cd4e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp @@ -46,43 +46,6 @@ namespace ScriptCanvas } } - void OperatorFront::InvokeOperator() - { - const SlotSet& slotSets = GetSourceSlots(); - - if (!slotSets.empty()) - { - SlotId sourceSlotId = (*slotSets.begin()); - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - const Datum* inputKeyDatum = FindDatum(*m_inputSlots.begin()); - AZ::Outcome valueOutcome = BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(*containerDatum, "Front", *inputKeyDatum); - if (!valueOutcome.IsSuccess()) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to call Front on container: %s", valueOutcome.GetError().c_str()); - return; - } - - if (Data::IsVectorContainerType(containerDatum->GetType())) - { - PushOutput(valueOutcome.TakeValue(), *GetSlot(*m_outputSlots.begin())); - } - } - } - - SignalOutput(GetSlotId("Out")); - } - - void OperatorFront::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h index cb41f6a479..f28c46e0f8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h @@ -35,7 +35,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; void InvokeOperator(); }; 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 bce98a6776..9af3f183b1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp @@ -84,108 +84,6 @@ namespace ScriptCanvas } } - void OperatorInsert::InvokeOperator() - { - Slot* inputSlot = GetFirstInputSourceSlot(); - Slot* outputSlot = GetFirstOutputSourceSlot(); - - if (inputSlot && outputSlot) - { - SlotId sourceSlotId = inputSlot->GetId(); - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - AZ::BehaviorMethod* method = GetOperatorMethod("Insert"); - AZ_Assert(method, "The contract must have failed because you should not be able to invoke an operator for a type that does not have the method"); - - AZStd::array params; - - AZ::BehaviorValueParameter* paramFirst(params.begin()); - AZ::BehaviorValueParameter* paramIter = paramFirst; - - if (Data::IsVectorContainerType(GetSourceAZType())) - { - // Container - auto behaviorParameter = method->GetArgument(0); - AZ::Outcome param0 = containerDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param0.GetValue()); - ++paramIter; - - // Get the size of the container - auto sizeOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(*containerDatum, "Size"); - if (!sizeOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get size of container: %s", sizeOutcome.GetError().c_str()); - return; - } - - auto inputSlotIterator = m_inputSlots.begin(); - - // Index - behaviorParameter = method->GetArgument(1); - const Datum* indexDatum = FindDatum(*inputSlotIterator); - AZ::Outcome param2 = indexDatum->ToBehaviorValueParameter(*behaviorParameter); - - paramIter->Set(param2.GetValue()); - ++paramIter; - - // Value to insert - behaviorParameter = method->GetArgument(2); - ++inputSlotIterator; - const Datum* inputDatum = FindDatum(*inputSlotIterator); - AZ::Outcome param1 = inputDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param1.GetValue()); - ++paramIter; - } - else if (Data::IsMapContainerType(GetSourceAZType())) - { - auto inputSlotIterator = m_inputSlots.begin(); - const Datum* keyDatum = FindDatum(*inputSlotIterator++); - const Datum* valueDatum = FindDatum(*inputSlotIterator); - - if (keyDatum && valueDatum) - { - // Container - const AZ::BehaviorParameter* behaviorParameter = method->GetArgument(0); - AZ::Outcome param0 = containerDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param0.GetValue()); - ++paramIter; - - // Key - behaviorParameter = method->GetArgument(1); - AZ::Outcome param1 = keyDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param1.GetValue()); - ++paramIter; - - // Value to insert - behaviorParameter = method->GetArgument(2); - AZ::Outcome param2 = valueDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param2.GetValue()); - ++paramIter; - } - } - - AZStd::vector resultSlotIDs; - resultSlotIDs.push_back(); - BehaviorContextMethodHelper::Call(*this, false, method, paramFirst, paramIter, resultSlotIDs); - - // Push the source container as an output to support chaining - PushOutput(*containerDatum, (*outputSlot)); - } - } - - SignalOutput(GetSlotId("Out")); - } - - void OperatorInsert::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.h index 970c8ab780..0fda9b0654 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.h @@ -33,9 +33,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; - void InvokeOperator(); - }; } } 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 e449d04d34..cf8eb306c4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp @@ -42,73 +42,6 @@ namespace ScriptCanvas m_inputSlots.insert(AddSlot(slotConfiguration)); } } - - void OperatorPushBack::InvokeOperator() - { - Slot* inputSlot = GetFirstInputSourceSlot(); - Slot* outputSlot = GetFirstOutputSourceSlot(); - - if (inputSlot && outputSlot) - { - const Datum* containerDatum = FindDatum(inputSlot->GetId()); - - if (Datum::IsValidDatum(containerDatum)) - { - AZ::BehaviorMethod* method = GetOperatorMethod("PushBack"); - AZ_Assert(method, "The contract must have failed because you should not be able to invoke an operator for a type that does not have the method"); - - AZStd::array params; - - AZ::BehaviorValueParameter* paramFirst(params.begin()); - AZ::BehaviorValueParameter* paramIter = paramFirst; - - if (Data::IsVectorContainerType(GetSourceAZType())) - { - // Container - auto behaviorParameter = method->GetArgument(0); - - AZ::Outcome param0 = containerDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param0.GetValue()); - ++paramIter; - - const auto& inputSlotIterator = m_inputSlots.begin(); - - // Value to push - behaviorParameter = method->GetArgument(1); - const Datum* inputDatum = FindDatum(*inputSlotIterator); - AZ_Assert(inputDatum, "Unable to GetInput for Input slot Id"); - if (inputDatum) - { - AZ::Outcome param1 = inputDatum->ToBehaviorValueParameter(*behaviorParameter); - paramIter->Set(param1.GetValue()); - ++paramIter; - } - } - else if (Data::IsMapContainerType(GetSourceAZType())) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "PushBack is not a supported operation on maps"); - return; - } - - AZStd::vector resultSlotIDs; - resultSlotIDs.push_back(); - BehaviorContextMethodHelper::Call(*this, false, method, paramFirst, paramIter, resultSlotIDs); - - PushOutput(*containerDatum, (*outputSlot)); - } - } - - SignalOutput(GetSlotId("Out")); - } - - void OperatorPushBack::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorBaseProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - InvokeOperator(); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.h index 695d6a6f93..5f74dd9dc9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.h @@ -32,9 +32,6 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void OnInputSignal(const SlotId& slotId) override; - void InvokeOperator(); - }; } } 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 29c5e61a21..40fbe6f54b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp @@ -85,42 +85,6 @@ namespace ScriptCanvas } //// } - - void OperatorSize::OnInputSignal(const SlotId& slotId) - { - const SlotId inSlotId = OperatorSizeProperty::GetInSlotId(this); - if (slotId == inSlotId) - { - - SlotId sourceSlotId = OperatorSizeProperty::GetSourceSlotId(this); - SlotId sizeSlotId = OperatorSizeProperty::GetSizeSlotId(this); - - const Datum* containerDatum = FindDatum(sourceSlotId); - - if (Datum::IsValidDatum(containerDatum)) - { - // Get the size of the container - auto sizeOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(*containerDatum, "Size"); - if (!sizeOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get size of container: %s", sizeOutcome.GetError().c_str()); - return; - } - - // Index - Datum sizeResult = sizeOutcome.TakeValue(); - - PushOutput(sizeResult, *GetSlot(sizeSlotId)); - } - else - { - Datum zero(0); - PushOutput(zero, *GetSlot(sizeSlotId)); - } - - SignalOutput(OperatorSizeProperty::GetOutSlotId(this)); - } - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h index 3199b09ebd..71c89c75e9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h @@ -33,9 +33,6 @@ namespace ScriptCanvas // Node... void OnInit() override; //// - - void OnInputSignal(const SlotId& slotId) override; - }; } } 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 7d6fb74768..376a6154a9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp @@ -55,68 +55,6 @@ namespace ScriptCanvas } } - void OperatorArithmetic::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - - if (!m_scrapedInputs) - { - m_scrapedInputs = true; - - AZStd::vector< Slot* > groupedSlots = GetSlotsWithDynamicGroup(GetArithmeticDynamicTypeGroup()); - - SlotId fallbackId; - - for (Slot* groupedSlot : groupedSlots) - { - if (groupedSlot->IsInput()) - { - SlotId groupedSlotId = groupedSlot->GetId(); - - if (!fallbackId.IsValid()) - { - fallbackId = groupedSlotId; - } - - if ((groupedSlot->IsVariableReference() && groupedSlot->GetVariableReference().IsValid()) || IsConnected(groupedSlotId) || IsValidArithmeticSlot(groupedSlotId)) - { - const Datum* inputDatum = groupedSlot->FindDatum(); - - if (inputDatum && inputDatum->GetType().IsValid() && inputDatum->GetType().GetType() != Data::eType::BehaviorContextObject) - { - m_applicableInputs.emplace_back(inputDatum); - } - } - } - else if (groupedSlot->IsOutput()) - { - m_resultSlot = groupedSlot; - } - - m_outSlot = GetSlotByName("Out")->GetId(); - } - - // If none of our inputs are valid input slots. Just use the first one we found to fall into a default use case. - if (m_applicableInputs.empty()) - { - const Datum* inputDatum = FindDatum(fallbackId); - - if (inputDatum && inputDatum->GetType().IsValid()) - { - m_applicableInputs.emplace_back(inputDatum); - } - } - - if (!m_applicableInputs.empty()) - { - const Datum* datum = m_applicableInputs.front(); - m_result.SetType(datum->GetType()); - } - } - - InvokeOperator(); - } - void OperatorArithmetic::OnConfigured() { auto slotList = GetSlotsWithDynamicGroup(GetArithmeticDynamicTypeGroup()); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h index 716c9111af..4fcd6a1905 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h @@ -85,8 +85,7 @@ namespace ScriptCanvas // Node void OnSlotDisplayTypeChanged(const SlotId& slotId, const Data::Type& dataType) override final; void OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) override final; - void OnInputSignal(const SlotId& slotId) override; - + void OnConfigured() override; void OnInit() override; void OnActivate() override; 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 27a8e5f846..9ba4a7f4ae 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp @@ -104,98 +104,6 @@ namespace ScriptCanvas } } - void OperatorDivideByNumber::OnInputSignal(const SlotId& slotId) - { - if (slotId != OperatorDivideByNumberProperty::GetInSlotId(this)) - { - return; - } - - Data::Type type = GetDisplayType(AZ::Crc32("DivideGroup")); - - if (!type.IsValid()) - { - return; - } - - const Datum* operand = FindDatum(m_operandId); - - if (operand == nullptr) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Operand is nullptr"); - return; - } - - const float divisorValue = aznumeric_cast(OperatorDivideByNumberProperty::GetDivisor(this)); - - if (AZ::IsClose(divisorValue, 0.f, std::numeric_limits::epsilon())) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Division by zero"); - return; - } - - Datum result; - - switch (type.GetType()) - { - case Data::eType::Number: - { - const Data::NumberType* number = operand->GetAs(); - Data::NumberType resultValue = (*number) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Vector2: - { - const Data::Vector2Type* vector = operand->GetAs(); - AZ::Vector2 resultValue = (*vector) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Vector3: - { - const Data::Vector3Type* vector = operand->GetAs(); - AZ::Vector3 resultValue = (*vector) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Vector4: - { - const Data::Vector4Type* vector = operand->GetAs(); - AZ::Vector4 resultValue = (*vector) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Quaternion: - { - const Data::QuaternionType* quaternion = operand->GetAs(); - Data::QuaternionType resultValue = (*quaternion) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Matrix3x3: - { - const Data::Matrix3x3Type* matrix = operand->GetAs(); - Data::Matrix3x3Type resultValue = (*matrix) / divisorValue; - result = Datum(resultValue); - } - break; - case Data::eType::Color: - { - const Data::ColorType *color = operand->GetAs(); - Data::ColorType resultValue = (*color) / divisorValue; - result = Datum(resultValue); - } - break; - default: - result = Datum(); - AZ_Error("Script Canvas", false, "Divide by Number does not support the provided data type."); - break; - } - - PushOutput(result, (*OperatorDivideByNumberProperty::GetResultSlot(this))); - SignalOutput(OperatorDivideByNumberProperty::GetOutSlotId(this)); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h index 10df09a42e..bb33242ad4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h @@ -42,7 +42,6 @@ namespace ScriptCanvas // Nodes... void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; //// protected: 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 b52b6d8da2..9cde2d7322 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp @@ -70,58 +70,6 @@ namespace ScriptCanvas ConfigureSlots(); } } - - void OperatorLength::OnInputSignal(const SlotId& slotId) - { - if (slotId != OperatorLengthProperty::GetInSlotId(this)) - { - return; - } - - Data::Type type = GetDisplayType(AZ::Crc32("SourceGroup")); - - if (!type.IsValid()) - { - return; - } - - Datum result; - const Datum* operand = FindDatum(OperatorLengthProperty::GetSourceSlotId(this)); - - switch (type.GetType()) - { - case Data::eType::Vector2: - { - const AZ::Vector2* vector = operand->GetAs(); - result = Datum(vector->GetLength()); - } - break; - case Data::eType::Vector3: - { - const AZ::Vector3* vector = operand->GetAs(); - result = Datum(vector->GetLength()); - } - break; - case Data::eType::Vector4: - { - const AZ::Vector4* vector = operand->GetAs(); - result = Datum(vector->GetLength()); - } - break; - case Data::eType::Quaternion: - { - const AZ::Quaternion* vector = operand->GetAs(); - result = Datum(vector->GetLength()); - } - break; - default: - AZ_Assert(false, "Length operator not defined for type: %s", Data::ToAZType(type).ToString().c_str()); - break; - } - - PushOutput(result, (*OperatorLengthProperty::GetLengthSlot(this))); - SignalOutput(OperatorLengthProperty::GetOutSlotId(this)); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.h index f49c384439..188d8c2583 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.h @@ -38,10 +38,7 @@ namespace ScriptCanvas OperatorLength() = default; ~OperatorLength() = default; - // Node... void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - //// }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp index 079073fa64..d5cbadbfee 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp @@ -51,133 +51,10 @@ namespace ScriptCanvas //////// } - void LerpBetween::OnDeactivate() - { - AZ::SystemTickBus::Handler::BusDisconnect(); - AZ::TickBus::Handler::BusDisconnect(); - } - void LerpBetween::OnConfigured() { SetupInternalSlotReferences(); - } - - void LerpBetween::OnSystemTick() - { - // Ping pong between the system and the normal tick bus for a consistent starting point for the lerp - AZ::SystemTickBus::Handler::BusDisconnect(); - AZ::TickBus::Handler::BusConnect(); - } - - void LerpBetween::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint timePoint) - { - bool lerpComplete = false; - - m_counter += deltaTime; - - if (m_counter >= m_duration) - { - lerpComplete = true; - m_counter = m_duration; - } - - float percent = m_counter/m_duration; - - SignalLerpStep(percent); - } - - void LerpBetween::OnInputSignal(const SlotId& slotId) - { - if (slotId == LerpBetweenProperty::GetCancelSlotId(this)) - { - CancelLerp(); - } - else if (slotId == LerpBetweenProperty::GetInSlotId(this)) - { - CancelLerp(); - - AZ::SystemTickBus::Handler::BusConnect(); - - float speedOnlyTime = 0.0; - float maxDuration = 0.0; - - const Datum* durationDatum = FindDatum(m_maximumTimeSlotId); - const Datum* speedDatum = FindDatum(m_speedSlotId); - - if (durationDatum) - { - maxDuration = static_cast((*durationDatum->GetAs())); - } - - Data::Type displayType = GetDisplayType(AZ::Crc32("LerpGroup")); - - if (displayType == Data::Type::Number()) - { - SetupStartStop(displayType); - - if (!m_differenceDatum.GetType().IsValid()) - { - return; - } - - Data::NumberType difference = (*m_differenceDatum.GetAs()); - Data::NumberType speed = (*speedDatum->GetAs()); - - if (AZ::IsClose(speed, 0.0, Data::ToleranceEpsilon())) - { - speedOnlyTime = -1.0f; - } - else - { - speedOnlyTime = fabsf(static_cast(difference)/static_cast(speed)); - } - } - else if (displayType == Data::Type::Vector2()) - { - SetupStartStop(displayType); - speedOnlyTime = CalculateVectorSpeedTime(speedDatum); - } - else if (displayType == Data::Type::Vector3()) - { - SetupStartStop(displayType); - speedOnlyTime = CalculateVectorSpeedTime(speedDatum); - } - else if (displayType == Data::Type::Vector4()) - { - SetupStartStop(displayType); - speedOnlyTime = CalculateVectorSpeedTime(speedDatum); - } - - m_counter = 0; - - if (speedOnlyTime >= 0.0f && maxDuration >= 0.0f) - { - m_duration = AZStd::min(speedOnlyTime, maxDuration); - } - else if (speedOnlyTime >= 0.0f) - { - m_duration = speedOnlyTime; - } - else if (maxDuration >= 0.0f) - { - m_duration = maxDuration; - } - else - { - AZ_Error("ScriptCanvas", false, "Lerp Between not given a valid speed or duration to perofrm the lerp at. Defaulting to 1 second duration"); - m_duration = 1.0; - } - - if (AZ::IsClose(m_duration, 0.0f, AZ::Constants::FloatEpsilon)) - { - CancelLerp(); - - SignalLerpStep(1.0f); - } - - SignalOutput(LerpBetweenProperty::GetOutSlotId(this)); - } - } + } void LerpBetween::SetupInternalSlotReferences() { @@ -189,52 +66,7 @@ namespace ScriptCanvas m_stepSlotId = LerpBetweenProperty::GetStepSlotId(this); m_percentSlotId = LerpBetweenProperty::GetPercentSlotId(this); } - - void LerpBetween::CancelLerp() - { - AZ::SystemTickBus::Handler::BusDisconnect(); - AZ::TickBus::Handler::BusDisconnect(); - } - - void LerpBetween::SignalLerpStep(float percent) - { - Data::Type displayType = GetDisplayType(AZ::Crc32("LerpGroup")); - - Datum stepDatum(displayType, Datum::eOriginality::Original); - stepDatum.SetToDefaultValueOfType(); - - if (displayType == Data::Type::Number()) - { - CalculateLerpStep(percent, stepDatum); - } - else if (displayType == Data::Type::Vector2()) - { - CalculateLerpStep(percent, stepDatum); - } - else if (displayType == Data::Type::Vector3()) - { - CalculateLerpStep(percent, stepDatum); - } - else if (displayType == Data::Type::Vector4()) - { - CalculateLerpStep(percent, stepDatum); - } - - if (AZ::IsClose(percent, 1.0f, AZ::Constants::FloatEpsilon)) - { - SignalOutput(LerpBetweenProperty::GetLerpCompleteSlotId(this)); - AZ::TickBus::Handler::BusDisconnect(); - } - - Datum percentDatum(ScriptCanvas::Data::Type::Number(), Datum::eOriginality::Original); - percentDatum.Set(percent); - - PushOutput(percentDatum, *GetSlot(m_percentSlotId)); - PushOutput(stepDatum, *GetSlot(m_stepSlotId)); - - SignalOutput(LerpBetweenProperty::GetTickSlotId(this)); - } - + bool LerpBetween::IsGroupConnected() const { bool hasConnections = false; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h index cb54f2f236..7b8b7d2143 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h @@ -27,8 +27,6 @@ namespace ScriptCanvas //! Deprecated: see NodeableNodeOverloadedLerp class LerpBetween : public Node - , public AZ::SystemTickBus::Handler - , public AZ::TickBus::Handler { public: @@ -54,98 +52,14 @@ namespace ScriptCanvas ~LerpBetween() override = default; void OnInit() override; - void OnDeactivate() override; void OnConfigured() override; - - // SystemTickBus... - void OnSystemTick() override; - //// - - // TickBus... - void OnTick(float deltaTime, AZ::ScriptTimePoint timePoint) override; - //// - - // Node... - void OnInputSignal(const SlotId& slotId) override; - //// - + private: void SetupInternalSlotReferences(); - - void CancelLerp(); - - void SignalLerpStep(float percent); - bool IsGroupConnected() const; bool IsInGroup(const SlotId& slotId) const; - - template - void CalculateLerpStep(float percent, Datum& stepDatum) - { - const DataType* startValue = m_startDatum.GetAs(); - const DataType* differenceValue = m_differenceDatum.GetAs(); - - if (startValue == nullptr || differenceValue == nullptr) - { - return; - } - - DataType stepValue = (*startValue) + (*differenceValue) * percent; - stepDatum.Set(stepValue); - } - - template - void SetupStartStop(Data::Type displayType) - { - const Datum* startDatum = FindDatum(m_startSlotId); - const Datum* endDatum = FindDatum(m_stopSlotId); - - m_startDatum = (*startDatum); - m_differenceDatum = Datum(displayType, Datum::eOriginality::Original); - - const DataType* startValue = startDatum->GetAs(); - const DataType* endValue = endDatum->GetAs(); - - if (startValue == nullptr || endValue == nullptr) - { - m_differenceDatum.SetToDefaultValueOfType(); - } - else - { - DataType difference = (*endValue) - (*startValue); - m_differenceDatum.Set(difference); - } - } - - template - float CalculateVectorSpeedTime(const Datum* speedDatum) - { - const DataType* dataType = speedDatum->GetAs(); - - float speedLength = 0.0f; - - if (dataType) - { - speedLength = dataType->GetLength(); - } - - if (AZ::IsClose(speedLength, 0.0f, AZ::Constants::FloatEpsilon)) - { - return -1.0; - } - - float differenceLength = 0.0; - const DataType* differenceValue = m_differenceDatum.GetAs(); - - if (differenceValue) - { - differenceLength = differenceValue->GetLength(); - } - - return fabsf(static_cast(differenceLength/speedLength)); - } - + AZStd::unordered_set< SlotId > m_groupedSlotIds; float m_duration; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h index 7401b60d21..9882ff4564 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h @@ -121,13 +121,6 @@ namespace ScriptCanvas virtual void OnSourceConnected([[maybe_unused]] const SlotId& slotId) {} virtual void OnSourceDisconnected([[maybe_unused]] const SlotId& slotId) {} - //! Implements the operator's behavior, the vector of Datums represents the list of operands. - virtual void Evaluate(const OperatorOperands& operands, Datum& result) - { - AZ_UNUSED(operands); - AZ_UNUSED(result); - } - private: OperatorConfiguration m_operatorConfiguration; @@ -180,32 +173,6 @@ namespace ScriptCanvas } } }; - - // Base class for an small helper object that wraps the function to invoke - class OperationHelper - { - public: - - Datum operator()(const AZStd::vector& operands, Datum& result) - { - AZStd::vector::const_iterator operand = operands.begin(); - result = *operand; - for (++operand; operand != operands.end(); ++operand) - { - result = Operator(result, *operand); - } - - return result; - } - - protected: - virtual Datum Operator(const Datum&, const Datum&) = 0; - }; - -// Helper macro to invoke an operator function for a specialized type -#define CallOperatorFunction(Operator, DataType, Type) \ - if (DataType == Data::FromAZType(azrtti_typeid())) { Operator operation; operation(operands, result); } - } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json new file mode 100644 index 0000000000..0cf5ea5033 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": "No Configurations" +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db new file mode 100644 index 0000000000000000000000000000000000000000..0bd6c3064248f7d9a078ec2376c1505aa698394f GIT binary patch literal 294912 zcmeFa2S8L;+CF~owA=5c2%{o8fCwWURIDL1l_;oyF(z)v2qR2{fy@k+Bqm~dZ<}W7 zruW`^*_6#@lT9{#({?w#_rA&hJ@2{GLGb@`^L=0Tka(W=p8B5Wo^sE7&pp$&VyQ3W zb*<|U^m#(ADlUbySh(F?E{@{___rATh5sr+u!S!G`51X5QQ%5vxa<&WF}@*jDvTeE zZ?snRX63KyHYKEt7hB}_g%5@8!W72@`z7`XwgW6L+ZI}mu~Zn}jg%?#{~u&vPp89K z;pBrpf0uWYZ&SxQU#~aV(d+fB>+pN}ym&djzO}Koz0uXw($Kh;&DS&IuJ7Dm#! zTQVKa0w>>x`3@dn<{Qb*F^AO`tjPNt^(Q59Li4@ocrYSL#x7fdLYoh zzqd2g5%8`Hc69dp*ZI0Td|hxE?C;&+?ZRdi8)w`IO(8bUNcoUP5*yD|7%8wgu0Z#Y zm?k)zLC+%86B==By4VXOG&V3jvH8aaCZ$YNsW2usX6+893eFnP#28kSNCjfj1=Dt@ zLL^C2*^v`d>J5t`-*sYq4KAXntJ`?`v809&RzoJCnYj7fB$4d)S4oRN5!W8=hRUWgfb zG>5Y~i$63m!!UWiE;G44Qnt~Uv6)AG-A9a91ZP$jf2@Fw#>~$IHLj_co?{t$&8RRa z#1Fnbo?uU6%ZlFV9gpZR%!RX!>L1(UOy3ck9HBIR6ouKKzrPp8{0?8x>koQCU#~yp zTjzs8m<+eYE>O6mufJ;$W=xnl{F`H^n_`!DQ)lmBm$zfU6B?#kRND@pe+-e<1wgrt z{ekski{3vF^7Z?J!%*4l36UqmQL-5bM;mLokpv@_YzA~d>11B;2E6`GZ?b~1Z0tC$ zyF_)6o;<=76>bX^rl9RDJDeriJlrDaeej$SZVs`7eNY*pyT?T)T_x;MNakMm-qHwp zlQtEODvy>oHo(}tv6By#34${_o8MLuJ8TETxr%XpFzh>)P8g1x)C-5}2+5Ba#jaqF zC*Xw#kA!ybE)yNj`s|TzOr+R~up|vlatO}0B7SI5_~vx>L$`rvj=qld;1$FX8M+ZX zf6=F%gm7U5Y7?R*WkUzOxT0J*v=+yd<=$qq3(le<{;(Qz42(;VP=+J!ek26a+miSk z7dv;tb7?}FG2NaRb>oMy*t~IsjMF`q(zu}#nND~l94fTpRIsgpHbfeSmK?OjRonE0 z>W)b51B?O20AqkLz!+c*Fa{U{ zJHhb;B24R``zPFT|h@ACZJYf3jn#0?d**3d)AkBt#w+h?g^c}KBDIaZy*R}+=^MHvrEfUE!M28s84x$MKzahSo1T2o^@WR zQU@3U{Gq_0S2jN51mh6Sc*Z!zIK;Tsc-*+ecx$JKW|0{Ki~+^~V}LQh7+?%A1{ed3 z0mcAhfHA-r*dYUHRyQAGkpSC+p5O(B3oXT(&&RIY4H_rbJYg5D89XsO*f1>4B4Aal zS-fcruz)%#v3ZgA|8`>{2dn-~#$scl@$3#2W`T?W#sFi0F~AsL3@`>51B?O20AqkL zz!>B~o8gmzE)RS!+%?^5Yfeu$K(T}9T|Ua6f3UZg{F9AWVf~-S8F|L-#;ITd==+V`Mphlh0AqkLz!+c*Fa{U{ zi~+^~V}LQh7+?&Hje)7wW`2~_bh(2>8qHQUX+*n#H73%C1_AP}f9hz8 zllT8MHi0vqH?D;J|LsP;{-u7OeyYA!uhQ+>Q`#xoa?Ma*R4-RIsr9O^ysq4!Y*X5l zEcpxhkMikqw>)3grB|h^rA^X8DMNfqyhYq5t`PHt&xHqtQ-uA5D#7A-(Q%dIP)Do7 zW&hNEkNpUHyM3zdE8By%<8AxdW1 zW?$a`oToBs+yx{qJ@jg{xK;CQTv2o1x=uLMhHh>G$qFQHvXRjw197`GHGi+QwBrrFdd4lUlyCFqYq$vg0`vwNQU86;ISK2sd zbFdRWM;k3_Q3Y+HsL5!N-Q^_TUe8+Zs4SM15lRN(K-2CHPp{7t94+snQldy`GgQyJ zZnVf{B_#KO{y~3Nhu05he2$i&w3swDGePed;upon4~|M>`E+taY5u--aJt#38Wp>3 zTy`YIX!@5GMl0-FH-_xX3!(}Q1U%h+p3#aZoffTfug^bfmCN#@DtQBe{=jGjlueB$ zz=kneg7Um*9mX~;R^*btYu*O>8R%$*l;seu`aGS1{tjqPqu;o47tx9)faqgjs(1>y z)m`3RZ?`8jDzEOzq?36!z?Y<>>0X?TZHS&fwRyDIC6jF26c`UZz5V1U*wLaFXOYbN zJOg+J+-R{2Cfc}k5_`0WvnJTMiss0Px*eWC_aONqc(imSbfZNtb`tG3z$d@t zoZ?YqXOh_K2K}An%*N4Tmu8TjLdUi)Z|A6EVbwS?1Jn5Apt9fqOhuy=Qk6~;MWT;w z5G_d~Bt;U9Rz_(msmNLnoT`aa*J$x)rI35q?e%*DKJqx>4~7CBm|RCoS7X??`eryu zkQ`A7A4-P>IQtFgfVp|p4D`4R{Qdq8GEc*DAJk7?qaJ6YKvnRAh|n|5D6-C)WQZ*x1It{x6P;Kl=I~%qVa}cV_)Ry~LIs zO)=^tO-zNywEi!QQD|)I|ALq*k7fNoEk>m=t^f055{zm6KQ*QfV;dLquwg#C>ani>r(h==)B1lhZ9`*R|7VxlrjYS)jO+hNnE6=O|5=5$beLsE zU;j_6wpBFqk#+o-*Z&hx`$)RcI?Q;~eyr<%C&nJ@QYRC8%GlTc88`#)C-=e=6R)onQZ_>~5=X=EE!D{~zmrBR+$jU;pd#ZS!I^*s1lu zh7S@E^~bvYSFurrlZ|#S6ufm~UjNH@>&CwRm*^AYnAZOyePZ0X^}m3_;?Au99a!Tr zumA0CTShZaYCIa1HXK36wEnjuEn{2%TiozeC5>tQPu~CY#-kkk&;A$#i~+^~V}LQh z7+?%A1{ed30mcAhfHA-r_+QPyY~C(aHH&N3)T~+AQom;Ys%5Q9+LqVWH||zdIlFxJ z?CSa%v*%RIsGMCpyJAlDoEhL%Rb5wGKBJPn|L2XLIQXCaF$Nd|i~+^~V}LQh7+?%A z1{ed30mcAhfHCkJWWZ{bB)a~8pEKV74OWm5 z1OIIdWLm4FVfF{m_5Z6J{0sp5V+=3`7z2y}#sFi0F~AsL3@`>51B?O20At|)AOm^U zW@)tj|MdI+4>;q4|AQ4|Dl-Nc1B?O20AqkLz!+c*Fa{U{i~+^~V}LP`z`!^@MG~b9 zPK^AK?Evii{{))YC1Zdwz!+c*Fa{U{i~+^~V}LQh7+?%A27Y4=|KD-OcM)$UFa{U{i~+^~V}LQh7+?%A z1{ed30mcAhfHCkJVL-5E;BkO-|Npm~@$GM51B?O20AqkLz!+c*Fa~~$43PK# zZ2kXRytAxMi~+^~V}LQh7+?%A1{ed30mcAhfHA-rh%&&||4}ZO#28=fTk#^$y) zZS}29%iHT~TlTDNTT{Obyqj9;m#zei3t8G!*IL`!)CdXMTbo)Ity$ULw6v)mJWA`A zFOR#Zo7p(0uA!=ORzp?ejJlZ(b1G*x&aRzNRaZS{c4c|pjG=5^kx*fnH5>8D3{5snmWlEP zYTvY!->-FfSYxfV5yN~5YcT{BgzFA|$IRB`bk2Rr_8&M7rZKi+Wi){L%Q zsUmH#&5iAgmo>DNE>5@{RauuB!>5YMEeQ}I9s*+P>Q^^JSVzZ1&HlKCo zyopEG)zp8qP=84tzblojU)IuI+th-iQ>;9ynl3Tsc8jQH<7QoavBp``^v#kbt3EFH zkEppgqU7RHRV)=u6&IC>%>t^p`kJ?%{_dICHH$MYJZR?h!*`{M@%<&zFvI<6EbX({ zVJh5MA~riv;pNQ_Y^ka^vSyEr_8(t)v31ugyr{9Iv9+l_(&3}mqw+h^ZmL_AB{th> z6L@oe#@@EQYL+-YI&8`2gLb95bYx#_!l=sS+Dzq0U$;>%-(R!r__CIog;k4--n+-S zE0qgRnsAq6#8H);WHptXnJqS3QOP=O@x8BqxqHp3M<2~S@xt0&siZklnj?GZ=pAU1 zB}P39s<$xX!yiuCa(m6P^QV9JtiEzrs%K7&i^Dh?d*uDUVO+r(KN;T`pBWz*ZyB!} zFB#7oPa2OJ4;XhDw;0z!F#BT+Fa{U{i~+^~V}LQh7+?%A1{ed30mcAh;8$S4ZsmEy zAg-D?k;>t2{C5gDANL)c6uERlGyPdc;8*!~x;#w?Lt0dw2Up|3T_tmoG z_l%|T3Hp5fbmKDRQvD0<6>X!^px&eMzd{9B5sU%G0AqkLz!+c*Fa{U{|9uSXZ5yiQ zcjeo#$VL`pAKTEJU7B@t2a3L*ZK!^i<{keQe6hC6m5*-sP}kUo=Iv7DW4381zq1W3 z*rl0AHZH(BVtHTNP|YsQJ*qlnFYR*HBg!up*V={_?NZg_n+&Kgcx*$B|A8W+TN@mE z*@miiX$j`G1p6*;lQG)~Y^!ZUGk2-h;T-|iU7mCJCB6l6u9kM?z!)ZEF@67^!WsJ+ zhZ&QNcZ?L{UgJ;3mqxAevT=oRs!?JbU@ZUdn~GSC83T*~#sFi0F~AsL3@`>51B?O2 z0At{{&46Z|!bh!!x;2N7G4!Qdi}-j$%VLd0i7}@c);vCHMp~?-So8Ua-G>;hQmq9s z5s00M51B?O20AqkL@V}mcR3k;gGj_;1JNRd$>WN-@s+Q=brK*WuYO0dxrKHM&v+`GUn-WsSi!Ji|!iU0kVTxmd{Sx~G+W}Uaq;mI_G3{{A}|Fut?w zUg6|}K7W^YlW$YUI$y6h*wO3ttn2W5`n-5KzP`1ww!P8S)Y8znmn%7vYgvm6BNj%| zxmz+F&H^Xjhxra3VCEai(rIS7vZZOo%5ctc(W04>L~eJ6!@0o8bC_T7fL>q7+u<1u z_2adfdj%?yxo!V(g45~bkEjZH*7njWU`U2pXnSql(nhMWtI*}^a;^1s`}`qS%d&P? z%gUuoU0}Wg8z3A3)b1KsZ)OhBz>wHn+q&Adq;YkzE9C3*21A~{fyC6st^rRV=q2H< zfY;L-$+p<#>FOHJyUVw3-EjV-;;xW)Q&h8JSA^lj08c0s@U0yTd4n#fi?`bwh$$E~ z3UqW2LM`GljIHXra8+Ytw>B?1Je_me{5h<%0!h4V`5|0?qI6mtN~4oVKs?VASPWfZHFpE zk|dQK32|?;rU=gbeEzT|>=dz?$I7X3T_iRHdP*d>#3rB6iei&R@0=^9DbbvQg}yE~ z(Yc{yc6m2-_6~M=I|e+VVX8&7?eO`>5NTZil-t-J zSU zU7|WjPaffUAlw!zOhMaQb~sD2dALQ;``|ev+#F&D`=ByHcaMuqx=PrikW8rVy`>TI zCT%JlRUR#GY=E(OV<#Uf69i{=HovVRcGwPva~0$IVAyvooiH3XsTU5{5t5%9ie14T zPrwUL6AA6!T_!r5_1Pocm`Je|VM!XAc$UYv3cVN8K-+JrExx^Q>hNpg-qEBi&v2> zU^V#zE|tHM)5mKMh;72_Lcil>>m80utgV)}wNCXdwOct!nP3F?E7c<9UT(S4vEya0 z{DI~4>g?!423bdS^mzuNk9A?6Qj?>&MPhtZ(&56Frz*pMAOA|Ge{NpU}|=e5g!!Dkd!p)!LtHcro}C-+y~_f&PHfg z**LDjiX)mD^D8S>+^eu3H18AMovirhfU{RKSglP17d~Yh=p0n507l{@Eg99xrr?^ z8bn4M8a-|@z_E||ySpaCV|Gro2gD@Cwj5hh&JId4BPWz&`nr$sO~OIwxNK|=(L$oq zl(@za^@p~wwSIf=%`*f`X9s zj*eMx4oy+TVhfs(Fg!(L;beuEJ07PZYk1S*8dWZCo+3GoI6Iq6B`z&vpUD!72`7mu zgm{fugs*R)*VpNTR-Lf)DF$<|tzjS0hK9Es86^>jhk8uSla zek9sJXU{OXcsGrx`3S4IVpq4;F}cw&6!A zT)ju=2<9j984Zd)hGClcXCyGChI1??4<7CP98|2V-4*a^!xwY$oc=@8ebS6 z8}Awaf?oi5*?7))+IYfv1bzeHZsWEculZRhV}LQh7+?%A1{ed30mcAhfHA-rU<@z@ z7z6(a25eS|H;AJXM51B?O20AqkLu+t2XU+nvj{r;bEHfQ{3d51B?O20At`k!GOaikrh9Jt|Mp~ zf~q1Y3W6*nND_i5A_xM4!+~J8BiL*RRx5(VVzWt-WCz`C#s{PZi@*l(jq#cBfxc3o zpnb00q4jFT>iz1W>h5Z~^1QN5nJRxSKO~K;0%UbZN2@WrY_gCsguhm*UZKEwt_4YpZuA8?_pmgzzG)8 zGJlhQU@+9?>xPmx^uy=r#o?^A_ItOq4Fr+VnRoTZ7LIaLJ$ju^zUW+0Ni*+G%)AaWkIOXNV#=^q;g%n6d!;?SpG(yx8Q%+e)){uZ1d%QXt&tbn>_=yd$)zU=FT1T_XpsET{!j- z4o#U)LyOI@4RA_gf57zIZMSJIeu*#ZtxsC@tWHbGJIZ zeQ-_%p_lw~O?UA#+>70F;U5WZD#rBI1&O_FKGYRjLj7Pc)Zgbj(AyfHm)Y+$w>Bfo zUFq(GXfum2D}F*^R`bHN`9k4jX<9*6nk$X)RXQD$iCKxAW3FvZrCDlP+W0i`k7!)# zHj7D&KgTvZ(wS1ErRgc-Q?N4?()dZ8X|}C8+?jNHv!SQ!*qPu+(qTJOwJp9gsV(6d zV$n2AVoe(4XW8fsG3p>Mm%?nZE>M(D%bt?h%4gbgEhZH(h>sHq4;52sC2^Q@)FZjLK-sJ`N%;?r9G*c zse^D;oI|7MBu1}*==J^nkjLkT*eMw)(CQ;N$9Rcmg%w-#GxU6KyvX@Cs$9dgnuNoW+J9fo*buJ3U)9#)_?VT+Dr^=0|0=LKL2#O0!Iw zA9IqkOr9T$Qk?iSoRK)Bx}2$YGHawevz-&+AE9%BK_e$M;VF|xY{9wJxs~vbwBX%z zOrG3=Cp$-Oz`1p~nYp>SWV%?d(c%z(0k&_Q14xL?9T3FKT zItdCRW706QYuV)b$ur>}3Eo4Yl_j&Q1$(^tESm+DwQ=@QX4llo+?mjGOD2=)wOXcm zB~7mrkvKbfE{ROAso4eDnb}#{gt2K7t%Qd2a!i+>FkZHsgKS=wJ8P~;<0W}-aDOkiLG0oBJ4BA{TSh^oyIV1Z_0Yubo<8>8Zq_ocyEkBWUv8nfCw2EU zl6$O1WurX}o4tJ=PjgJ_?Wu7&!eV&gPypQ8p;_SWejqqCb@2T^KTcdm-v57Xd}_Q8 zU;n>mya+o0{tVy#-*4P$+-zJ6djS4moMW60zYKVcahS2i*k~MJtT((yhq2mdGn$P> zMy)Z=m}!(5ZX*wVGtg3!ztlh0-_`%2|6PAxe_H>O{;+AEXcJ{kl)@)PJY1(pTt9^hUi#pQBglC3=CLqi5+Ex}n35C2IfH zz6I;VhuYiP8`{g--?YDIk7*BTcWbw5*K1d57i;HfXKJTt$7x4shiaR(pw_2#Yx`-d zwN`D3)}Sqbr}HwcP|MLK!j!LScJ*iVTlG`*UG)w1MfGX*F|c^tu3oQRu3n&?sh*@B z1@@1PYQNg8cBre=W$GfeMy*!M)B<&i>QoI?P<~OqRX$bTRo+luRGwBIQ|?!8SFTqs zS1wS_gtHTmQVvx%D*Z~g(xI$UmMM#r8l_q(Qwo$Ric>KZLHfUA|tvT)sd)Q$9&PNT0s*$RtGO0kCA~_{P z62xD`Z^ci=cf~iv7saQ=$He=^+r{g}%f$=CGsTm{qr^kSjbgvpEp~{jprNoo#sFi0 zF~AsL3?wrkSS=QQDnAY}k55O;<yt#cOYi)cEoYK4Kba!BBt>cL@@0lrtlo1!To}$b3Y?$+`kc3?k7Zr z`w>y*en6DC?-51rJ4Au|7SX|dgJ|czMznEXAzHaF5iQ&oh&=Z>BFBA3ko$%E6!B;7 z6U2XWA0z(6eT4WU_aWjB+y{u?bMGU5$GwO6E%z?sH{3gjUvqCGe#O0o_$Bu*#4osi zB7V;O1MxHNO~g;RHxNJJUPt_xdkyg;?p4GOxxXWRz`cU_KKC->d)!Ni?{Y69zQetM z_%`=E;#=Hvi2vgLhWJnJS;T*E&mg|Z{T1;I?rFr=xu+0cOq?jgiyxCasc$~}PiG75wGUXLA;9Fj(8<^ zHsTfBS%{Z&XChw4oq>2McRJ!F-0u-D=1xPrh&vVW58Nq;7jh>fUcjA%cs_R`;(6Q& zi05+0Bc8(@hq#?P7V&KE7{s%s6mAId zWNxd&YT>z)4n;We5QG!9ARK=%!f^*79D5+bF`E&N-h^<}Mua0bARIA>aCiveupq*= z0K(7#2wMlp_U%LaiF=5jxLf*&dvGst4_Z&$1NSHHW*>1k^$>SsH*q(tBkrJ=xS=lM z20MuxSWDakJj5N?kGTCE#P#n>+`iutw|5P3*Y88z{r4uWZ#8jy_9AZgD&nr&lepfM z#O-P)Zf6^D*R~SZvx2z$EhlcrGUD#rLfqdq6L-y0;_kDAxO?wG+|^CQ-D@#%S1ls$ zo(qY)vXQv$4a9A$CvIyUaaYt5clqwbT~PZ~9;K$MgsFyY*Z3>-8)3i}myLGxbySbb&tLe>_S+k zH|h2I0=-(V(2MkZeG0s{PuDeF(0T1g?Q88*?S1WE+H2a2+B4dpwMVr3wL7(&wQIG@ zwLfU*Xs2r@X~$@XXi8^t6S6!U=8R|J?h?So4QnORCfb= zK)LExbJZ+$oT{k~un2soe6D<;{7ZQi_DwtmHh~9}JC&Q1tCdTX^OQ5dDsZ$iq#URO zm0rcG>QWaUT%0J0p%b$R4;7$2u`C0kT@*m}U<=enI zaE1H_dAod?e7t;wdd zB$qTnN|O|5DD00hz!+c*Fa{U{zYzu;R^DRp<0zz4NTZNSA%%iLL8qWmP$?(`bY7+) zQ4lEz6dV-n6l?@E-b%qjfv3PBaKBLanZmy*{6yhL3O`Wzp2Bw&zNPRDg|8`mMd3>d zUr_j*!eZ~=w$ zDV#^)Tngt<*iPYW3TII`lfoGkPN(pD3a3#xmBJ|$PNr}Yg%c^9K;d`_$5A+z!Z8$% zrf?L6BMFGy5fl!ma2SPc6ox2lB`YNHP;?JLcMG})qk9m#2co+f-A(9jM0W#mg+X*f z=myaZpnCwiXb%w39w4ASKtOwdfc5|Z?EwPX0|c}O2xt!w&>kS5JwQNvfPnS@0qp?- z+5-f%2MA~n5YQeVpgll9dw_uU00Hd*0@?!vv}U_LqdmZm_5eHD1MFxIu%kV|j`jdM+5_xp53r*>z>f9+ zJK6(mXb-TVJ-~+c02|r^Y-kU#p*_Hc_5d5&18isyu%SJ`hV}p(+5@a;53r&=z>4+& zE7}9BXb-TWJ-~|g01Mg!ENBm~pgq8X_5cgo11x9{u%JD_g7yFl+5;?T53ry;z=HMw zODZ|JFNHX}?EF7?|9?$%{eL06=|96b#n=fouFnyzbfbP{h^hJ8DzC~ZJ zuh!f2W?k1s?KACJ?NRL(?F{X3&8J(mpR{kZ545+m*R_|lC$$H(yR_@HE3}KWbG4JT zW5Ir~LF?Dng4JMmZH`u{P1Po8HuWp5NE@fA>QCw`>a$=gI2G&xbHN7ikb0MTk$RJQ zmAYL$R^6uVuO6rd)U|4>x`$e)R;tt0iE5hi1y~3Esl1{*tK6kLp*#e(fm4-Z;R}ma zC0BkHECc&1dn*BDt+IzQSD6l$fl6hfBFkUMAIPsLX^KVuLH?)wgnXBL5m*6^g>N!$ zlCOgAGP>k7U;${5XUI$C`SLV*yqqG7u=ambx0oR6U(&&Z)?rU>Hfo^Un(9I16I^9sfeQjxbnA$Zo@Lhy*Wh2TkZ3&GRo7J?_uEd+ltw-7vOZXtNY z+(PiExrN|Q<`#lS%`F6vnOg`RHMbBvVs0V$qq&9PVeS@WDGb!%&h}= znp+3%Hn$GkZEhX7)7(06r@3|D4s+|k?dH~j+qlayx69DI6x~bErCSDWG`9@gU~U=M zZf+U4&fGF^t+{1jySZiHN^{G=mFAX#E6ptf+s!Qlmz!G#E;6?aTw-n+xWwEtaFMxX z;39L&z;<)Xz=h_Pfpg3)1Lv7r2F^3L44h+b892w>GO*p;GH|xJW#BCC7_8ON=pKbG z-7Ijtxmn;ebF;wl=4OGD&CLQQo0|oWH#Z9$e<;4nKj9FB^yu=NnNx+9D0Y91q{Ad#Jqe;MzCIKIs1olUh!2W0w*dI*-J~RpR ztR`yjMVwW{*^@XciPKJ;HsZ7rX9aQ463~j4fL62w?2VRyz0ne|H(CN((Gt*#mVi}g z320qJRBc^I-1bJ4(Gt*#mVgy?B;#7*>`t5-;-D2^DOv#*p%q{cv;r(bE5Ks30xUu+ zz(TYFG@=!tVJ1mBgE&>hsU!|s0BX0REdX=S0x%mb0M&&g zX#sJj5htHGQ;CyDoLu7M5XVKFDa65be=)B63vk^(9oPK@xb82+b$LP&U}#wjFH~t%q6HSoW0Pmd=4);vs3V z`n|%7pV}*}c@EC4nNmMu>k{yGij0 ze-|FK9U@+#-(v4IR_mJjx^k~$ygkG63V)d~NxjGZiscslaqS7UM>)v8&32+qw;p3% zYgwaQp&j9PO1jsmQy&vff%o@0);En}?H|gi_7A{%P$2!;=+vF+d&*<-bK;qfT)WHi zHh-gdhw+wvrn=B^sb#j}Hg3|r>NrQxVz+!N)Z2a*4C}f4u||t-QU9jgG#Kle<;6IxXbOs~~qvsx?3ED-rJI zTHBCyjNfQSztD{NPMf=_(%K!D=cr$va5rXK7sMxt`Hqac!EV(o-1TYJg81*Fx$B7b zv7cpe*N(FmS;$8~G2c#c*O1&t`WlM6nlMAZZ{n`ftl5zdNx3UyIJ+Xs+2u)`T~=gW z9j`tf)KIpkHxPsq66*W?8@vHHya2vUw!yg$qkgr^T|(|4BsD*337Ujfr5u$hD| z8w`Q($n$3sX?7<`nZ6yau@DUu2I0vR!^ZD4%(l*!FhF~M!n9hU<=N$VT z+@=a^cU*>}jy4-7Sr^2oh#71)DAp{#6MCI@Q)rOLt=@ILa8N=h)mp%JdV=0IuRjQ1 zrEl;CiO&Ez#U$XTwG5ED1^WjBonGp3fNsqJ2Ev2zK)SVv?+P~;8l^umjh|43ji@iF z$X=4)Mi|a%+Vv!YIoMI3{S$NZ(JJ70*h7jBhI*V|y}hZd&fDYJ;Oh@W zVl3CJQ=qwb`+^}jie(w88|~m7=1Db+8e1A$o9a6ju577qZ(7!ZN7uBFUf%2VcZYhK zNz=t&p@@nojm$Jioj$PJEb3Xw4= z>0G7VqAibp^$+JJEg%g({6X)0G9b?*t)2|fk<*Lj67M;~j?=Trox)Qss-uJStjHie zGqK7u=2;IK;~1TEZco)t573o68lWpkt;&-sTSioleH1JutR*}NmXM4`dJrs*&TvIB zqvrG|LGB1ag^2_ejPbrtqkRm=O!eK1gIGF+7nFKVjJBG@hiRSvsS1 zWk%@ANTh4reCw7mwkK2hm<2}qPB*Bu9W|&_GV_q0o)WFSkyLv?Morq z(Z zX_a?Z|EgZBHmS03vaqk?2gfb?o3Qu&PI(VmcU)*(q;FBqQZnV|q#q=Qc$r%2cvbyS z?vnNru7mIFPZ5q3_AqAYKRV8E_=PXvw+Hst>y+1|J2ao@Ff{FZb-U269xcBoJ|OI_ z-KDtX*I~E7(ZWO8eqyQSu>W8@2j3tp*8iZFD}PqjDZ9zJ(k0SbX}b7?xWDj|W1FK` zJ{R^79A!+=kJQ)df^v~^p!^-|pAX4<%Qop%X@j(z__}zAqsyTiC+q8#!{N>P1M<<* zJK`7Osp`wH_di|OE(9F+>0juR9qo?sDlbkHQ-n7iS7|NAL&n*#AL1U^Z4grX)P0l_ z6&2peUnZX_eFksM&lPe7-S`g9RCoh&(Pk5ody@c{)1JT zq5d1r4|qp;PPsu@EYFgQr6;9_r0b+3r4}huyiMFs+*4dC&K6#99Pik}vAbiIdX3Pd zZV-x%LySyiKEA{;Et62?2;aXhZ>u1uF) zj?dJ5`4H)3$Fp$4Lyck6pVA-E&(aHEPsGF8c=apTi!ehTFKrj=#HqrQj!lkS?I7(& z?F{`zWsTY@u>JqT8*i8|W8nW71H>B9=h?iLA4eqe5W%Mti5wEdrxA&qoyMnPD69hb z6e9Uy-sKJSgM+4cJtAolNhK1d1*5cP;bn4-xk^M@2WNcoBE}}U3Pi$OVafzONUrus zJR6ZZ;kk*o5-9*{d)SRi{9t7dhl+tjmZ>~PB(jp{enAPA@Z8TtBCB`q-;vOtPy&k& z_al)=F5C}9B8znHdm@oXQ0_a7NAmkN;`a^u!E&7YIuiO7k@hDRtS^Z~*5BM0MDhhU zc(~7rgk^k2B(lWjJ|z;-nfnC&NEsg!3DbT=Buw#PB;E&+c<&R*3x-4PJtBDy>2ia9$MmMkN00 z5$QD|k#!*VDv^5O;7{)F=toL;B@+5_#P6ku^kPJMfk;@|^XNycj?WQ^v<&WVL?RYK z?pgGMvn;u1h=h0JuS6oJUU5&Oo$x7gO_}NV?lmBCYo}DuLgvM8X_yiNw2^NaXZ5?xu*}jS@xiC%Lk&yF=6eP7h5B-RS=Mo7uJO}-HyZqeth@WYv#t_nO&P0i%J0lY3 zbRuEReorL4>!%S3+lgsuCfBIl$taN=P9hSPd?JxBhZBf|IUG-xwL{`jD=xVr zEprPI2;B#x4`_1`5lA5ihU07|0%;_h!af_r!UiIciN zVO^jm9JCt>5P1O+;OuKJwMCID(#WU@Dja(@5y(tljXscU77<7zn;DKXg9xONRfT;j z!veMZkSmgP84A$MONl@lMhOu}BQFleDGCQoCjuFN+(aM+7NQT-u7C*Sj!Yv0$tNF! zAoA3(kVgd4^>T?o+IbEUNMsigNS&q-fjo>%CITrdn+SxHN$3N;G>ZsCd1^~RZ%|=8 z5lB)e`asf5A`mq*!g0nCf$)+Z_DKs1Xuu$mQ_u&>F^E9Q(NO@BG$IgvRU#0QlyDqs zj38H}g^A&a0{Vb14kD23?cq2!A`o4yVIPZN&5%fPT>m>x`Y<{rWcf9r(ikNaZ?ZyK=H}Fnrm+yV9ey!!G_= zN-liUufx9m&*WF(Oa3e5^I>1WvGP{?-fU7y1*yO7jKS3a$|^5>FHl z6weY57k%Ph;#@IJcvE;%xDM<9`wFwf7O_Dr7pIAnL{a!z_zJ8#F9;6_cYvK>J6Ldz z6aqqz&@SvD>@E}wX@cnZ+3}U*1Nbe6+Z@+8E^?d&4Tb$N1{ed3f&T~tl8yXELf&|= zNuZP~gG~aZoJ_Dupya9qn*>Tz(!eHx(&RKaO3nsb+S1@CIfA)xlpICXL^!*I2OAAZlff22;=tx?uti{OT?Si3SmMGG z*dok$V2i*|MFv|$So$dv`Xlvoz(I2n>HCQET}1j8B`BBshWc4$uti{gAbk}H{gV3e zGT0)*8hlQrpJeW{i1cYh`XnNKOeHAeBPx9-b00>e4+;&*R2={?lz(NykkD*Z_YGXy4m zRN(HU(ql4rN5t>;aMIhT*B{fs5`hUGPJ;vPDDO9${N7~ZjV9heW8Mefq*Lk6Ozt`= z-7SL^0`mdsnn>u?5$P%_-BAfv2#j}o8g~ViZcBqB?`X-FnI&Cn;w2_tOk>_Ca~DzR zhD`1cRN7w2T}Y+tWbOhgU7N|B9|=8=N>|EYg}{8LSZ)52O<#p(mJiA!1J)p{!l8MARiL;*&;w^=egq!rXI(p9Ylp=(hhWhB7E9rgxpOOHd5F?BONXe z3N|rO2D2JR#IrE z&_Si5Pe)4{QMv3h4Ax#0J-q-5**`}i6-Yi}}mus_BC zV}LQh7+?%A1{ed30mcAhfHA-r_`kzI4Y8kW;l8yLw!wR0*n~iT0k$~zpc%E*QXD;gJ8*OqU|b;H8c!sl?`SQfZeHnp^OG}rD0 zKR$2ao!rIXmFvn??Ra%Ay&BSOcAnpswJ#JH{&c7~{$m{|yS%ERuD)SmeaXy*+8HG? z8f(i-YO5;BODY!D&Z(F+vvFo!t1VWeF`E`0~EA>cVO*JA8R}+VraF+NAL1U1{k#=~`C!^2W58g)_B@;mhmNa;N8N z6T+95r*%*5*2ae~FG*WlwpMqBwY=C;nLaCB%M1r!Jb@^k5x%@ItvSD08yCJjFKu!8 zVm&>a_*_d>T6LP177jjlLRv+dmKwf1TwXn8wU!dT+$y){wyTB!U)IClmfR&Xm#DgV zwJE)^uu;{_tHJb&{0dbyuYz)6QK71sSAKQUx2S*q2% znxE#bbgLHgYF=8JD^2Cis}hoqy#LQPwCMi-f5BONFB;Fl>F|#j_ruBcHyhU)mm3!v zXB(%2Rp4-Ai?PAzH+l>Yp3Jw@Xf$>+s*Q5PZR8qR#yH4|{V@g@1B?O20AqkLz!+c* zFa{U{i~+^~W8i-`17xc_pPP>`VJdE%|27Zdn_Ps?a}YjtA$&Xq;l9ZTcV{EqH3{Ly zEQISOB3wQJ;gazP7dt6rB3zh(aNanCbJHoLAsn8Hur-D3*xzChcau)sL5;XUmAHQR znI)dzUncIp5^-0H#NAUMZkvO+&A9)+2KWEZ$Nm5FaQ}Y^uK)EnIrDt~w~g0f7XUel z|32e(;|AkO<09A%@O$HUSot4p1da9ZJ9hgRt;QZkoiW#_G^WFo!twtEuY=?N30@Az{}a4qe0U2!`~U#) zxEOu_fZ&B06wezM-kP6IJoc|ArYT*2TfcbF#KfpXV{~vz;s03fvr~K--g%!vc zU<@z@7z2y}#sFi0F~AsL3@`>51B?O2z^}*vdH>I`_5ZKPI4g=Vz!+c*Fa{U{i~+^~ zV}LQh7+?%A1{edsJ_Bt1|Lb$kN@NT$1{ed30mcAhfHA-rU<@z@7z2y}#=x)509*h6 z+KjXE7z2y}#sFi0F~AsL3@`>51B?O20AqkL@ar?c*8jgg=d47=0AqkLz!+c*Fa{U{ zi~+^~V}LQh7+?(i+6-ux>$!2srUSIe??SIf$!OI`KLTH4xMYnxiyT?6YoqOm(5?(){A=GxZPt|g7D zi(MgKpEnrt^bI6tQS9=2`n;}?cT+T5chww+b5Rb@`TSkpO~C_teIaj$XE4-{*RjP^ zM2lR|QSES6!OZ3eOz6CNYZiQ_LOU@Qd2L{DOnsE|w^@)l3t%vla+Q{G7A#THQ!b1_#r zi4#c^97>rXIF}UhL)A#+-~re|I)c7#zb7;p@CNC%ud8D{L?EpvCTzA@`;{$CD^@nT zD8Hj*LAXxH##M+OzOG_YhI@0B;H(9W(!;klA$nM&1n=s^yPOanPBx4J;qu)>9hHK! zsEFS-i1$1phlI;narZtU5bi(v?6?=LTR#%ruGYqdjjfF>^^I+qQLxb0OIL(lb&KSSsbTdb256LmdRsyMSa#~j*^@~xZm?|Ep zo_ok$E;u_X_@QOthLoJw*y=SSv1yGhqv6#r99Gx7GQqhI=(=bJx+YaSS&gbOXquGG z2zn;Pb8nkfDmW`D_`{vpJ(7!0_Nk2PB+22>Pm;<>9QR`99q2L1nIyNS*zOZ)v)G4< zUBmFd^Cb?KNlcfGFVj6Vy+m+&viYITaHqq;q0ciA*JRPtZ$n}OEQV0CDI^DB9?27nd&nphoXvUs(7bRfgE76ovm-d* z@dx8u2$?lv0*g!?6DRVRD9PywBQX&Y+7(Xan+gPHJt*W1--wv_aT&(=PfxrZF=26O z63UNj)^3iospRSH@Hu!>V)BR)-Ep@jCSa7ilQ1B~B#c*Z!~ub*KGummgY|x$J)4?NFN77Q{izCl!-hJMhlE%JL+99d<#laAinIlqTNF)^XS@%J_$xM zk4n>qX+5+OJM7xSHlAeNc17DkZO{oX;oJx13eHAgGdtWPBlk1>^hahN(s`o+`H6f+ zgTl{GW*Wk1G|&}()CoV?Z^;qJLT_lwFopN_Z}bK_{=fFV1ip@=zJK<5Z};80CF}6& zuqFA>Wy|-mk}OM(FWGVqCk9Kl6kCZc8A*0767R|eoDf|4X z3Y4~lK)Fk~Nw}f#|Ndrn-?dMU_)}Uw?T)mwyEDJvZ+`Qg-<-Q|mS%^1#+Q-ObcNLO zm~xYE@nVl|z^DbuN<3MNcr(*To?zy7ig*C5Y`o0X5U~> zhQoC61@@V6h%P?OJ`vXF;^XYYVU;c(VE1Z@B1yXkG#RIr&6&Z{BjmdPb5E!fWQR^1PBBO1PBBO1PBBO1PBBO1PBBO1PBBO1PJ_5B7mvC#J-{P z(-&wVKw_T`@zcjOetJOFXbC_ef2FJ{l3@n(|3Av243r8G2oMMm2oMMm2oMMm2oMMm z2oMMm2oMMmm=^&)$A41H|M`mm68nUh|9@D_|L^7V{{cS#Z|3uV_xb<3=>7j6CI2J& zZ^_RkKc4(R@?G;L5<~f(yt{1;bv^*^bssnT>mO`{WqD$bXI8J@P?A=+mEb*=SB-PSgNn~s(rm9SrDs?6!8Qkg&!6vhi ztXVw5OiLQMtPX;;<$flmKxHz!1BuwISjevDsc{c)ub7n}Vu-(Ik)4_=WvocDDy0rn zt*rFuv}KmMRAwRjBI{9BC~~TjHIf!=gvsZy&m_BO8C*nf<;7Tv&6#Y7>A*y1J(PuQ zBnQ+cPDrW)H)g59LOM3i#E)lmB;L$)5Tw|1Mpz}2E~egW6|o{j${)fZv!U|suL8Hh z$}FRyXs7`(MEyLoLAJm8Xe0jyM?D*4@k`Ji9F_VCX02luOAUcgQJK{%LH-5S0HRc4 zXpr=2QlSY;9k|~<-;wHNs_aO%)x<6`W|^jL4aHS8l>lorLO?JWFrm`N!&YcZ& z3kU&S3+X|QjSCrRP(~@27J!rMWScI43j^S$>83@uB-Kut7mHdDuR;eKB}cAu2x)K* ze#@F#m>Oa|s*RMDQb|sc2C9To?qRYC-HR^60xV7poxuqUV76&MP278`k^)rbE+yzm zj*WvYaV-ES!n*C04GW;$%RP*lpetoD+);?m_K^jEGX*q|Hj^c80TziEVM9nAu7zrZ z$x;?>ArHhdMG!rcDOn~pkq_5o@e@2r?lF0sxlLzXKu4ERC=!z`1_w+poF|_wAjB;| z69OrSQLcC-F1Zk{IYqe6=4X$@3*~&?jTdS10LvEP2(>b@MHrNI6Ty9onic%R3H>F@ z;&(i|u8x#_D3;;k6yymWT#yBjgHMDw!9j+})D}rqNCz|`imGu0p%zb7HgV=ab5358 zI!}iz7*;}baGaiB!Aivq$h^>cPLQIUB5#aa0M9oMpvZd>!7V_ShKPvt=9#i>H;Wc; zDN_{4vx$}#iV>-B6v1u9y&rSWLT|c}Z1>vaNkKV+P_ozvrHots0t|nSEI{KHK-Gqr z;O^5cPJ&Bbks`LvMnFzY2IN?-WE*A$L1@SkiuMl9A`cpy3}!BqIJ7q8B(&j3IE9vh z@rZfHP~jYP(pu*L310- zlF3pdCL()rP#~igmlR2%4PZ@7hXsrv1aHu>CH z?m6p3dbs2~)PxT_c+!$JWKp2#euR!t%cqz{VObWyY|E9IX#+Tk+QQC53|Rp3XOIN| z8sfzT4zCTsRa$_!&a?q^FC5n~@6zPxd2N7{vSCBqSv(PR(i~g_p z;%3q0H=bwn3xBE>B_4j#70cHx~ z?F@ak0Z5_~FnN;jeN6z*B27^84FJU4p-?ytZZ3KkCeNYQ1i%2YngC)_MJIqO-5UlV zH^`KUWZcf(;+f(GFa!=50LU$nz;;~+1K>gYcAFP!+b*SR03?;mqS+QfhfV;FbnQ#R z>*ZpS$v1ev|NoEV*OFgM{!8-Hcnjb|$w!j!Nxm)lw}=j0fIxsifIxsifIxsifIxsi zfIxsifIxsifIxu2A07ev#eOnHej-VJJVAaePJT2-ek4l15g}hU$Peq}hp-W#Bxxb? zRgHW+{(vtls$xhoEh8k8FJsAHCZA4zH~Ed^moWSP$K=P7A58vz^6i-WzdrdIL+PC4*(Ehyx z`+Ihq+js2hA2wUATeqh5(C!_5`}Yp--G0ElX20j61qu;AP zTW=5lD*Vy#E5rN4i$gyQT@GCg9SkM3$F&iyL48_%hk69x9sG>)7s`y%ujukuo*A8qt&YaZV>1ZZXmJ*0BUr!-=duii z8dN6t+}<}eJ>I^1boMy+uAZGZG1GQD(hwQF{pi%dR>3@+&%D=V-ab8ga{QL5>6_by z#@kO%9?iOJJ8rZYqqpBUy>p8YbVI(NJzP+>>g`-1$~p;~otT;&7@r)Uo;cceT<_8; zOKUen7~JxF=yq$niZoY|sp*rWv$Nx4C6!&3O*ja?u1%a#sm*8Hr44kcjP0159iN^Y zJ+Y{=zLJg!+_!BMiN#wf$uxdOe5ZC*#5g)NIWubxpO~86F=j4ps_UrRx`ETH&DBIt z&c*vGZ6K^OX6&8ZF?s6r?C``fq;zI#V$77}qPmTB<#i2pQuOV+yy@>5oVJG8-w zF$BAqZLDdo*|<)SwHJw0(&-E$9b>p}|Bj&peLZ`w=@~w}XYaOtq*2paQ&dx5LkO-| zOU#B;kq^Xxwq4;##4F-vNkv7)DWuo7MkH00PrY61_e|9&HR?-BD@zIHmED5gC%s?W zR;&o4F4h{7#U;g)DCW-9ATMOp+q7JxPBlhTdKS~pbLCmS zXM1hOW9xV&+|(&VZq66k;}@AWf7HUp2<3KV2e?sOJ`=Rmt&v;{Y+cj6W>Y&SmwXnu zRozf77c#&2n)uG@HO*_t{7$rq#FpHGPpUi(%TiO?*~(tn%53sw2%FimQlz%LHphyM zvdu_sdi>Oh(WB!h$0uhAUOLQWrnI_suyq3tir%q;^DCS4YuhH|6_(I(Z4eW$Y?RRi=1lY7z9l%Ct^h>s6+NwmX?9N$|?l4Dv#i zX|0-DnPPjq9%5iAXHk5O{2EpC5YO1iN7~R^+&H~_iAZ~KzLj^Y4YCUb8u3z{aOi9j z#LM%ES1S#&Xv24p&mNx|LvK{FsDwA)je=!mKFg{!i`!Lzr?|S9!`C2q8uNL&z(bwg z#4MVGw&O+RMW=DMqF#{K=aYAWyl-l9c64GA)Ty!*>fP*eQ&9Ud+yUxzhLfd9%5dvq zL0p|Lx*f!#EjpekPEdoptWJ>D=99L8bUSZd+K$Id;y2=QZ7pcwe4XJ+dBv4G!y3-$ z?+jPS&GU7JTdGB3RV(wV>vDNn#F*htLvDj)N=$-4I?AAq`-`_bdlbf&5IrgSI z$E8(5fp`@ukkvW1$}JH?K+{;$QnRsA(D{1D79>=-cU+e49amNmvmyEVyJmT*BGM4u zV`T-EKwG&;%SXOcUXrfSCFmYYD!Cc2EEDv;8ofkr@@jMuy2qlDB3`3QL0+gvH_5p* zI@uUamM5vhI8?$}lsoh7r%_&b_b4)&-9N_r;=F$>7SetFV*{7|JN1vzbx~4yQ;`tq z>mTd=BK`g2@>B&M4VUFNsb)oyM!iN!MQz0*90cd)q#*X0@Z!38Ex2KALl+LR;4KNx z?ziB&iunz=p|_#Dp`n4gi<{#jdC|R67wdMfwbc>r_wHV|*Rki<-9et{U1K6KU+-Fj z#HdXw(7U$R_0@Ibpy;cjBD2)H%Dl$AW7%qCR%O~V^sYs9>_ODrm37p;u8jy;zV3Aq z2Tr4LNxFkAs%@?%c}58yb8ZU6Xd=MUsjr_ z?@PV<-l2lJP<;n+cHK%gr>ncdIh3>c)xBilwcX8SPIceLtNV~Fr2DFSF-gzXsQsBn z!)|TgC<%$a+Fs<7=&$T#f$P|xvE+M`Cz4AN|D3px=!riSe{KARcw_9_u~)|0qu-6b zE_!WLi@Yy#cced3Y<$spgE46|=>McYsE_ES;SY!J4(|wSp^t{{33X~;(JpD%Yccix z>YZx4@-^kf%C(9izem1Zwxpj+?~%qOg?$PMF37dtUO|Iq|HO*jqqDmUly=u`U?^1D z>~4L&@*cUhl6VwH$}ezsL0@>0r-w6HQ=oW1FZ2DkaIF+ynX?!01pa?Yee)S1(^u;3 z`F@%Ha^HTMBWqNz=M51&-WC~U?0I2!o~A*wJM%_ z*o}jT*3Ci=Ty=h%#?FT)$}wu=%KqScD&Nip(;qF7dN zXHhhaojhh@_B3$d_<=(>WFp@693gK>t~>zZki40x)6+-CuPCnRz_tVHaS-W-Qv#NH z-pZ!6V`a=HScYdur)OubotQl?awcmBv}>ylG#r>g#GWbi-WV_~&(%aKI~%?;GB$o< z;^YLfc12aL-+AZGDI7A9Uo|P@`Eqs_z%79HiYVRO&+hJLHu(w>@4CrVCm;CRA&ojJ^zT;`IM9E*{}2wD zh__7$X-nD#Q0W?W8>D5!o&yot<+A>5{p)cM(bnT!id3CDMPOyOit5Fc%9Q|&`?Vbn z{Vn~Z#-3wB4WBjL5>%kp!2nsR#8)Wl>CJDF0a*4NOvr1K`kZ5$J7 zEy-W`m<`WFZk(7L8=9h~1PuXJFAmR|(#n>tEvs=*T<=kl^s4;YIzvhCn7L;3#KhS4 zEFoU4ZPD7RT9&s=%$ynBazrRV%~_5qPKPH8+43DV?A{t?lg~|g<7kFoAnUeg&jJ6; z_~`V}V2-}yh-st?o`o|``Ase0=t;AEKqfQ8xW#Ar37%^lheP|@F}FK5fr1&GPG7hSh?@>f z?V7q}97CJ2@fGHQsjE+&@@|GtAEB}oPv^E6D-&JGl@%+eA!+v>k=AfBZ@T>K(EbWV zOhFI3&twMr_w?`I(RXA&s$|y=S?xeED)Ru(i9nIHM}JC6daX6}moh zVtn%0>~R|Io?g{uN{7q|a}0+<;cIpY#)^E#LtsQ(HGXTFZ?}2Syc&m0!Tmc0-;&N8 ztc@{H%B~OX$4JtHujl&1 zJNE3_v8Uhki<1r0Sk`2&FlRu$dxwzcgZ1EoVXb3tsx#`A*AcA!gY)F_y3n=HkjoWS zgH@YxP%d{32(7B~b9pW0(zTc?=dsGDZK_&UH9K|s)b8!`^xHAOVUvx(i!l8+}}nLL#2Nc=eQ zy2MEQ2k|$?kH^=>L$SY)JukLDRu}zV^ip(xG#PnKd3-joSTM~h3!YszV^)ZujVX`6p>nSChA{vm7m zXrH%y)b6YnEWY(4_773^Xl7Aizqf?c<*Win!BvGvqq!Yva@bo%8g;tdWd$X_xn&=W zE__)b^H3#wU17UeS8zJHVg(i!KERX6?xhyGoV3~L5JLSc3zz*u{VNOYPCLif|9q7_ z5@GMpd&0VG?V7b)oHowkf5ZxM_MUkjvaXE})vRqf}>!qduJrK*2RaTXcVZW-svpiOv*uDrF%!jHx}h@=d@olK0Sl+7czQg zd>Sh&cpw?= zcuRr3)nISQuSMN!y0oTET3dW*r{JWnm^j&HB&Zs``5U~&NkEaA-tdqtNwJt^+4 z>ZXI{CGF1Q`PBS7gS{zF%@qyn8n!rf^QrkJgZ=G1YBt1I)io^Rk9<}+wL(pQNAb6$ zW~QSkZm4dcgF1>yr$#91ZzBH2V1M=dHxb9m*c-~&tH@XARg3|rS|qqUw|_>P^hQcB zuZcjJV~LW+$J9e#RW??34GzALw8dE@Bvt21!qVhlbJb6b5nrx^?y`Zh9vo9A#wLfI zDlS0Ump|=fe+9&7l{RZ_OLRE5k;uKLXX(`{Jg4*C)F_La#bv9?NcncBQmEy7kA^*D zus7rt{nBGy$F@2ZLJ$5b4WE#@Ll*W1gS~d1qCXaA&#yezbc{^&q*E@^6s1V>0QeKHS?_RZgi<1)S`d*%5 zmkjpGc}jeDe57jklHH=flOjoffxpIJum1fDe8(WWd+;vu+yYOC^!x?>XO!MN1>QBd zeQ+HPQQ&bdqCkPan)1AW0w0X;tQzbX6a^j=2>J{BRgjid;M=?>19=5rybiBcbrw^B zw>eQRO!s%fujEZ9t>0G_*A~-33-p~%M5N9i&F0kDR~YQ&>5e{SunXQBRvnHZcz7Z? zJTEuc%eBvG2e|@@NXBYqL--7otCpvpkMC)^h%Z=5`syE*$Xnn6xuoqD} zh2NrBk$#J!^SQ)sNdAHOy*hiL;-w_sq*zprYCqd?he*-)CIx$;&hAN9*AgTBG6i*? zVd-fW|84X?jbDX-q5Vwx32p=TzZZdXXLU_7UT{~K$$F1t&M{`%)=)iDnZqPzvJ_*s zDzi(a2ocUk2oAd4Yw(#s!W$E zbtWSj-0BR$CbN*NSvBwSn9z2_W6!fFH>blvaKd|kul3Ob!#ZDs;LB6qai8)U~RGs z_BNIEFm~>2m|H*y=vqh*a%^14NP{v;xg^h|6P(KLZE?+g&$B^|NQfsHOtnbR#gxez zaES=+5KeO89P%hyN||&iZft?B&CHaAAhH0QTqoOf0bCdWH%&J!x+ST0%Dhz%VFAoG4XBBG zPgPQY%G{*{J;||guqCbq07Y20ow8v8lzX{{F%xv9EQUJ@(b+z-0C1*&2GVA-#4W%g z5hH8}sl&BUjWAit!Y$;1Sf&V~XEG(rq$cv=nk;^TC&@h~k2AOFtPAMqG73dvvc=$l z>4o#;lLdsh1!zJb1u@DMkHjSx!ZoJ|*V+8+k$9n;&%5y=O&(y`A{?PsMz#opvTh={ zPf@die>kDPWLf-;BfM-WOD8=;hOt6zZO z&yfXa+ybcD5EI;ey2VLw$tzOC*4YTismXvG%av@ytRM&tIYQCi!CB-%W0S$mWfF(h zhMa^p90{k;GEm;Ad*Q)I08Ur{i4hQ+6bMvC;A4$NgIO|JYQ#ijFAfT1)Z&sNDYOBsiRrL_5rm-5o<|$N0qp^y!HP6Sqb=Q* zRQ-Z$0agkR=$R?cjVKZHx!{Ekw#eyz))GPpBwHq9jW#+1o-wuzVazVK;HR2++B}cc zSE{xRjL~-?80|eysxDFR-L^V{_*AKGU2xcHLjK%Ym0N&L3KZRs&=G3+6tgHS%L15fxiT|t04Gsf z*m;N{3qbx1vH(Csytu&OwE?(F3lP_tHh}Jh<2vSDnjAf^4UkecY=}FHCxT9zgNq=v zD?=iR+5nUCWs59Q(jezKB?>ZOy@#&IVKe~|E+r4~B=Q^XrCCik8#$q%*KG)ajB{rd zZUM3<5S*69^T1i$ESmhr^K5?MPt~HtgkoM~6DPF<2kC8PnoC@BM;73^>|TI!jb_W@ zQ4QRexz96qII;63p2R|%&}B2mv4iE+BjirHkDQy zN*+v64Cd+G6z&CjP%n8K0Ah^#WEZg$96n0h98DGwQS+ zA${l?DvZ&|VltTM3XWP}{8MuaGLTRtMh9#JC%R4d0(Z%pfw@37v&AVuXH!KXXL8^3 zY<>YDdCqe0P2LIc8(hNm*!)E4TApkXLOwSDsE2Gi=W9ca(3f%ur1kRmJ@MU_wy6Ai&j>nFEN|Kvl@L)W(vR5!r80yJjm72 zQ%r=pzD;MZ&f5(b__@k?y@T5vP@PAP_`uJt^HeEx)`2=dg2Ns9lQ@xSVzhBB8hsOY zu4G&xJDzjv8kFD!DYlJbX!7UP`5vlslzn&dSDIJnk<19sq8Rvr6y#_QOkhT`EEArM z1Ny^Jop&7pOOBI?OJcPxc&3{TaACm8c%zRAsD*C7l!(rqO>hf{g8&VMjUXhI$t1~y zcrz1%02@a-K%`1OPmo8YBZ-lmjhQf=GYdcxr4F4TJj(*OFq0HOX`1jQ>#|o8xRW8z zrfe|kwN0Gp$hdlMorkyj5Di)y)Y};nwZ%$z`%+8{{k<$ICg?6&kk6Ay>3qDvr~jS> zSR@I8O*(VPRk{_IbdoUcr;rpIA?#fX;Q8ti@hW>2r&Af06ox2_26mE((_Fe-Ia;m- zv>*n9d-O1T0SG>KGWRJ|WnULMFboy=(4X1J0S~iC3t4jGB^9$TINa*Cm?Mv`&Z-nc@AuiNd7$D|aeu5ZXYVg#+2G zL?MD_5IHg3N%08L!U8U_PMRCr@&_n@vi}mCNS1C&rwBU|CXp!HM$JZuZ0Rh4U^F{W z!`#O6n%aku@OgN`@qr)aptv)eNQ?$XYH)gS1}mQ~$(9LFOfD28hS%>yNgIJs>D<{E zw}2>^m<<|o7PxVO5S}!yOBv4m`KFXZz!0LkMY z1@9#$IK5r~ad6K#@~h!wB+BMjw!}w%j!1}ta@qhI`RP=gCjUp_fzXmf)=@${i}R2C zu6R1twTL8Ka28Q|xy=?gAwgL-4raG2FU%|WuAQOZb5by?x zp;FP0?-Od&ax1KHo#i|l6yc1qoD;Lbc(qP zK=h1(7JwQPXra*Z(E^Z8xw$-)vj9|2PXmAj+%g;~_EHOgW-kCylxo{(C{6n^Ba|*! z2pPn@Z<~F$umG_DWMKhFLK_g_7GOZEbb&y!?xSK?nQ*v_oJSM+GK3%pyd;PU4kY+@ zC$7*HtW?SI4GO$KPza6O=9%XwCgXeMv6K7I3EY3SiR1g_-H{M z0a=RBM=`_cd?+H?fEFxba+5#`$TspZV)7Gi!I0uhfR|ZmiZu}dmH>NT0Vx9(pcnDn z6Mpre)OZ_U*y>9Rz61y{78)LtnT#(1qS+t|kZj%tTrNg01@jz4(SuSt4+S$8Kx>e= zOEsyMWzlfL#t4aqe73|a)wKZKN=fP<=v3QLc^g0@!3#Dkbr|&m2Dbp-Qh=R1OJtG} z9wNjPC)c<6nQ+K;mV0ad*UbM(T6Qmhae!@87)7{>;YwHlg`o}LC$dwUU)j_w@Y?Ui z_~!qpdtl`MnO*?QSR7nvFTj(!=-~lbxcmdn|9Reddbzy-4}!-5f_ZWqwkgyU0PzB5 z1$u#qJjLdu*T<91@h4+Pqc4h{(Y~QxP<7>;a!9^LdRV?F|C9W<@+$e8ni=_q@k*n@ zm^B7tzlciu540|&5swfr$B!$!62FbTMth(7QFTy$sr-F)nSQHsTCUTct#8n7jsGn4 zC-M72uh3o-T9s&t{%dkpdQ|;w{H@W6@E1bw2!BAmOL>p>fc}vBmc-k&6Vlt{8Rb#+ z{mFxgc`~U;DPa zRSqjL<+YI$k!IuLk$;F(MgB4}62DHnLGKGc9o`*!BJ{yo4a zcp`SY_JI25YQ6F|@|1qHUJ?3kcrx*w*bB8csBcqODespZT?@ZD@o@YR?M(PBk(WgF zMs)p{-Ws;UU7_EE4^z4Lo%9x#%DlVE-iiB|_)QRdM+9&F(94B0?Cn^uQ_A=a`+H4^ z%k14fs-rA$kG6t8CSY%sr^=Of*|(_&dpNGtrhk>l-dC(N%Q^d<;WhPweDC6l{hgow zO)6e9NbCOrKfxoM^Zm8T=6UxTV{eQqRa}pWS@zeYq4y>X`zy}%V zT+hCGMY$g;oS8>kl;MTEO2%H7RO-{Zv>j)E!S#5pKa+o+1M4MD_8LFgpHYMqDXi5e z2}OEAlYJtM=g0jrKGv-4TfpnR?B!euyquR`!Vju9GJ|iVb4Bbvb;a11sNZDT&3@sZ zO=seMp8kD)l8a!CDb?Oa66}j~BlaG=jeQ}V_0L@~{TGEAkba5M>WLwX!DbfhYh}tx zRGkUFA)foA#oO4wWlZPpB4r6I=kS4pL;d)D-S)lg-xq2QFVN1goPz#VTHEJo570IJ z`k8&#pXYOFSe~v?Hp&Czvwc%1Pfbl?a=~X<>UpdXlsE!MQc` z1k>qhW&e2XI?8s|kI%0)o@Q&a3B)$H*}ufTh6*o7YTNOvo0VZ{ z0j~ug=upN%xA32R4=-14NHaXcue$dyRrVF8&H2&xzItWABP;xy?4h`_80PN&=6WyX zZ2`ZE-V@o&R*T;|?~YV4@eAf%`31BSREhMDi?3Rs>>ZJpu-fbjHHd(i`|I6-1q#_7 zZDsqih4dr9a(_X-typQ5a(~>~hv<4y(7eU!#eI(P^i(SwJtXsYX0{e+5nH2gWtQLI zC_&%8%3Cs)CmJwphr5{!-rLY?6E(;isg~pnr#4XV`hxBBI%U6XF4 zyJMxfSzf(SxnqHCv}k#FEVPqy)#1x*d+f7p zN%jtXZG>9h+u$o}l+9A#Je$t0$n zN&L^)`n)!!31MX-%-!t(KOk(R_9`>lKHiW}>eKyf+wuAwsU~Ufb^wdXPP}ffF8&BB z6{6FIRGV!`H3^wT#Xh0cK7e`&d8p#05>I%!Px^A7NbbqCuXq9bie1URq8a;&5R^tiDD^DU z3qx(!^fCh|E&0}5EY;1**#%;`U;HpHd-$Ya=C~)Pu02!jq!pu@9FDBoNsGz%sZX-x z50YO>elq#KqM#N&xKC(dh?T3=#+!i;}E z{=WF#;jf0@8-G@OI6kPqF%*ig#}?34+Na`)xDxw$?0d1V#{N0>SnU1bo3s<^FT)pN ze;s>i%!y5f8)G-b24ZVtt+CozQA~>dF#4tFC!+6-J`{Q~bYG}QdocPc?Vjib?cbue zgw94!hD)Q@M|<@X(Peslbg}wmcraQVl_Eckd@1sY$a^CXMP90(*VjkRN2Vhqp&x|a zrTumI`pBNp>d1!3(nt|@EBJTgGseUEOZA<`8$+)%9t<5c?lm0awEjW;o!G;$O#Qww z9-1@`7=1>UQIBsL{8s88ydMq@c{aAZge>~LWpRora0RjO6f4m6L-2LR}ZAZor zpPoEDGd?Dj()?0%mr@B`i@sG#5oLA@DJ7OE*XD$@_uo2x6u;z6Y}@h!;?xdf*9@9quvbu#xN9Xj)|=j4fxS2Iq+$-;!BS@R=!X8J9i$}uUY2Y9BI{g&UEqw9C(DE^%}WLi7T$wzvA>R(!;XC8%V(bv71 zrt|Z~p1D$F=anLhs+G;gd}14v9R-riS%{`qD4U(V%@^`|U&sY&n6kNU%MZ9NKcFW+ zV0C^#bACW6z5l<7y^AF;C+|z{PDT=+PyA(KJh3kRUha&x5Dc*=N_v04A2{x|xBzApT=@XN!);U)O)-}~?tfW09_dqlfMGt@7u zZ&0Vz^~x`lNAO0$D*n~Kak)%-RGO2vvY#X2|3A0I5!=5@zWtsh8GDjNwCu*!+hMr1 zdSi754vO36i2dFr-=5F3kK#|l{RN(!xVt_Z)tjr!s++56*JsP2joxKR65Bp!ZAc{H zU9Vq9w4Byg2)Lz+U8s64d3@vNEzVR%gxKPf3WZ^#sNZrCIeoqmakOf->NpO*`SV_9 z(iM=u`!o9u7m(BcqC+XP7yj0&k*WhY_^5ifb5cn3?EuaGQ>cU;JD*`M^qQ(oRh>9! zezMLvA>`36&;SdLXA!#={hEWl9VOzGl5AA5d#Wm`7FAI>ZE zq1n$lI^J_K&;BZItthLg;rl|bb&k2ZV3S>4YWd&-Qm(z4Op56^CP zu)j45Ls^`=V>-&@r^KnUf%F{6D;lGuv!u3U2{w;9ae9q2PW*=C+mf37B+h<}{W@t= zUw6i&rL?8dR0aP6TbDBiMsKqpuCu4|kK?(U{Un;BiSon@o)xcgj`GxuR^N_;PsiC) z?la#$F@4seRncg)GD@?rr4CAsQY*rSfJRnoMeHf0)^oiPiyAR(k9@N;N-0Rv#!-P| z#zub>W8W>G?=if)DSdi}`wbfkJgi?vUp_Fl7<<-l*}LV~`0UYsXN0F_ELoY88uoPi zVT}DCl0B8A5tcWtq|XC1w_EMqIEbdlIV`kZ>D$`v2VCp?mmA!T+>CZ(Q+fN6_6fZE zu)}$_(52q@Es*cW*!QsKl{bkk{5g=i;*G^!IEZeY^DLnceGf!9uW-M|^>IteQ=`~e zSzcVjS=*gMoK^R4Uh~};`;NQIc>-U#q+eCgwAW@5I=*ixu}h5m?{eB)&0s z0-vnxa;^tYLF@Z=EYJFeJnLKT9288ozFj5%Bj)W+j;~Xe#7M0^=Q>X9-wvI9E7pJ? zJY@Ik{+WHGm4Bsjz`0gP@$LG}{@pJnJ>$=;0`P6WsqXA|t`U;_pP%`rU(z#;A@z0q zqp@wy)ews6;@<%48&NE9h!2JJ)b=dGL6&Mc2LywE1FWw{+1KXX0BiT!-Ca0nirnK2 za}fnL!1@}}oPPtX-MzcZcQ^12<*st}3pM=vseKhP^d0`S4$*{r8|W47T(h$Y-!CD$ zNoSuB=HE^0D^a{g^k47=vH|w|fjh|K+tc+pLn1-{ZdzaF3FfW8P}4#CNwyF44Rqt6 z=-tjdy(QL{qU?(ijowaa>|ffy z+1V`!{rh2kkrFPr9~Qo1Qq*7HPj6aAMc``mwpiFUK+ci%yt zYogmlf_@YIXP)4ECfeQC-Hk(-Xum+wZ=#>$C@#Q6yV--?<=rd0$wZr-Z9*q}EilhS z|0&8o8`1c5y>V6Zs?AQHp!D15XDQ`^HoB^HRne;YRb-=WPA~Bn_!Knz4By3^-V?)D zCpMR~RkY3Erp@UQ3Hpun(^2*b*GL;{8yDdaMrsKLzmfi9lznPmBW+!a5A&{V6-K(1 zizr~EpF*1R8)<8AYk6x!D;eoBXNyq7zY*T!QTEA*<_%gKmo8hn+1V_J{iuGD5-f=7 z(iKaKmewyNR6Ctb#9wGDyiX9SURv>n`0|p5MGfPaO|&^1MVfwKKOSWtF0@1A2EpJ5 z_OU4Y*u22juC49DA%I=aMHB$`V@Pv;U~7BveZ~ghBom2`CC(;R#-EHo7~dZI zY3#MJu~=#JgHb2CJ@V_wWM|2C92C1{PVC_B|K@|#kd*4@*;%}uEmz3kvALS*du%g#7=kDn4TcwfAq_jA_#c&a}81_E>F(>wL_kYD#TAY;X zybZyV+S2r=Kjvr`_Ckv^Qe854ktW{kefs07Iofv}-|@XRf00J2P5PEy(l7C3-qzu7 z=|nrkmp|rc+jR)@efdMGxstH#7k=>N4;o=Do1;zFk(p|rUe(D4?}s0Hu}<)|&xsA! z4c`{~(xQY^mAA!yOKNp$%bdI2x^IhpsVX5=&SL_pchcxfce^f9$JGNm1)sD$y{P{rr9rY{gJL_p#px1G~eD3=+vJ{C+ zp@LSyE-Yp*U(8-aK7X>f$DyyG!@kAmk+UC88eB-`RjGMEJGPiTZ}D@<;~z-g>)a{? z`b|ye0^PNpVV-x)zON=r3ePnyiu$r# zds}T?ZG9~*k`hKz{5RPD@Bhw#Ey!trK!8AiK!8AiK!8AiK!8AiK!8Ai!2dl2&Yey1 z{r{4*ksvwR#m@5f|Kr>2QN#$sO`L_h%ulM#iLtTXc{dJQ9wJ7iJ?cmdT*%}nc0W$o z4i%d|TIo1UJ9(sv4f=AN$+>ASKkQ050tPtY_wwr^^2L^(HV+`5Uzzl+CdjoL`Chwp z4Z;*{X^HKO;Wh9NKs3;1h!DS{iSGoR;>xyQFJcoU*o+Z-FyhbKSukbmkdEyKF0QgKs9NLTqufbO_?Ucj*X<4i5*CZIz*mMdw{x*_5jUu5|p_}3YnA?iU?rRex@i& Oh+568O6&kh(*7SD>(z$< literal 0 HcmV?d00001 diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json new file mode 100644 index 0000000000..6b6114114f --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9b538ebad69051f86689708a3c34f11e6e486cb2 GIT binary patch literal 90112 zcmeI5du$`edBAtI6e&_7hdP}^yMlA;v#%0+w-VovyBaNzqIC4>btHB6L1l&I?(oD| zqGXafTdfO3cZu8BfPpkckUtXi0km;}22I)^O;MmJP_#weM-ZS7ByReTi^46?21wha zhWkfn_PtB;DC-=>2YMx!a?7t4pcwY{AMTyHcRoyJ~sOa0osz1Y~n zMR}{(O9Q6@#M3%+AUw@XE*KDR>Mb=eorV*)LiPV=Bl`h zdn*?hpq!a=fJ#)b%IDXXmuXv9*Yde?A^eG_#ylZGU|$hBVr>UIo9?{!Ysyq|SC2)og)+aX=O{Egjm}|p)`%cQgv~6Z-!|44C#n^TzPI61JnrSH;&IMg&g)UT$2pTp{kq3FldL{-43E<~w3p6ZmSgic zrQX2?^I-O(yS24Zy1m=9(FG0T)g!w6zqgZD4)@6@sgG286}snD8oRjN5qI~iJRLkL z#T7D=lJSaKqTuy}=ELk=q*$U}EiG@026}|5m{050jn(3f4dc$E%NUs~=B1};4I}p$ zJw{d8F_0LkH*u>?9Ib2QzsrnxLg6rb?}}oFdSPnu_A9U52JML!3)B;=opcP#Q!T?# zSZ$6u%ti)|vU%i$jEnSj(ip`)T-{zX&L`4;vTI%+7!r{Z9r)Q+IF8t zOb%P8MP1cWD!mnU4^Y_5IY7By;KTQ>xzs^AZw}HHT24KO?GEBhwz!Bh>13{=>TFv1 zF=irt`@kIQlyQvCr|9PdQ-TK@;frm`rpjL}c25JB#dc?{*2b+nm`sbzkyo27@(YE< z+{SW+mkwHr$9D8#nmG9$=Ltop*`srco0M^<(`epSd|I1tt1&LSJ$1_|W~5B_)eQZd zHoQLM4qd#+-cl^5{XChY;jK1){s1@0tj&JO+3d!VINKz~e~IJ_A1$$-(DXEW7b|6I zx@kX#Y-Ma}u@;llVouG{Zi+hxq#qsDxk1)y<32wL-D9sZ=xy|M{|$fEKSeI!0|bBo z5C8%|00;m9AOHk_01)`$5;z)h4>S3rD%m{xD3&_;y=J{}`=F)lN|(t>vmxQ1rz_g? zn!weA#*S>0YM;N%Z&sD9!Sm&g*yr%TA$=xK!1AgBxJU;AV^5YA* zc5u5Qwr=B2dxNZXwRKzjIzHU2PPtsnJSx)DD^dsD{?G3nG&|9cKgSI-S3Y@>u8@^f z^~9#E?t!->+DD*29f6S+t0fXyxtnAWadZXiTohlQPEHtRQD&(U_E!g={)0 zl9Gs|m`=upSUs6Z)#|l+B%K!Ix|B|4qgf#%i==h6ge27DL{f;Rl5(sj)l>CURKRj3 zN|>jGcqEw=5-BMvWa~IWT9=ZfY%(5+M`Rwnn-ICxlup851IzNF)}C zNLewJ66&$ITuatsLRyYw)V>qbk*wBtwG>XoC83^9N||&mBFJ)*z^tbtLN-PEPLk_# zB$Xj8kHv_Pj8jn@BkIanNZ^<#h|xG{M=TbtMblYA9?uN97$Kf-VX=edwbsVIOut0Z z^O5L$EE0?Ik?iG2^m05g#k!c8P??;-?26j1Y;-O@m!#`|7y1f={tJBvy+OXf2M7QG zAOHk_01yBIKmZ5;0U!VbfB+EqKoB_V;sjQCZpHFoB^u|ru$OE_DUau>4~?B2(giJ# z%1n*2+%&80Wx0K%MQ*gspl_pJLa(DgM%(DSABaYR5f z00bUF0_V6qt38Widt^m>u*FT&@AJIL@FX|Sc0Fw3n&z&seI7L7&XTpi^TB|jAUET+ zJp@3{|EK)d81x_Lo9GYFFQQ$vfo4!3@Poh`f!_^$CU85j5=aIn{r~O%d;iz`pZD(& zVfX+6AOHk_01yBIKmZ5;0U!VbKEwphPq~?-*X!2Sc>1pj%zd=I*BtrQPyY73Yk!)Z zpL8>8jMu%5(AG{eW{zW95Oo^>-%*fMPE zNz)TW_}9MD%hj zRb2GBnI)2EowT_#sDeqao0&F*jp9QiYQ1V1mclQ2+)Rt-gH5%=7kwqlcu z%-_)S|Ea(g2E9Z60>HP>SI}>w&!Pi#8*QR&;0g+(X|faWcHqsxp9j7a_*~$Xz|RFL zA7VF$rUL;W00e*l5C8%|00;m9AOHkDj07IxlKPRhZM$RY0=LEv+~b%;+!Ge5?X%zY{;|x6qx5p95aeCIR#+sWI!7=VJEpl!f1-Qrc3z8x51b3a)_YnGQ z!ub8%IYVZ9jH;{WASH}G&MlGF-)F1AH%cC}S0%Q+v@CN|;XGGl@4u7ap~~yq2X3mo zxo0r^B)7sE3;#aayJ#LmXqyXi7tBkd|B#!T@REH1W&Mvn&7l87KS19jPXWA*-a`LO zb^`tmeS`cxfImZjg8m476@3}~4*CN64fJ`kJMifbqp?GqfdCKy0zd!=00AHX1b_e# z00KY&2)xe(T%4Dka&ZhhNdxlB{tP=ogEKT3r$LYghz0=~_-QakgHamzXyB#62n{?m zaMNIz1}++KG#KJI#;czHUtrMxqJKsIfWCx&4gE4|qAgTH^MMQKBM1flJ@Df00e*l5C8%|00?|g2t4XadV3%B|F~<7v7FlX zIgFkRx}LC#ZJ#~knz2TZ1L=vgu8WN0Xn*_6lxyA@No2<-U4kBMIq>(p9@AsVi9d2Z zZd{Q(fhS$p8RG=MkD~s7>zpaHJ*MbwJ@r5DT4Dwq`;WP%b&+kaQl5G6|Aec^=qLGo zRPZRRFpmC}R#?vdFSu41^B})Z87?K4<@A5tb-|L09{+n>6AV57r@#NtqQ7LwKllIv zAOHk_01yBIKmZ5;0U!VbfB+Bx0v~h&N%DffjhW-T$1s|ji_FEN(P(Tg7N_U`EP8_> z|KI}zfB+Bx0zd!=00AHX1b_e#00KY&2z=lPBwZUb-uJxzr|17D@I40oC;BJy`~F`; zzlDAU-9`K8XVEgcjAqdka*<^C00AHX1b_e#00KY&2mk>f00e*l5O~N41j)+_STE}y z;ppGMKZ-xL6(p}MpfSU0Oziu`AbDK@jX9&md?OJgZzP~G0WIeBCxhfw1T^NX7W1)p zgX9eaG-gPPx%F0%yk>yLOlUE&zYUT%4A2Iaw9Yx_s}p%wl!GRJ50k-7Yz|dL-&x2W4&Ya{GSOv zoKQe(AOHk_01yBIKmZ5;0U!VbfB+Bx0zlw+1nBuctpAV43Z#Gl5C8%|00;m9AOHk_ z01yBIKmZ6ltOQ{F|FHHP=nVvb01yBIKmZ5;0U!VbfB+Bx0zlyS1mOAq`|8M>9?pG(`_#}o zL#3goAJ*1^-aiTgt}ln45!j;}ji!uWEFbRH_I4IJ)R>V3(ZPWGg`GDCNU;2k#mPolz7eZ{|J;%jG>ur2bjjd!c^= zbfNs-&cSZ8Th8wbAI*tDL7{LGG}t%ax6aQ z%tLIiyY_1M-iA-{xRmKJ!vii(1JWlJ-UOIPKj?LqgdIuZK zgV~Gj*49Sp_HNTg7c`7lkLdFM-cDXQ+$W=?K2qsb=$=<;?BaGu+}*G8bnvJYSI9_8 z#w%)xg4Yw853_fXVu^aSw7e}E=n<-7KCN3fR*N?_j607mV`Q?Jm!76IjND`N7*%D* zKw_lc#H}`Qw62l=E;Hf@g~RNh&5;Jx*rYWtTmkP(jeU%xTD5>tYKxJ6m+vcBYN=>_4ZJwFFC7I>qROq1WB{ z61klzDmXJxTRyt#_Jp1zBj2Gp@>#r4tGYXFBBGY8_N}5 zI%p{#+tG(<;^cdrClsA#kIpG>QpTN5qj_8LX>Go(#<=YE)Geo&kuu#^GxT%X@cNKD zbnzm4OR=2x^JI>Ox7zsm1KcFDHv1)Kvl~a^Y?B!OC6Y6Iw8VNs)6?u-tdyzgru`VQ zm9eSCT1-xhIW&w?!Ry?bH7d^PyO?9 z@T_N25Jp~o=1v2@Kc8|7Kl3v)Jo&LcXEc+v!`kZ3 zwwYILpQ9_O^tvfiTwNur(5K0|vx@|kTr87iy(vu^)1#N3vg$(z9UVIva{NBMcgu4> zamk@~+b|5j?|#Z2M@gb;Ki#_fh#2TKvP|x6EPS!7Ok|H{Cp@9eFne^%F{@Y*J7V8e zkjaONP1%Q1dt%=*dfujKade(m43+kT zlZ}{W8HTFnEmpf>nZ|X3+w23by!FYlwRQS3$9C7(1=VKUZztt`D=G6fFnAt+f@zI* zv#AuGwQn3%#MW)x>2(+Cvs07bYj*I9$H_q#4zY2v>kzl?Iw;e_60T!17)W@__(ttP z-*_}_!$>~c&shwK-bM9v7b6epE#teY09i1^f`gP^!27rUTHog3-x8LhI20Pk&-m-M^ ze1AtGvpFZ(0yJ=I25Rc|qg{yD^r92ODsK!geFl#o;%H;+JlXf9v^}RM10Fd1DAF?> z%h2LHwCKB1gToIv{5a80#{*8m^mC05-{A-R{{N|OazKSZ00;m9AOHk_01yBIKmZ5; z0U!VbPMrX(|4$t`R0srs01yBIKmZ5;0U!VbfB+Bx0zlx@3Bcd~J9XqxArJrpKmZ5; z0U!VbfB+Bx0zd!=0D)5{0O$XwjvOik0zd!=00AHX1b_e#00KY&2mk>faOwp9A7gDo Ay8r+H literal 0 HcmV?d00001 diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.cpp index b88b2edbd3..ec43c1fc8b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.cpp @@ -52,32 +52,6 @@ namespace ScriptCanvas } } - void Contains::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Contains::OnInputSignal"); - - AZStd::string sourceString = ContainsProperty::GetSource(this); - AZStd::string patternString = ContainsProperty::GetPattern(this); - - bool caseSensitive = ContainsProperty::GetCaseSensitive(this); - bool searchFromEnd = ContainsProperty::GetSearchFromEnd(this); - - auto index = AzFramework::StringFunc::Find(sourceString.c_str(), patternString.c_str(), 0, searchFromEnd, caseSensitive); - if (index != AZStd::string::npos) - { - const SlotId outputIndexSlotId = ContainsProperty::GetIndexSlotId(this); - if (auto* indexSlot = GetSlot(outputIndexSlotId)) - { - Datum outputIndex(index); - PushOutput(outputIndex, *indexSlot); - } - - SignalOutput(GetSlotId("True")); - return; - } - - SignalOutput(GetSlotId("False")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.h index e2756f6ebf..d877972a1a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Contains.h @@ -29,10 +29,6 @@ namespace ScriptCanvas void OnInit() override; void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; - protected: - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp index 1b71390e0c..d05f2cd5ac 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp @@ -13,20 +13,7 @@ namespace ScriptCanvas { namespace String { - void Format::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Format::OnInputSignal"); - - Datum output = Datum(ProcessFormat()); - - const SlotId outputTextSlotId = FormatProperty::GetStringSlotId(this); - if (auto* slot = GetSlot(outputTextSlotId)) - { - PushOutput(output, *slot); - } - - SignalOutput(GetSlotId("Out")); - } + } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.h index 6e5c50d2ae..2fd606a422 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.h @@ -23,12 +23,8 @@ namespace ScriptCanvas class Format : public Internal::StringFormatted { - protected: - + public: SCRIPTCANVAS_NODE(Format); - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.cpp deleted file mode 100644 index 26f3716b6a..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.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 "Print.h" - -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace String - { - void Print::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { -#if !defined(PERFORMANCE_BUILD) && !defined(_RELEASE) - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Print::OnInputSignal"); - - AZStd::string text = ProcessFormat(); - - AZ_TracePrintf("Script Canvas", "%s\n", text.c_str()); - LogNotificationBus::Event(GetOwningScriptCanvasId(), &LogNotifications::LogMessage, text); - - AZ::EntityId assetNodeId{}; - ScriptCanvas::RuntimeRequestBus::EventResult(assetNodeId, GetOwningScriptCanvasId(), &ScriptCanvas::RuntimeRequests::FindAssetNodeIdByRuntimeNodeId, GetEntityId()); - - SC_EXECUTION_TRACE_ANNOTATE_NODE((*this), (AnnotateNodeSignal(CreateGraphInfo(GetOwningScriptCanvasId(), GetGraphIdentifier()), AnnotateNodeSignal::AnnotationLevel::Info, text, AZ::NamedEntityId(assetNodeId, GetNodeName())))); -#endif - SignalOutput(GetSlotId("Out")); - - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.h index 0f971f99e7..1c16e30cd6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Print.h @@ -8,9 +8,7 @@ #pragma once #include - #include - #include namespace ScriptCanvas @@ -23,12 +21,8 @@ namespace ScriptCanvas class Print : public Internal::StringFormatted { - protected: - + public: SCRIPTCANVAS_NODE(Print); - - void OnInputSignal(const SlotId&) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.cpp index 56a7ae2ef8..57e2510baa 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.cpp @@ -51,28 +51,6 @@ namespace ScriptCanvas } } - void Replace::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Replace::OnInputSignal"); - - AZStd::string sourceString = ReplaceProperty::GetSource(this); - AZStd::string replaceString = ReplaceProperty::GetReplace(this); - AZStd::string withString = ReplaceProperty::GetWith(this); - - bool caseSensitive = ReplaceProperty::GetCaseSensitive(this); - - AzFramework::StringFunc::Replace(sourceString, replaceString.c_str(), withString.c_str(), caseSensitive); - - const SlotId outputResultSlotId = ReplaceProperty::GetResultSlotId(this); - - ScriptCanvas::Datum output(sourceString); - if (auto* outputSlot = GetSlot(outputResultSlotId)) - { - PushOutput(output, *outputSlot); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.h index 6c69818ac9..db31a85a82 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Replace.h @@ -28,11 +28,6 @@ namespace ScriptCanvas void OnInit() override; void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; - - protected: - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.cpp index ad36615e26..959b8ef3c8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.cpp @@ -31,108 +31,15 @@ namespace ScriptCanvas } } - void StartsWith::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::StartsWith::OnInputSignal"); - - AZStd::string sourceString = StartsWithProperty::GetSource(this); - AZStd::string patternString = StartsWithProperty::GetPattern(this); - - bool caseSensitive = StartsWithProperty::GetCaseSensitive(this); - - if (AzFramework::StringFunc::StartsWith(sourceString.c_str(), patternString.c_str(), caseSensitive)) - { - SignalOutput(GetSlotId("True")); - } - else - { - SignalOutput(GetSlotId("False")); - } - } - - void EndsWith::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::EndssWith::OnInputSignal"); - - AZStd::string sourceString = EndsWithProperty::GetSource(this); - AZStd::string patternString = EndsWithProperty::GetPattern(this); - - bool caseSensitive = EndsWithProperty::GetCaseSensitive(this); - - if (AzFramework::StringFunc::EndsWith(sourceString.c_str(), patternString.c_str(), caseSensitive)) - { - SignalOutput(GetSlotId("True")); - } - else - { - SignalOutput(GetSlotId("False")); - } - } - void Split::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const { ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap); } - void Split::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Split::OnInputSignal"); - - AZStd::string sourceString = SplitProperty::GetSource(this); - AZStd::string delimiterString = SplitProperty::GetDelimiters(this); - - AZStd::vector stringArray; - - AzFramework::StringFunc::Tokenize(sourceString.c_str(), stringArray, delimiterString.c_str(), false, false); - - const SlotId outputResultSlotId = SplitProperty::GetStringArraySlotId(this); - if (auto* outputSlot = GetSlot(outputResultSlotId)) - { - ScriptCanvas::Datum output(ScriptCanvas::Data::FromAZType(azrtti_typeid>()), ScriptCanvas::Datum::eOriginality::Original, &stringArray, azrtti_typeid>()); - PushOutput(output, *outputSlot); - } - - SignalOutput(GetSlotId("Out")); - } - void Join::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const { ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap); } - - void Join::OnInputSignal(const SlotId&) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Join::OnInputSignal"); - - AZStd::vector sourceArray = JoinProperty::GetStringArray(this); - AZStd::string separatorString = JoinProperty::GetSeparator(this); - - AZStd::string result; - size_t index = 0; - const size_t length = sourceArray.size(); - for (auto string : sourceArray) - { - if (index < length - 1) - { - result.append(AZStd::string::format("%s%s", string.c_str(), separatorString.c_str())); - } - else - { - result.append(string); - } - ++index; - } - - const SlotId outputResultSlotId = JoinProperty::GetStringSlotId(this); - if (auto* outputSlot = GetSlot(outputResultSlotId)) - { - ScriptCanvas::Datum output(result); - PushOutput(output, *outputSlot); - } - - SignalOutput(GetSlotId("Out")); - } - } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h index c1dad1f0e5..c325414ca3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h @@ -24,11 +24,7 @@ namespace ScriptCanvas { public: SCRIPTCANVAS_NODE(StartsWith); - protected: - - void OnInputSignal(const SlotId& slotId) override; - - }; + }; //! Deprecated: see class String's reflection of method "Ends With" class EndsWith @@ -36,10 +32,6 @@ namespace ScriptCanvas { public: SCRIPTCANVAS_NODE(EndsWith); - protected: - - void OnInputSignal(const SlotId& slotId) override; - }; //! Deprecated: see class String's reflection of method "Ends With" @@ -55,9 +47,6 @@ namespace ScriptCanvas protected: static const char* k_defaultDelimiter; - - void OnInputSignal(const SlotId& slotId) override; - }; //! Deprecated: see class String's reflection of method "Join" @@ -73,9 +62,6 @@ namespace ScriptCanvas protected: static const char* k_defaultSeparator; - - void OnInputSignal(const SlotId& slotId) override; - }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.cpp index ee06418e68..f9afd2b80c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.cpp @@ -38,28 +38,11 @@ namespace ScriptCanvas } } - void TimeDelay::OnInputSignal(const SlotId& slotId) - { - if (slotId == TimeDelayProperty::GetInSlotId(this)) - { - if (!IsActive()) - { - StartTimer(); - } - } - } - bool TimeDelay::AllowInstantResponse() const { return true; } - void TimeDelay::OnTimeElapsed() - { - StopTimer(); - SignalOutput(TimeDelayProperty::GetOutSlotId(this)); - } - ////////////// // TickDelay ////////////// @@ -85,56 +68,6 @@ namespace ScriptCanvas { } - void TickDelay::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - AZ::SystemTickBus::Handler::BusDisconnect(); - } - - void TickDelay::OnInputSignal(const SlotId&) - { - m_tickCounter = TickDelayProperty::GetTicks(this); - - if (m_tickCounter >= 0) - { - if (!AZ::SystemTickBus::Handler::BusIsConnected()) - { - AZ::SystemTickBus::Handler::BusConnect(); - } - } - } - - void TickDelay::OnSystemTick() - { - AZ::SystemTickBus::Handler::BusDisconnect(); - - if (!AZ::TickBus::Handler::BusIsConnected()) - { - AZ::TickBus::Handler::BusDisconnect(); - } - - m_tickOrder = TickDelayProperty::GetTickOrder(this); - AZ::TickBus::Handler::BusConnect(); - } - - void TickDelay::OnTick(float, AZ::ScriptTimePoint) - { - --m_tickCounter; - - if (m_tickCounter <= 0) - { - const SlotId outSlot = TickDelayProperty::GetOutSlotId(this); - - SignalOutput(outSlot); - AZ::TickBus::Handler::BusDisconnect(); - } - } - - int TickDelay::GetTickOrder() - { - return m_tickOrder; - } - ////////////// // CountDown ////////////// @@ -148,86 +81,12 @@ namespace ScriptCanvas , m_currentTime(0.) {} - void Countdown::OnInputSignal(const SlotId& slot) - { - SlotId inSlotId = CountdownProperty::GetInSlotId(this); - SlotId resetSlotId = CountdownProperty::GetResetSlotId(this); - SlotId cancelSlotId = CountdownProperty::GetCancelSlotId(this); - - if (slot == resetSlotId || (slot == inSlotId && !AZ::TickBus::Handler::BusIsConnected())) - { - // If we're resetting, we need to disconnect. - AZ::TickBus::Handler::BusDisconnect(); - - m_countdownSeconds = CountdownProperty::GetTime(this); - m_looping = CountdownProperty::GetLoop(this); - m_holdTime = CountdownProperty::GetHold(this); - - m_currentTime = m_countdownSeconds; - - AZ::TickBus::Handler::BusConnect(); - } - else if (slot == cancelSlotId) - { - m_holding = false; - m_currentTime = 0.f; - - AZ::TickBus::Handler::BusDisconnect(); - } - } - bool Countdown::IsOutOfDate(const VersionData& graphVersion) const { AZ_UNUSED(graphVersion); return !CountdownProperty::GetCancelSlotId(this).IsValid(); } - void Countdown::OnTick(float deltaTime, AZ::ScriptTimePoint) - { - m_currentTime -= static_cast(deltaTime); - - if (m_currentTime <= 0.f) - { - if (m_holding) - { - m_holding = false; - m_currentTime = m_countdownSeconds; - return; - } - else - { - const SlotId outSlot = CountdownProperty::GetOutSlotId(this); - - if (Slot* elapsedSlot = CountdownProperty::GetElapsedSlot(this)) - { - float elapsedTime = m_countdownSeconds - m_currentTime; - - Datum o(Data::Type::Number(), Datum::eOriginality::Copy); - o.Set(elapsedTime); - - PushOutput(o, *elapsedSlot); - } - - SignalOutput(outSlot); - } - - if (!m_looping) - { - AZ::TickBus::Handler::BusDisconnect(); - } - else - { - m_holding = m_holdTime > 0.f; - m_currentTime = m_holding ? m_holdTime : m_countdownSeconds; - } - } - } - - void Countdown::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - } - UpdateResult Countdown::OnUpdateNode() { // Add in the missing cancel slot diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h index 1809bece64..f859c9900c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h @@ -36,10 +36,8 @@ namespace ScriptCanvas TimeDelay() = default; - void OnInputSignal(const SlotId&) override; bool AllowInstantResponse() const override; - void OnTimeElapsed() override; const char* GetBaseTimeSlotToolTip() const override { return "The amount of time to delay before the Out is signalled."; } @@ -48,8 +46,6 @@ namespace ScriptCanvas // Deprecated: see TimeDelayNodeableNode class TickDelay : public Node - , AZ::TickBus::Handler - , AZ::SystemTickBus::Handler { public: @@ -59,18 +55,6 @@ namespace ScriptCanvas void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; - void OnDeactivate() override; - void OnInputSignal(const SlotId&) override; - - // SystemTickBus... - void OnSystemTick() override; - //// - - // TickBus... - void OnTick(float deltaTime, AZ::ScriptTimePoint timePoint) override; - int GetTickOrder() override; - //// - protected: int m_tickCounter; @@ -80,7 +64,6 @@ namespace ScriptCanvas //! Deprecated: see DelayNodeableNode class Countdown : public Node - , AZ::TickBus::Handler { public: @@ -101,8 +84,6 @@ namespace ScriptCanvas //! Internal counter to track time elapsed float m_currentTime; - void OnInputSignal(const SlotId&) override; - bool ShowHoldTime() const { // TODO: This only works on the property grid. If a true value is connected to the "SetLoop" slot, @@ -114,12 +95,6 @@ namespace ScriptCanvas protected: - void OnDeactivate() override; - - // AZ::TickBus - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - //// - UpdateResult OnUpdateNode() override; }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.cpp index c1e47e21b9..e7f9413166 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.cpp @@ -21,48 +21,6 @@ namespace ScriptCanvas , m_elapsedTime(0.f) , m_currentTime(0.) {} - - void Duration::OnInputSignal(const SlotId&) - { - m_durationSeconds = DurationProperty::GetDuration(this); - m_elapsedTime = 0.f; - - m_currentTime = m_durationSeconds; - - AZ::TickBus::Handler::BusConnect(); - } - - void Duration::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) - { - const SlotId outSlot = DurationProperty::GetOutSlotId(this); - const SlotId doneSlot = DurationProperty::GetDoneSlotId(this); - const SlotId elapsedSlot = DurationProperty::GetElapsedSlotId(this); - - if (m_currentTime > 0.f) - { - Datum o(Data::Type::Number(), Datum::eOriginality::Copy); - o.Set(m_elapsedTime); - if (auto* slot = GetSlot(elapsedSlot)) - { - PushOutput(o, *slot); - } - - SignalOutput(outSlot); - - m_currentTime -= static_cast(deltaTime); - m_elapsedTime += static_cast(deltaTime); - } - else - { - SignalOutput(doneSlot); - AZ::TickBus::Handler::BusDisconnect(); - } - } - - void Duration::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h index dd6c7868cf..481f0c97be 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h @@ -25,7 +25,6 @@ namespace ScriptCanvas //! Deprecated: see DurationNodeableNode class Duration : public Node - , AZ::TickBus::Handler { public: @@ -41,14 +40,6 @@ namespace ScriptCanvas //! Internal counter to track time elapsed float m_currentTime; - - void OnInputSignal(const SlotId&) override; - - protected: - - void OnDeactivate() override; - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.cpp index 62ed77ab2f..350a64923e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.cpp @@ -38,22 +38,6 @@ namespace ScriptCanvas } } - void HeartBeat::OnInputSignal(const SlotId& slotId) - { - if (slotId == HeartBeatProperty::GetStartSlotId(this)) - { - StartTimer(); - } - else if (slotId == HeartBeatProperty::GetStopSlotId(this)) - { - StopTimer(); - } - } - - void HeartBeat::OnTimeElapsed() - { - SignalOutput(HeartBeatProperty::GetPulseSlotId(this)); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h index 967376e932..680e974429 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h @@ -27,14 +27,11 @@ namespace ScriptCanvas void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; - void OnInputSignal(const SlotId&) override; - const char* GetBaseTimeSlotName() const override { return "Interval"; } const char* GetBaseTimeSlotToolTip() const override { return "The amount of time between pulses."; } protected: - void OnTimeElapsed() override; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp index 0465c49b43..b2cffe79af 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp @@ -21,49 +21,6 @@ namespace ScriptCanvas , m_milliseconds(0.f) {} - void Timer::OnTick([[maybe_unused]] float deltaTime, AZ::ScriptTimePoint time) - { - const SlotId millisecondsSlot = TimerProperty::GetMillisecondsSlotId(this); - - double milliseconds = time.GetMilliseconds() - m_start.GetMilliseconds(); - Datum objms(Data::Type::Number(), Datum::eOriginality::Copy); - objms.Set(milliseconds); - if (auto* slot = GetSlot(millisecondsSlot)) - { - PushOutput(objms, *slot); - } - - const SlotId secondsSlot = TimerProperty::GetSecondsSlotId(this); - - double seconds = time.GetSeconds() - m_start.GetSeconds(); - Datum objs(Data::Type::Number(), Datum::eOriginality::Copy); - objs.Set(seconds); - if (auto* slot = GetSlot(secondsSlot)) - { - PushOutput(objs, *slot); - } - - const SlotId outSlot = TimerProperty::GetOutSlotId(this); - SignalOutput(outSlot); - - } - - void Timer::OnInputSignal(const SlotId& slotId) - { - const SlotId startSlot = TimerProperty::GetStartSlotId(this); - const SlotId stopSlot = TimerProperty::GetStopSlotId(this); - - if (slotId == startSlot) - { - AZ::TickBus::Handler::BusConnect(); - m_start = AZ::ScriptTimePoint(); - } - else if (slotId == stopSlot) - { - AZ::TickBus::Handler::BusDisconnect(); - } - } - void Timer::OnDeactivate() { AZ::TickBus::Handler::BusDisconnect(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h index 58ba646891..fa5f4309ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h @@ -25,7 +25,6 @@ namespace ScriptCanvas //! Deprecated: See TimerNodeableNode class Timer : public Node - , AZ::TickBus::Handler { public: @@ -39,12 +38,7 @@ namespace ScriptCanvas protected: AZ::ScriptTimePoint m_start; - - void OnInputSignal(const SlotId& slotId) override; - void OnDeactivate() override; - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp index 301db76008..55eded5b2f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp @@ -15,13 +15,7 @@ namespace ScriptCanvas { namespace UnitTesting { - void AddFailure::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), &ScriptCanvas::UnitTesting::BusTraits::AddFailure, *report); - - SignalOutput(GetSlotId("Out")); - } + } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.h index 1c0e5a6fd4..88d7ab5e24 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.h @@ -23,9 +23,6 @@ namespace ScriptCanvas public: SCRIPTCANVAS_NODE(AddFailure); - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.cpp deleted file mode 100644 index ee9b8975b0..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.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 "AddSuccess.h" - -#include "UnitTestBus.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace UnitTesting - { - void AddSuccess::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddSuccess - , *report); - - SignalOutput(GetSlotId("Out")); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.h index c6793ad432..68f494bb72 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.h @@ -23,9 +23,6 @@ namespace ScriptCanvas public: SCRIPTCANVAS_NODE(AddSuccess); - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.cpp deleted file mode 100644 index 5b77bea492..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.cpp +++ /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 - * - */ - -#include "Checkpoint.h" - -#include "UnitTestBus.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace UnitTesting - { - void Checkpoint::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), &ScriptCanvas::UnitTesting::BusTraits::Checkpoint, *report); - - SignalOutput(GetSlotId("Out")); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.h index 551d250b6b..db7c666a78 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.h @@ -22,9 +22,6 @@ namespace ScriptCanvas public: SCRIPTCANVAS_NODE(Checkpoint); - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp index 019286355b..142ef9932a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp @@ -50,40 +50,6 @@ namespace ScriptCanvas } //// } - - void ExpectEqual::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_EQUALITY_IMPLEMENTATIONS(ExpectEqual); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.h index bfb5b4ffb2..623a928aa2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectEqual); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp index 77bf80fd73..c128f4c30f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp @@ -33,20 +33,6 @@ namespace ScriptCanvas } //// } - - void ExpectFalse::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto value = FindDatum(GetSlotId("Candidate"))->GetAs(); - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::ExpectFalse - , *value - , *report); - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.h index ca18f6f2d5..a50cba74d0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectFalse); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp index 28e2f7a8bd..ded5ae7050 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp @@ -50,40 +50,6 @@ namespace ScriptCanvas } //// } - - void ExpectGreaterThan::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(ExpectGreaterThan); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.h index d9d7f8630d..94219fab60 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectGreaterThan); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp index 7b782094de..6e2931112d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp @@ -50,40 +50,6 @@ namespace ScriptCanvas } //// } - - void ExpectGreaterThanEqual::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(ExpectGreaterThanEqual); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.h index 7ef46a9dc9..2607e2569f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectGreaterThanEqual); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp index 327cfb49b3..1ea4afcf5a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp @@ -48,41 +48,6 @@ namespace ScriptCanvas SetDynamicGroup(referenceSlot->GetId(), AZ_CRC("DynamicGroup", 0x219a2e3a)); } } - //// - } - - void ExpectLessThan::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(ExpectLessThan); - } - - SignalOutput(GetSlotId("Out")); } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.h index fb9ca5737c..bc8e70a3be 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectLessThan); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp index 3649816abc..2357ab5068 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp @@ -50,40 +50,6 @@ namespace ScriptCanvas } //// } - - void ExpectLessThanEqual::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(ExpectLessThanEqual); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.h index 577aa4f8ff..0408a58a35 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectLessThanEqual); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp index 6b5d3fa98c..1182d7db4f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp @@ -50,40 +50,6 @@ namespace ScriptCanvas } //// } - - void ExpectNotEqual::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - auto lhs = FindDatum(GetSlotId("Candidate")); - if (!lhs) - { - return; - } - - auto rhs = FindDatum(GetSlotId("Reference")); - if (!rhs) - { - return; - } - - if (lhs->GetType() != rhs->GetType()) - { - ScriptCanvas::UnitTesting::Bus::Event - ( GetOwningScriptCanvasId() - , &ScriptCanvas::UnitTesting::BusTraits::AddFailure - , "Type mismatch in comparison operator"); - - SignalOutput(GetSlotId("Out")); - return; - } - - - switch (lhs->GetType().GetType()) - { - SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_EQUALITY_IMPLEMENTATIONS(ExpectNotEqual); - } - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.h index effc011b5a..57b7d09a80 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.h @@ -25,8 +25,6 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectNotEqual); void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.cpp index ae0ec8a168..d7b2ca8cf0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.cpp @@ -33,16 +33,6 @@ namespace ScriptCanvas } //// } - - void ExpectTrue::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto value = FindDatum(GetSlotId("Candidate"))->GetAs(); - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), &ScriptCanvas::UnitTesting::BusTraits::ExpectTrue, *value, *report); - - SignalOutput(GetSlotId("Out")); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h index 6d94dc7403..12d28af093 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h @@ -24,9 +24,7 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectTrue); - void OnInit() override; - void OnInputSignal(const SlotId& slotId) override; - + void OnInit() override; }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.cpp deleted file mode 100644 index e7613695e8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.cpp +++ /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 - * - */ - -#include "MarkComplete.h" - -#include "UnitTestBus.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace UnitTesting - { - void MarkComplete::OnInputSignal([[maybe_unused]] const SlotId& slotId) - { - const auto report = FindDatum(GetSlotId("Report"))->GetAs(); - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), &ScriptCanvas::UnitTesting::BusTraits::MarkComplete, *report); - SignalOutput(GetSlotId("Out")); - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.h index 9f86fe5b28..126746019f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.h @@ -23,9 +23,6 @@ namespace ScriptCanvas public: SCRIPTCANVAS_NODE(MarkComplete); - - void OnInputSignal(const SlotId& slotId) override; - }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index ece0357626..058489374f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace ScriptCanvas @@ -412,37 +411,6 @@ namespace ScriptCanvas return AZ::Edit::PropertyVisibility::Show; } - AZ::Crc32 GraphVariable::GetScriptInputControlVisibility() const - { - AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull(); - - ScriptCanvas::RuntimeRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::RuntimeRequests::GetAssetType); - - if (assetType == azrtti_typeid()) - { - return m_inputControlVisibility; - } - else - { - return AZ::Edit::PropertyVisibility::Hide; - } - } - - AZ::Crc32 GraphVariable::GetFunctionInputControlVisibility() const - { - AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::RuntimeRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::RuntimeRequests::GetAssetType); - - if (assetType == azrtti_typeid()) - { - return AZ::Edit::PropertyVisibility::Show; - } - else - { - return AZ::Edit::PropertyVisibility::Hide; - } - } - AZ::Crc32 GraphVariable::GetVisibility() const { return m_visibility; @@ -552,7 +520,7 @@ namespace ScriptCanvas bool GraphVariable::IsInFunction() const { AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::RuntimeRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::RuntimeRequests::GetAssetType); + ScriptCanvas::GraphRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); return assetType == azrtti_typeid(); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h index b6ad7fcf30..90086ac7f7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h @@ -140,10 +140,8 @@ namespace ScriptCanvas AZ::Crc32 GetInputControlVisibility() const; AZ::Crc32 GetScopeControlVisibility() const; - AZ::Crc32 GetScriptInputControlVisibility() const; AZ::Crc32 GetNetworkSettingsVisibility() const; - AZ::Crc32 GetFunctionInputControlVisibility() const; - + AZ::Crc32 GetVisibility() const; void SetVisibility(AZ::Crc32 visibility); diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 312bd2679a..74e0e2e70c 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -35,7 +35,6 @@ set(FILES Include/ScriptCanvas/Core/NodeBus.h Include/ScriptCanvas/Core/EBusNodeBus.h Include/ScriptCanvas/Core/NodelingBus.h - Include/ScriptCanvas/Core/SignalBus.h Include/ScriptCanvas/Core/ContractBus.h Include/ScriptCanvas/Core/Attributes.h Include/ScriptCanvas/Core/Connection.cpp @@ -169,7 +168,6 @@ set(FILES Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp Include/ScriptCanvas/Execution/NativeHostDefinitions.h Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp - Include/ScriptCanvas/Execution/RuntimeBus.h Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.h @@ -199,8 +197,6 @@ set(FILES Include/ScriptCanvas/Grammar/DebugMap.cpp Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.h Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp - Include/ScriptCanvas/Grammar/FunctionsLegacySupport.h - Include/ScriptCanvas/Grammar/FunctionsLegacySupport.cpp Include/ScriptCanvas/Grammar/GrammarContext.h Include/ScriptCanvas/Grammar/GrammarContext.cpp Include/ScriptCanvas/Grammar/GrammarContextBus.h @@ -223,7 +219,6 @@ set(FILES Include/ScriptCanvas/Execution/NativeHostDeclarations.h Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp Include/ScriptCanvas/Execution/NativeHostDefinitions.h - Include/ScriptCanvas/Execution/RuntimeBus.h Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp @@ -300,7 +295,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/SetVariable.cpp Include/ScriptCanvas/Libraries/Core/SetVariable.h Include/ScriptCanvas/Libraries/Core/SetVariable.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Core/Start.cpp Include/ScriptCanvas/Libraries/Core/Start.h Include/ScriptCanvas/Libraries/Core/Start.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/UnaryOperator.cpp @@ -324,7 +318,6 @@ set(FILES Include/ScriptCanvas/Libraries/Logic/Gate.cpp Include/ScriptCanvas/Libraries/Logic/Gate.h Include/ScriptCanvas/Libraries/Logic/Gate.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Logic/Indexer.cpp Include/ScriptCanvas/Libraries/Logic/Indexer.h Include/ScriptCanvas/Libraries/Logic/Indexer.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Logic/IsNull.cpp @@ -332,7 +325,6 @@ set(FILES Include/ScriptCanvas/Libraries/Logic/IsNull.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Logic/Logic.cpp Include/ScriptCanvas/Libraries/Logic/Logic.h - Include/ScriptCanvas/Libraries/Logic/Multiplexer.cpp Include/ScriptCanvas/Libraries/Logic/Multiplexer.h Include/ScriptCanvas/Libraries/Logic/Multiplexer.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Logic/Not.h @@ -429,7 +421,6 @@ set(FILES Include/ScriptCanvas/Libraries/String/Format.cpp Include/ScriptCanvas/Libraries/String/Format.h Include/ScriptCanvas/Libraries/String/Format.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/String/Print.cpp Include/ScriptCanvas/Libraries/String/Print.h Include/ScriptCanvas/Libraries/String/Print.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/String/Replace.cpp @@ -446,10 +437,8 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.h Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.cpp Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.h Include/ScriptCanvas/Libraries/UnitTesting/AddSuccess.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.cpp Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.h Include/ScriptCanvas/Libraries/UnitTesting/Checkpoint.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp @@ -476,7 +465,6 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.cpp Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.h Include/ScriptCanvas/Libraries/UnitTesting/MarkComplete.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.h diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp index cf866d9f83..727f73be39 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp @@ -33,25 +33,6 @@ namespace TestNodes AddSlot(slotConfiguration); } - void TestResult::OnInputSignal(const ScriptCanvas::SlotId&) - { - auto valueDatum = FindDatum(GetSlotId("Value")); - if (!valueDatum) - { - return; - } - - valueDatum->ToString(m_string); - - // technically, I should remove this, make it an object that holds a string, with an untyped slot, and this could be a local value - if (!m_string.empty()) - { - AZ_TracePrintf("Script Canvas", "%s\n", m_string.c_str()); - } - - SignalOutput(GetSlotId(ScriptCanvas::CommonSlots::GeneralOutSlot::GetName())); - } - void TestResult::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); @@ -105,11 +86,6 @@ namespace TestNodes AddSlot(ScriptCanvas::DataSlotConfiguration(Data::Type::Number(), "Get Number", ScriptCanvas::ConnectionType::Output)); } - void ContractNode::OnInputSignal(const ScriptCanvas::SlotId&) - { - SignalOutput(GetSlotId(ScriptCanvas::CommonSlots::GeneralOutSlot::GetName())); - } - ////////////////////////////////////////////////////////////////////////////// void InfiniteLoopNode::Reflect(AZ::ReflectContext* reflection) { @@ -121,11 +97,6 @@ namespace TestNodes } } - void InfiniteLoopNode::OnInputSignal(const ScriptCanvas::SlotId&) - { - SignalOutput(GetSlotId("Before Infinity")); - } - void InfiniteLoopNode::OnInit() { AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot()); @@ -159,13 +130,6 @@ namespace TestNodes AddSlot(slotConfiguration); } - void UnitTestErrorNode::OnInputSignal(const ScriptCanvas::SlotId&) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Unit test error!"); - - SignalOutput(GetSlotId("Out")); - } - ////////////////////////////////////////////////////////////////////////////// void AddNodeWithRemoveSlot::Reflect(AZ::ReflectContext* reflection) @@ -205,30 +169,6 @@ namespace TestNodes return Node::RemoveSlot(slotId, true, emitWarning); } - void AddNodeWithRemoveSlot::OnInputSignal(const ScriptCanvas::SlotId& slotId) - { - if (slotId == GetSlotId("In")) - { - ScriptCanvas::Data::NumberType result{}; - for (const ScriptCanvas::SlotId& dynamicSlotId : m_dynamicSlotIds) - { - if (auto numberInput = FindDatum(dynamicSlotId)) - { - if (auto argValue = numberInput->GetAs()) - { - result += *argValue; - } - } - } - - auto resultType = GetSlotDataType(m_resultSlotId); - EXPECT_TRUE(resultType.IsValid()); - ScriptCanvas::Datum output(result);; - PushOutput(output, *GetSlot(m_resultSlotId)); - SignalOutput(GetSlotId("Out")); - } - } - void AddNodeWithRemoveSlot::OnInit() { Node::AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot()); @@ -290,28 +230,6 @@ namespace TestNodes } ////////////////////////////////////////////////////////////////////////////// - - void StringView::OnInputSignal(const ScriptCanvas::SlotId&) - { - auto viewDatum = FindDatum(GetSlotId("View")); - - if (!viewDatum) - { - return; - } - - ScriptCanvas::Data::StringType result; - viewDatum->ToString(result); - - ScriptCanvas::Datum output(result); - auto resultSlot = GetSlot(m_resultSlotId); - if (resultSlot) - { - PushOutput(output, *resultSlot); - } - SignalOutput(GetSlotId("Out")); - } - void StringView::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); @@ -354,36 +272,6 @@ namespace TestNodes return addedSlotId; } - - void InsertSlotConcatNode::OnInputSignal(const ScriptCanvas::SlotId& slotId) - { - if (slotId == GetSlotId(ScriptCanvas::CommonSlots::GeneralInSlot::GetName())) - { - ScriptCanvas::Data::StringType result{}; - - for (const ScriptCanvas::Slot* concatSlot : GetAllSlotsByDescriptor(ScriptCanvas::SlotDescriptors::DataIn())) - { - if (auto inputDatum = FindDatum(concatSlot->GetId())) - { - ScriptCanvas::Data::StringType stringArg; - if (inputDatum->ToString(stringArg)) - { - result += stringArg; - } - } - } - - auto resultSlotId = GetSlotId("Result"); - auto resultType = GetSlotDataType(resultSlotId); - EXPECT_TRUE(resultType.IsValid()); - if (auto resultSlot = GetSlot(resultSlotId)) - { - PushOutput(ScriptCanvas::Datum(result), *resultSlot); - } - SignalOutput(GetSlotId("Out")); - } - } - void InsertSlotConcatNode::OnInit() { Node::AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot()); diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.h index 8963cb4708..3790ab735f 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.h +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.h @@ -32,7 +32,6 @@ namespace TestNodes protected: void OnInit() override; - void OnInputSignal(const ScriptCanvas::SlotId&) override; private: @@ -49,9 +48,6 @@ namespace TestNodes void OnInit() override; - protected: - - void OnInputSignal(const ScriptCanvas::SlotId&) override; }; ////////////////////////////////////////////////////////////////////////////// @@ -64,9 +60,6 @@ namespace TestNodes static void Reflect(AZ::ReflectContext* reflection); protected: - - void OnInputSignal(const ScriptCanvas::SlotId&) override; - void OnInit() override; }; @@ -84,8 +77,6 @@ namespace TestNodes void OnInit() override; - void OnInputSignal(const ScriptCanvas::SlotId&) override; - }; ////////////////////////////////////////////////////////////////////////////// @@ -101,8 +92,6 @@ namespace TestNodes bool RemoveSlot(const ScriptCanvas::SlotId& slotId, bool emitWarning = true); protected: - void OnInputSignal(const ScriptCanvas::SlotId& slotId) override; - void OnInit() override; AZStd::vector m_dynamicSlotIds; @@ -120,8 +109,6 @@ namespace TestNodes void OnInit() override; - void OnInputSignal(const ScriptCanvas::SlotId&) override; - public: static void Reflect(AZ::ReflectContext* context); @@ -141,9 +128,7 @@ namespace TestNodes ScriptCanvas::SlotId InsertSlot(AZ::s64 index, AZStd::string_view slotName); protected: - void OnInputSignal(const ScriptCanvas::SlotId& slotId) override; - - void OnInit() override; + void OnInit() override; }; ////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h index dcc4d2eb3f..ba48af6ac3 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.h @@ -69,23 +69,6 @@ namespace ScriptCanvasTests return GetTestNode(scriptCanvasId, entityOut); } - ScriptCanvas::Node* CreateDataNodeByType(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const ScriptCanvas::Data::Type& type, AZ::EntityId& nodeIDout); - - template - ScriptCanvas::Node* CreateDataNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const t_Value& value, AZ::EntityId& nodeIDout) - { - using namespace ScriptCanvas; - const Data::Type operandType = Data::FromAZType(azrtti_typeid()); - Node* node = CreateDataNodeByType(scriptCanvasId, operandType, nodeIDout); - - EXPECT_NE(node, nullptr); - if (node) - { - node->SetInput_UNIT_TEST("Set", value); - } - return node; - } - template ScriptCanvas::VariableId CreateVariable(ScriptCanvas::ScriptCanvasId scriptCanvasId, const t_Value& value, AZStd::string_view variableName) { diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp index c602bde1f2..c1fdbc2b60 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp @@ -19,145 +19,6 @@ using namespace ScriptCanvasTests; using namespace ScriptCanvasEditor; using namespace TestNodes; -// Tests the basic footprint of the ebus node both before and after graph activation to make sure all internal bookeeping is correct. -TEST_F(ScriptCanvasTestFixture, BehaviorContext_BusHandlerNodeFootPrint) -{ - using namespace ScriptCanvas; - - TemplateEventTestHandler::Reflect(m_serializeContext); - TemplateEventTestHandler::Reflect(m_behaviorContext); - - auto graphEntity = aznew AZ::Entity; - SystemRequestBus::Broadcast(&SystemRequests::CreateGraphOnEntity, graphEntity); - ScriptCanvas::Graph* graph = AZ::EntityUtils::FindFirstDerivedComponent(graphEntity); - graphEntity->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId uuidEventHandlerId; - auto uuidEventHandler = CreateTestNode(graphUniqueId, uuidEventHandlerId); - uuidEventHandler->InitializeBus("TemplateEventTestHandler"); - AZ::Uuid uuidBusId = AZ::Uuid::CreateName("TemplateEventBus"); - uuidEventHandler->SetInput_UNIT_TEST(ScriptCanvas::Nodes::Core::EBusEventHandler::c_busIdName, uuidBusId); //Set Uuid bus id - - { - auto eventEntry = uuidEventHandler->FindEvent("VectorCreatedEvent"); - EXPECT_NE(nullptr, eventEntry); - EXPECT_EQ(eventEntry->m_parameterSlotIds.size(), 1); - EXPECT_TRUE(eventEntry->m_resultSlotId.IsValid()); - - { - const Slot* outputSlot = uuidEventHandler->GetSlot(eventEntry->m_eventSlotId); - EXPECT_EQ(outputSlot->GetDescriptor(), SlotDescriptors::ExecutionOut()); - } - - { - const Slot* dataSlot = uuidEventHandler->GetSlot(eventEntry->m_parameterSlotIds[0]); - - EXPECT_EQ(dataSlot->GetDescriptor(), SlotDescriptors::DataOut()); - EXPECT_EQ(dataSlot->GetDataType(), Data::Type::Vector3()); - - const Datum* datum = uuidEventHandler->FindDatum(eventEntry->m_parameterSlotIds[0]); - EXPECT_EQ(nullptr, datum); - - ModifiableDatumView datumView; - uuidEventHandler->FindModifiableDatumView(eventEntry->m_parameterSlotIds[0], datumView); - - EXPECT_FALSE(datumView.IsValid()); - } - - { - const Slot* resultSlot = uuidEventHandler->GetSlot(eventEntry->m_resultSlotId); - - EXPECT_EQ(resultSlot->GetDescriptor(), SlotDescriptors::DataIn()); - EXPECT_EQ(resultSlot->GetDataType(), Data::Type::Vector3()); - - const Datum* datum = uuidEventHandler->FindDatum(eventEntry->m_resultSlotId); - EXPECT_NE(nullptr, datum); - - if (datum) - { - EXPECT_TRUE(datum->IS_A()); - } - - ModifiableDatumView datumView; - uuidEventHandler->FindModifiableDatumView(eventEntry->m_resultSlotId, datumView); - - EXPECT_TRUE(datumView.IsValid()); - - if (datumView.IsValid()) - { - const Datum* datum2 = datumView.GetDatum(); - EXPECT_TRUE(datum2->IS_A()); - } - } - } - - graphEntity->Activate(); - - { - auto eventEntry = uuidEventHandler->FindEvent("VectorCreatedEvent"); - EXPECT_NE(nullptr, eventEntry); - EXPECT_EQ(eventEntry->m_parameterSlotIds.size(), 1); - EXPECT_TRUE(eventEntry->m_resultSlotId.IsValid()); - - { - const Slot* outputSlot = uuidEventHandler->GetSlot(eventEntry->m_eventSlotId); - EXPECT_EQ(outputSlot->GetDescriptor(), SlotDescriptors::ExecutionOut()); - } - - { - const Slot* dataSlot = uuidEventHandler->GetSlot(eventEntry->m_parameterSlotIds[0]); - - EXPECT_EQ(dataSlot->GetDescriptor(), SlotDescriptors::DataOut()); - EXPECT_EQ(dataSlot->GetDataType(), Data::Type::Vector3()); - - const Datum* datum = uuidEventHandler->FindDatum(eventEntry->m_parameterSlotIds[0]); - EXPECT_EQ(nullptr, datum); - - ModifiableDatumView datumView; - uuidEventHandler->FindModifiableDatumView(eventEntry->m_parameterSlotIds[0], datumView); - - EXPECT_FALSE(datumView.IsValid()); - } - - { - const Slot* resultSlot = uuidEventHandler->GetSlot(eventEntry->m_resultSlotId); - - EXPECT_EQ(resultSlot->GetDescriptor(), SlotDescriptors::DataIn()); - EXPECT_EQ(resultSlot->GetDataType(), Data::Type::Vector3()); - - const Datum* datum = uuidEventHandler->FindDatum(eventEntry->m_resultSlotId); - EXPECT_NE(nullptr, datum); - - if (datum) - { - EXPECT_TRUE(datum->IS_A()); - } - - ModifiableDatumView datumView; - uuidEventHandler->FindModifiableDatumView(eventEntry->m_resultSlotId, datumView); - - EXPECT_TRUE(datumView.IsValid()); - - if (datumView.IsValid()) - { - const Datum* datum2 = datumView.GetDatum(); - EXPECT_TRUE(datum2->IS_A()); - } - } - } - - delete graphEntity; - - m_serializeContext->EnableRemoveReflection(); - m_behaviorContext->EnableRemoveReflection(); - TemplateEventTestHandler::Reflect(m_serializeContext); - TemplateEventTestHandler::Reflect(m_behaviorContext); - m_serializeContext->DisableRemoveReflection(); - m_behaviorContext->DisableRemoveReflection(); -} - void ReflectSignCorrectly() { AZ::BehaviorContext* behaviorContext(nullptr); diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp index d5f4c221c8..9e4252a4f2 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Core.cpp @@ -470,213 +470,11 @@ TEST_F(ScriptCanvasTestFixture, Contracts) graph->GetEntity()->Deactivate(); delete graph->GetEntity(); } -// -// TEST_F(ScriptCanvasTestFixture, BinaryOperationTest) -// { -// -// using namespace ScriptCanvas::Nodes; -// using namespace ScriptCanvas::Nodes::Comparison; -// -// TestBehaviorContextObject::Reflect(m_serializeContext); -// TestBehaviorContextObject::Reflect(m_behaviorContext); -// -// BinaryOpTest(1, 1, true); -// BinaryOpTest(1, 0, false); -// BinaryOpTest(0, 1, false); -// BinaryOpTest(0, 0, true); -// -// BinaryOpTest(1, 1, false); -// BinaryOpTest(1, 0, true); -// BinaryOpTest(0, 1, true); -// BinaryOpTest(0, 0, false); -// -// BinaryOpTest(1, 1, false); -// BinaryOpTest(1, 0, true); -// BinaryOpTest(0, 1, false); -// BinaryOpTest(0, 0, false); -// -// BinaryOpTest(1, 1, true); -// BinaryOpTest(1, 0, true); -// BinaryOpTest(0, 1, false); -// BinaryOpTest(0, 0, true); -// -// BinaryOpTest(1, 1, false); -// BinaryOpTest(1, 0, false); -// BinaryOpTest(0, 1, true); -// BinaryOpTest(0, 0, false); -// -// BinaryOpTest(1, 1, true); -// BinaryOpTest(1, 0, false); -// BinaryOpTest(0, 1, true); -// BinaryOpTest(0, 0, true); -// -// BinaryOpTest(true, true, true); -// BinaryOpTest(true, false, false); -// BinaryOpTest(false, true, false); -// BinaryOpTest(false, false, true); -// -// BinaryOpTest(true, true, false); -// BinaryOpTest(true, false, true); -// BinaryOpTest(false, true, true); -// BinaryOpTest(false, false, false); -// -// AZStd::string string0("a string"); -// AZStd::string string1("b string"); -// -// BinaryOpTest(string1, string1, true); -// BinaryOpTest(string1, string0, false); -// BinaryOpTest(string0, string1, false); -// BinaryOpTest(string0, string0, true); -// -// BinaryOpTest(string1, string1, false); -// BinaryOpTest(string1, string0, true); -// BinaryOpTest(string0, string1, true); -// BinaryOpTest(string0, string0, false); -// -// BinaryOpTest(string1, string1, false); -// BinaryOpTest(string1, string0, true); -// BinaryOpTest(string0, string1, false); -// BinaryOpTest(string0, string0, false); -// -// BinaryOpTest(string1, string1, true); -// BinaryOpTest(string1, string0, true); -// BinaryOpTest(string0, string1, false); -// BinaryOpTest(string0, string0, true); -// -// BinaryOpTest(string1, string1, false); -// BinaryOpTest(string1, string0, false); -// BinaryOpTest(string0, string1, true); -// BinaryOpTest(string0, string0, false); -// -// BinaryOpTest(string1, string1, true); -// BinaryOpTest(string1, string0, false); -// BinaryOpTest(string0, string1, true); -// BinaryOpTest(string0, string0, true); -// -// const AZ::Vector3 vectorOne(1.0f, 1.0f, 1.0f); -// const AZ::Vector3 vectorZero(0.0f, 0.0f, 0.0f); -// -// BinaryOpTest(vectorOne, vectorOne, true); -// BinaryOpTest(vectorOne, vectorZero, false); -// BinaryOpTest(vectorZero, vectorOne, false); -// BinaryOpTest(vectorZero, vectorZero, true); -// -// BinaryOpTest(vectorOne, vectorOne, false); -// BinaryOpTest(vectorOne, vectorZero, true); -// BinaryOpTest(vectorZero, vectorOne, true); -// BinaryOpTest(vectorZero, vectorZero, false); -// -// const TestBehaviorContextObject zero(0); -// const TestBehaviorContextObject one(1); -// const TestBehaviorContextObject otherOne(1); -// -// BinaryOpTest(one, one, true); -// BinaryOpTest(one, zero, false); -// BinaryOpTest(zero, one, false); -// BinaryOpTest(zero, zero, true); -// -// BinaryOpTest(one, one, false); -// BinaryOpTest(one, zero, true); -// BinaryOpTest(zero, one, true); -// BinaryOpTest(zero, zero, false); -// -// BinaryOpTest(one, one, false); -// BinaryOpTest(one, zero, true); -// BinaryOpTest(zero, one, false); -// BinaryOpTest(zero, zero, false); -// -// BinaryOpTest(one, one, true); -// BinaryOpTest(one, zero, true); -// BinaryOpTest(zero, one, false); -// BinaryOpTest(zero, zero, true); -// -// BinaryOpTest(one, one, false); -// BinaryOpTest(one, zero, false); -// BinaryOpTest(zero, one, true); -// BinaryOpTest(zero, zero, false); -// -// BinaryOpTest(one, one, true); -// BinaryOpTest(one, zero, false); -// BinaryOpTest(zero, one, true); -// BinaryOpTest(zero, zero, true); -// -// BinaryOpTest(one, otherOne, true); -// BinaryOpTest(otherOne, one, true); -// -// BinaryOpTest(one, otherOne, false); -// BinaryOpTest(otherOne, one, false); -// -// BinaryOpTest(one, otherOne, false); -// BinaryOpTest(otherOne, one, false); -// -// BinaryOpTest(one, otherOne, true); -// BinaryOpTest(otherOne, one, true); -// -// BinaryOpTest(one, otherOne, false); -// BinaryOpTest(otherOne, one, false); -// -// BinaryOpTest(one, otherOne, true); -// BinaryOpTest(otherOne, one, true); -// -// // force failures, to verify crash proofiness -// BinaryOpTest(one, zero, false, true); -// BinaryOpTest(one, zero, true, true); -// BinaryOpTest(one, zero, true, true); -// BinaryOpTest(one, zero, true, true); -// BinaryOpTest(one, zero, false, true); -// BinaryOpTest(one, zero, false, true); -// -// m_serializeContext->EnableRemoveReflection(); -// m_behaviorContext->EnableRemoveReflection(); -// TestBehaviorContextObject::Reflect(m_serializeContext); -// TestBehaviorContextObject::Reflect(m_behaviorContext); -// m_serializeContext->DisableRemoveReflection(); -// m_behaviorContext->DisableRemoveReflection(); -// } const int k_executionCount = 998; -TEST_F(ScriptCanvasTestFixture, ExecutionLength) -{ - - using namespace ScriptCanvas; - - ScriptCanvas::Graph* graph(nullptr); - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - EXPECT_TRUE(graph != nullptr); - graph->GetEntity()->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startID; - CreateTestNode(graphUniqueId, startID); - - AZ::EntityId previousID = startID; - - for (int i = 0; i < k_executionCount; ++i) - { - AZ::EntityId printNodeID; - TestResult* printNode = CreateTestNode(graphUniqueId, printNodeID); - printNode->SetInput_UNIT_TEST("Value", i); - EXPECT_TRUE(Connect(*graph, previousID, "Out", printNodeID, "In")); - previousID = printNodeID; - } - - AZ::Entity* graphEntity = graph->GetEntity(); - { - ScriptCanvasEditor::ScopedOutputSuppression suppressOutput; - graphEntity->Activate(); - } - - ReportErrors(graph); - - graphEntity->Deactivate(); - delete graphEntity; -} - TEST_F(ScriptCanvasTestFixture, While) { - RunUnitTestGraph("LY_SC_UnitTest_While", ScriptCanvas::ExecutionMode::Interpreted); } diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index e7657cff65..107bb32cd6 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -931,181 +931,3 @@ TEST_F(ScriptCanvasTestFixture, InterpretedExecutionOutPerformance) { RunUnitTestGraph("LY_SC_UnitTest_ExecutionOutPerformance", ExecutionMode::Interpreted); } - -#if defined(FUNCTION_LEGACY_SUPPORT_ENABLED) - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraph_UserNodeable) -{ - ExpectParse("LY_SC_UnitTest_Subgraph_UserNodeableD"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraph_UserNodeableLatent) -{ - ExpectParse("LY_SC_UnitTest_Subgraph_UserNodeableLatent"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedUseFunctionWithOnGraphStart) -{ - RunUnitTestGraph("LY_SC_UnitTest_UseFunctionWithOnGraphStart"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedUseSubgraphWithStartAndEBus) -{ - RunUnitTestGraph("LY_SC_UnitTests_UseSubgraphWithStartAndEBus"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedDeviousStateFunctionFixGraph) -{ - RunUnitTestGraph("LY_SC_UnitTest_DeviousStateFunctionFixGraph"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedCallFunctionLocalValues) -{ - RunUnitTestGraph("LY_SC_UnitTest_CallFunctionLocalValues"); -} - -TEST_F(ScriptCanvasTestFixture, ParseFunctionLocalObjects) -{ - ExpectParse("LY_SC_UnitTest_FunctionLocalObjects"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedFunctionLocalObjectsCall) -{ - RunUnitTestGraph("LY_SC_UnitTest_FunctionLocalObjectsCall", ExecutionMode::Interpreted, DurationSpec::Ticks(31)); -} - -TEST_F(ScriptCanvasTestFixture, ParseFunctionWithOnGraphStart) -{ - ExpectParse("LY_SC_UnitTest_FunctionWithOnGraphStart"); -} - -TEST_F(ScriptCanvasTestFixture, NodeableDurationSubgraphDirectionExposedOutWithOutput) -{ - RunUnitTestGraph("LY_SC_UnitTest_NodeableDurationSubgraphDirectionExposedOutWithOutput", ExecutionMode::Interpreted, DurationSpec::Ticks(3)); -} - -TEST_F(ScriptCanvasTestFixture, ParseOrderedSequencerFunction) -{ - ExpectParse("LY_SC_UnitTest_OrderedSequencerFunction"); -} - -TEST_F(ScriptCanvasTestFixture, ParseFunction_Names_With_Spaces) -{ - ExpectParse("LY_SC_UnitTest_Function Names With Spaces"); -} - -TEST_F(ScriptCanvasTestFixture, ParseFunctionNameEvilVersion) -{ - ExpectParse("LY_SC_UnitTest_Function Names(With) Random+Strings Evil~Version"); -} - -TEST_F(ScriptCanvasTestFixture, ParseFunctionNameEvilVersionInFolder) -{ - ExpectParse("TestFunction/LY_SC_UnitTest_Function Names(With) Random+Strings Evil~Version-In^Forder"); -} - -TEST_F(ScriptCanvasTestFixture, ParseNodeableDurationFunction) -{ - ExpectParse("LY_SC_UnitTest_NodeableDurationFunction"); -} - -TEST_F(ScriptCanvasTestFixture, ParseNodeableDurationFunctionDirectExposure) -{ - ExpectParse("LY_SC_UnitTest_NodeableDurationFunctionDirectExposure"); -} - -TEST_F(ScriptCanvasTestFixture, ParseNodeableDurationFunctionDirectExposureWithOutput) -{ - ExpectParse("LY_SC_UnitTest_NodeableDurationFunctionDirectExposureWithOutput"); -} - - -TEST_F(ScriptCanvasTestFixture, ParseFunctionBranchSingleNamedOutJustReturns) -{ - ExpectParse("LY_SC_UnitTest_ParseFunctionBranchSingleNamedOutJustReturns"); -} - -TEST_F(ScriptCanvasTestFixture, ParseExposeAnyOut) -{ - ExpectParse("LY_SC_UnitTest_ExposeAnyOut"); -} - -TEST_F(ScriptCanvasTestFixture, ParseMultipleInputNoParseError) -{ - ExpectParse("LY_SC_UnitTest_MultipleInputNoParseError"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphMultipleInError) -{ - ExpectParseError("LY_SC_UnitTest_InterpretedSubgraphMultipleInError"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphMultipleOutError) -{ - ExpectParseError("LY_SC_UnitTest_InterpretedSubgraphMultipleOutError"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphOutInLoop) -{ - ExpectParseError("LY_SC_UnitTest_InterpretedSubgraphOutInLoop"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphOutMidCycleMissingSlots) -{ - ExpectParseError("LY_SC_UnitTest_InterpretedSubgraphOutMidCycleMissingSlots"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphComplexityError) -{ - ExpectParseError("LY_SC_UnitTest_SubgraphComplexityError"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphReturnValueFromIn) -{ - ExpectParseError("LY_SC_UnitTest_SubgraphReturnValueFromIn"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedSubgraphReturnValueFromInOut) -{ - ExpectParseError("LY_SC_UnitTest_SubgraphReturnValueFromInOut"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedVerifyByValueCorrectness) -{ - RunUnitTestGraph("LY_SC_UnitTest_VerifyByValueCorrectness", ExecutionMode::Interpreted); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedFunctionNoInputOneOutputCall) -{ - RunUnitTestGraph("LY_SC_UnitTest_FunctionNoInputOneOutputCall", ExecutionMode::Interpreted); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedFunctionAddVector3Call) -{ - RunUnitTestGraph("LY_SC_UnitTest_FunctionAddVector3Call", ExecutionMode::Interpreted); -} -TEST_F(ScriptCanvasTestFixture, InterpretedParseFunction) -{ - ExpectParse("LY_SC_UnitTest_ParseFunction"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedParseFunctionBranch) -{ - ExpectParse("LY_SC_UnitTest_ParseFunctionBranch"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedParseFunctionBranchDefaultOut) -{ - ExpectParse("LY_SC_UnitTest_ParseFunctionBranchDefaultOut"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedParseFunctionDefaultOut) -{ - ExpectParse("LY_SC_UnitTest_ParseFunctionDefaultOut"); -} - -TEST_F(ScriptCanvasTestFixture, InterpretedParseFunctionOut) -{ - ExpectParse("LY_SC_UnitTest_ParseFunctionOut"); -} -#endif diff --git a/Gems/StartingPointInput/Code/Source/InputNode.cpp b/Gems/StartingPointInput/Code/Source/InputNode.cpp deleted file mode 100644 index e0f9de3657..0000000000 --- a/Gems/StartingPointInput/Code/Source/InputNode.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 -#include - -#include -#include -#include -#include -#include -#include - -namespace StartingPointInput -{ - void InputNode::OnPostActivate() - { - //if (GetExecutionType() == ScriptCanvas::ExecutionType::Runtime) - //{ - // const ScriptCanvas::SlotId eventNameSlotId = InputNodeProperty::GetEventNameSlotId(this); - - // m_eventName = (*(FindDatum(eventNameSlotId)->GetAs())); - // InputEventNotificationBus::Handler::BusConnect(InputEventNotificationId(m_eventName.c_str())); - //} - } - - void InputNode::OnDeactivate() - { - InputEventNotificationBus::Handler::BusDisconnect(); - } - - void InputNode::OnInputChanged(const ScriptCanvas::Datum& input, const ScriptCanvas::SlotId& slotId) - { - // we got a new event name, we need to drop our connection to the old and connect to the new event - const ScriptCanvas::SlotId eventNameSlotId = InputNodeProperty::GetEventNameSlotId(this); - - if (slotId == eventNameSlotId) - { - InputEventNotificationBus::Handler::BusDisconnect(); - - m_eventName = (*input.GetAs()); - InputEventNotificationBus::Handler::BusConnect(InputEventNotificationId(m_eventName.c_str())); - } - } - - void InputNode::OnPressed(float value) - { - m_value = value; - const ScriptCanvas::Datum output = ScriptCanvas::Datum(m_value); - const ScriptCanvas::SlotId pressedSlotId = InputNodeProperty::GetPressedSlotId(this); - const ScriptCanvas::SlotId valueId = InputNodeProperty::GetValueSlotId(this); - - if (auto* slot = GetSlot(valueId)) - { - PushOutput(output, *slot); - } - - SignalOutput(pressedSlotId); - } - - void InputNode::OnHeld(float value) - { - m_value = value; - const ScriptCanvas::Datum output = ScriptCanvas::Datum(m_value); - const ScriptCanvas::SlotId heldSlotId = InputNodeProperty::GetHeldSlotId(this); - const ScriptCanvas::SlotId valueId = InputNodeProperty::GetValueSlotId(this); - if (auto* slot = GetSlot(valueId)) - { - PushOutput(output, *slot); - } - SignalOutput(heldSlotId); - } - - void InputNode::OnReleased(float value) - { - m_value = value; - const ScriptCanvas::Datum output = ScriptCanvas::Datum(m_value); - const ScriptCanvas::SlotId releasedSlotId = InputNodeProperty::GetReleasedSlotId(this); - const ScriptCanvas::SlotId valueId = InputNodeProperty::GetValueSlotId(this); - - if (auto* slot = GetSlot(valueId)) - { - PushOutput(output, *slot); - } - SignalOutput(releasedSlotId); - } -} diff --git a/Gems/StartingPointInput/Code/Source/InputNode.h b/Gems/StartingPointInput/Code/Source/InputNode.h index d71c302f2b..c4e85f2a5b 100644 --- a/Gems/StartingPointInput/Code/Source/InputNode.h +++ b/Gems/StartingPointInput/Code/Source/InputNode.h @@ -10,18 +10,15 @@ #include #include - -#include - #include namespace StartingPointInput { ////////////////////////////////////////////////////////////////////////// /// Input handles raw input from any source and outputs Pressed, Held, and Released input events + /// This nodes id deprecated in favor of its nodeable counterpart. class InputNode : public ScriptCanvas::Node - , protected InputEventNotificationBus::Handler { public: @@ -35,21 +32,5 @@ namespace StartingPointInput AZStd::string m_eventName; float m_value; - - ////////////////////////////////////////////////////////////////////////// - /// ScriptCanvas_Node - void OnInputChanged(const ScriptCanvas::Datum& input, const ScriptCanvas::SlotId& slotId) override; - - protected: - ////////////////////////////////////////////////////////////////////////// - /// Node - void OnPostActivate() override; - void OnDeactivate() override; - - ////////////////////////////////////////////////////////////////////////// - /// InputEventNotificationBus::Handler - void OnPressed(float value) override; - void OnHeld(float value) override; - void OnReleased(float value) override; }; } diff --git a/Gems/StartingPointInput/Code/startingpointinput_files.cmake b/Gems/StartingPointInput/Code/startingpointinput_files.cmake index 933f32ec66..000c361b5b 100644 --- a/Gems/StartingPointInput/Code/startingpointinput_files.cmake +++ b/Gems/StartingPointInput/Code/startingpointinput_files.cmake @@ -17,7 +17,6 @@ set(FILES Source/InputLibrary.h Source/InputLibrary.cpp Source/InputNode.h - Source/InputNode.cpp Source/InputHandlerNodeable.h Source/InputHandlerNodeable.cpp Source/InputHandlerNodeable.ScriptCanvasNodeable.xml From 0a910a31aa148739ea0b9d2a34d7be3c2dbd2da3 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 6 Jul 2021 15:05:37 -0700 Subject: [PATCH 063/156] The Great ScriptCanvas Purge, Part V Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 2 +- .../Asset/RuntimeAssetSystemComponent.cpp | 4 +- .../Builder/ScriptCanvasBuilderComponent.cpp | 27 -- .../Builder/ScriptCanvasBuilderComponent.h | 1 - .../Builder/ScriptCanvasBuilderWorker.cpp | 4 +- .../Code/Builder/ScriptCanvasBuilderWorker.h | 33 -- .../ScriptCanvasBuilderWorkerUtility.cpp | 3 +- .../Assets/ScriptCanvasAssetHelpers.cpp | 32 +- .../Assets/ScriptCanvasAssetInstance.cpp | 154 --------- .../Editor/Assets/ScriptCanvasAssetInstance.h | 46 --- .../Assets/ScriptCanvasAssetReference.cpp | 57 ---- .../Assets/ScriptCanvasAssetReference.h | 70 ---- .../ScriptCanvasAssetReferenceContainer.h | 234 ------------- .../Assets/ScriptCanvasAssetTracker.cpp | 1 - .../Code/Editor/Components/EditorGraph.cpp | 11 - .../Framework/ScriptCanvasGraphUtilities.inl | 1 - .../Framework/ScriptCanvasTraceUtilities.h | 11 - .../FunctionNodeDescriptorComponent.h | 2 - .../ScriptCanvasFunctionAssetHandler.h | 68 ---- .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 4 - .../ScriptCanvas/Components/EditorGraph.h | 3 - .../Code/Editor/Nodes/EditorLibrary.cpp | 56 ---- .../Code/Editor/Nodes/EditorLibrary.h | 32 -- .../Editor/Nodes/ScriptCanvasAssetNode.cpp | 200 ----------- .../Code/Editor/Nodes/ScriptCanvasAssetNode.h | 91 ----- .../Code/Editor/ReflectComponent.cpp | 7 - .../Code/Editor/ScriptCanvasEditorGem.cpp | 2 - .../Code/Editor/SystemComponent.cpp | 16 +- .../FunctionNodePaletteTreeItemTypes.h | 3 - .../Widgets/NodePalette/NodePaletteModel.cpp | 68 ---- .../Widgets/NodePalette/NodePaletteModel.h | 2 - .../ScriptCanvasNodePaletteDockWidget.cpp | 2 +- .../ScriptCanvasStatisticsDialog.cpp | 10 +- .../VariablePanel/GraphVariablesTableView.cpp | 3 - .../VariablePanel/VariableDockWidget.cpp | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 18 +- .../Tools/UpgradeTool/UpgradeHelper.cpp | 2 - .../Windows/Tools/UpgradeTool/UpgradeTool.cpp | 10 - .../Tools/UpgradeTool/VersionExplorer.cpp | 21 -- ....cpp => SubgraphInterfaceAssetHandler.cpp} | 2 +- ...dler.h => SubgraphInterfaceAssetHandler.h} | 0 .../Code/Include/ScriptCanvas/Core/Graph.cpp | 2 - .../Internal/Nodes/BaseTimerNode.h | 2 +- .../Internal/Nodes/ExpressionNodeBase.cpp | 5 - .../Internal/Nodes/ExpressionNodeBase.h | 5 - .../Libraries/Core/FunctionCallNode.h | 1 - .../ScriptCanvas/Libraries/Core/Method.cpp | 5 - .../Libraries/Core/ReceiveScriptEvent.cpp | 11 - .../Libraries/Core/ReceiveScriptEvent.h | 1 - .../Libraries/Math/MathExpression.cpp | 11 - .../Libraries/Math/MathExpression.h | 1 - .../Operators/Containers/OperatorBack.h | 2 - .../Operators/Containers/OperatorFront.h | 2 - .../Operators/Math/OperatorArithmetic.cpp | 14 - .../Operators/Math/OperatorArithmetic.h | 3 +- .../ScriptCanvas/Libraries/Time/Timer.cpp | 5 - .../ScriptCanvas/Libraries/Time/Timer.h | 5 - .../Code/Source/ScriptCanvasCommonGem.cpp | 2 - .../Code/scriptcanvasgem_common_files.cmake | 5 +- ...scriptcanvasgem_editor_builder_files.cmake | 1 - .../Code/scriptcanvasgem_editor_files.cmake | 11 - .../ScriptCanvasActions/GraphActions.cpp | 13 - .../GraphCreationTests.cpp | 13 - ...criptcanvastesting_editor_tests_msvc.cmake | 1 - .../Code/Tests/ScriptCanvas_Async.cpp | 316 ------------------ ...criptcanvastestingeditor_tests_files.cmake | 1 - 66 files changed, 24 insertions(+), 1731 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReferenceContainer.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/Functions/ScriptCanvasFunctionAssetHandler.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h rename Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/{Functions/RuntimeFunctionAssetHandler.cpp => SubgraphInterfaceAssetHandler.cpp} (98%) rename Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/{Functions/RuntimeFunctionAssetHandler.h => SubgraphInterfaceAssetHandler.h} (100%) delete mode 100644 Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Async.cpp diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 97bba9b7e6..e698fcc298 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -28,7 +28,7 @@ AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING -#include +#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp index e993b21b26..38995f8dca 100644 --- a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp @@ -2,7 +2,7 @@ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT - * + *s */ #include @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index ea714f356f..a953edeae8 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -102,30 +102,9 @@ namespace ScriptCanvasBuilder AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::RegisterSourceAssetType, azrtti_typeid(), ScriptCanvasEditor::ScriptCanvasAsset::Description::GetFileFilter()); } - { - AssetBuilderSDK::AssetBuilderDesc builderDescriptor; - builderDescriptor.m_name = "Script Canvas Function Builder"; - builderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.scriptcanvas_fn", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); - builderDescriptor.m_busId = ScriptCanvasBuilder::FunctionWorker::GetUUID(); - builderDescriptor.m_createJobFunction = AZStd::bind(&FunctionWorker::CreateJobs, &m_scriptCanvasFunctionBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); - builderDescriptor.m_processJobFunction = AZStd::bind(&FunctionWorker::ProcessJob, &m_scriptCanvasFunctionBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); - // changing the version number invalidates all assets and will rebuild everything. - builderDescriptor.m_version = m_scriptCanvasFunctionBuilder.GetVersionNumber(); - // changing the analysis fingerprint just invalidates analysis (ie, not the assets themselves) - // which will cause the "CreateJobs" function to be called, for each asset, even if the - // source file has not changed, but won't actually do the jobs unless the source file has changed - // or the fingerprint of the individual job is different. - builderDescriptor.m_analysisFingerprint = m_scriptCanvasFunctionBuilder.GetFingerprintString(); - builderDescriptor.AddFlags(AssetBuilderSDK::AssetBuilderDesc::BF_DeleteLastKnownGoodProductOnFailure, s_scriptCanvasProcessJobKey); - builderDescriptor.m_productsToKeepOnFailure[s_scriptCanvasProcessJobKey] = { AZ_CRC("SubgraphInterface", 0xdfe6dc72) }; - AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, builderDescriptor); - ScriptCanvas::Grammar::RequestBus::Handler::BusConnect(); - } - m_sharedHandlers = HandleAssetTypes(); AssetHandlers workerHandlers(m_sharedHandlers); m_scriptCanvasBuilder.Activate(workerHandlers); - m_scriptCanvasFunctionBuilder.Activate(workerHandlers); ScriptCanvas::Translation::RequestBus::Handler::BusConnect(); ScriptCanvas::Grammar::RequestBus::Handler::BusConnect(); @@ -135,15 +114,9 @@ namespace ScriptCanvasBuilder { // Finish all queued work AZ::Data::AssetBus::ExecuteQueuedEvents(); - AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::UnregisterSourceAssetType, azrtti_typeid()); - AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::UnregisterSourceAssetType, azrtti_typeid()); - m_scriptCanvasBuilder.BusDisconnect(); - m_scriptCanvasFunctionBuilder.BusDisconnect(); - m_sharedHandlers.DeleteOwnedHandlers(); - ScriptCanvas::Translation::RequestBus::Handler::BusDisconnect(); ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h index bd6a09433a..5d57863ec3 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h @@ -54,7 +54,6 @@ namespace ScriptCanvasBuilder SharedHandlers m_sharedHandlers; Worker m_scriptCanvasBuilder; - FunctionWorker m_scriptCanvasFunctionBuilder; ScriptCanvas::Translation::Context m_translationContext; ScriptCanvas::Grammar::Context m_grammarContext; }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 6b163a5027..b9d1dd5a7c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -8,7 +8,6 @@ #include "precompiled.h" #include -#include #include #include #include @@ -18,9 +17,8 @@ #include #include -#include +#include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index df432578d4..ae87a0bd20 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -175,37 +175,4 @@ namespace ScriptCanvasBuilder // cached on first time query mutable AZStd::string m_fingerprintString; }; - - class FunctionWorker - : public AssetBuilderSDK::AssetBuilderCommandBus::Handler - { - public: - static AZ::Uuid GetUUID(); - - FunctionWorker() = default; - FunctionWorker(const FunctionWorker&) = delete; - - void Activate(const AssetHandlers& handlers); - - //! Asset Builder Callback Functions - void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const; - - const char* GetFingerprintString() const; - - int GetVersionNumber() const; - - void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; - - void ShutDown() override {}; - - private: - AZ::Data::AssetHandler* m_editorAssetHandler = nullptr; - AZ::Data::AssetHandler* m_runtimeAssetHandler = nullptr; - AZ::Data::AssetHandler* m_subgraphInterfaceHandler = nullptr; - - mutable AZStd::vector> m_sourceDependencies; - - // cached on first time query - mutable AZStd::string m_fingerprintString; - }; } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 73d32ba16a..7f6269a698 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -17,10 +17,9 @@ #include #include #include -#include +#include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp index caec55e9fe..6eae2ff603 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp @@ -148,37 +148,13 @@ namespace ScriptCanvasEditor } - bool IsValidSourceFile(const AZStd::string& filePath, ScriptCanvas::ScriptCanvasId scriptCanvasId) + bool IsValidSourceFile(const AZStd::string& filePath, [[maybe_unused]] ScriptCanvas::ScriptCanvasId scriptCanvasId) { - bool isValidSourceFile = true; - - if (scriptCanvasId.IsValid()) + ScriptCanvasAssetDescription assetDescription; + return AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false); { - bool isRuntimeGraph = false; - EditorGraphRequestBus::EventResult(isRuntimeGraph, scriptCanvasId, &EditorGraphRequests::IsRuntimeGraph); - - if (isRuntimeGraph) - { - ScriptCanvasAssetDescription assetDescription; - - if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) - { - isValidSourceFile = false; - } - } - // Assume it's a function for now - else - { - ScriptCanvasEditor::ScriptCanvasFunctionDescription assetDescription; - - if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) - { - isValidSourceFile = false; - } - } + return true; } - - return isValidSourceFile; } } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.cpp deleted file mode 100644 index 30f2ecdb64..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "precompiled.h" - -#include -#include -#include - -namespace ScriptCanvasEditor -{ - ScriptCanvasAssetInstance::~ScriptCanvasAssetInstance() - { - } - - void ScriptCanvasAssetInstance::Reflect(AZ::ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - // TODO: This results in more data being saved per instance, but is needed to make Id remapping transparent. - // Allow a way to enumerate the elements for Id Remapping, while disallowing serialization - ->Field("m_data", &ScriptCanvasAssetInstance::m_scriptCanvasData) - ->Field("m_assetRef", &ScriptCanvasAssetInstance::m_assetRef) - ->Field("m_entityInstanceMap", &ScriptCanvasAssetInstance::m_baseToInstanceMap) - ->Field("m_dataFlags", &ScriptCanvasAssetInstance::m_entityToDataFlags) - ->Field("m_dataPatch", &ScriptCanvasAssetInstance::m_dataPatch) - ; - } - } - - ScriptCanvasAssetReference& ScriptCanvasAssetInstance::GetReference() - { - return m_assetRef; - } - - const ScriptCanvasAssetReference& ScriptCanvasAssetInstance::GetReference() const - { - return m_assetRef; - } - - ScriptCanvas::ScriptCanvasData& ScriptCanvasAssetInstance::GetScriptCanvasData() - { - return m_scriptCanvasData; - } - - const ScriptCanvas::ScriptCanvasData& ScriptCanvasAssetInstance::GetScriptCanvasData() const - { - return m_scriptCanvasData; - } - - void ScriptCanvasAssetInstance::ComputeDataPatch() - { - if (!m_assetRef.GetAsset().IsReady()) - { - return; - } - - ScriptCanvas::ScriptCanvasData& baseData = m_assetRef.GetAsset().Get()->GetScriptCanvasData(); - - AZ::SerializeContext* serializeContext{}; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - - decltype(m_baseToInstanceMap) entityIdReverseLookUp; - for (const auto& baseToInstancePair : m_baseToInstanceMap) - { - entityIdReverseLookUp.emplace(baseToInstancePair.second, baseToInstancePair.first); - } - - // remap entity ids to the "original" - AZ::IdUtils::Remapper::ReplaceIdsAndIdRefs(&m_scriptCanvasData, [&entityIdReverseLookUp](AZ::EntityId sourceId, [[maybe_unused]] bool isEntityId, const AZ::IdUtils::Remapper::IdGenerator&) -> AZ::EntityId - { - auto findIt = entityIdReverseLookUp.find(sourceId); - return findIt != entityIdReverseLookUp.end() ? findIt->second : sourceId; - }, serializeContext); - - // compute the delta (what we changed from the base slice) - m_dataPatch.Create(&baseData, &m_scriptCanvasData, AZ::DataPatch::FlagsMap(), GetDataFlagsForPatching(), serializeContext); - - // remap entity ids back to the "instance onces" - AZ::IdUtils::Remapper::ReplaceIdsAndIdRefs(&m_scriptCanvasData, [this](AZ::EntityId sourceId, [[maybe_unused]] bool isEntityId, const AZ::IdUtils::Remapper::IdGenerator&) -> AZ::EntityId { - auto findIt = m_baseToInstanceMap.find(sourceId); - return findIt != m_baseToInstanceMap.end() ? findIt->second : sourceId; - }, serializeContext); - - } - - void ScriptCanvasAssetInstance::ApplyDataPatch() - { - if (!m_assetRef.GetAsset().IsReady()) - { - return; - } - - ScriptCanvas::ScriptCanvasData& baseData = m_assetRef.GetAsset().Get()->GetScriptCanvasData(); - - AZ::SerializeContext* serializeContext{}; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - // An empty map indicates its a fresh instance (i.e. has never be instantiated and then serialized). - if (m_baseToInstanceMap.empty()) - { - // Generate new Ids and populate the map. - AZ_Assert(!m_dataPatch.IsValid(), "Data patch is valid for scene slice instance, but base scene to instantiated scene Id map is not!"); - serializeContext->CloneObjectInplace(m_scriptCanvasData, &baseData); - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(&m_scriptCanvasData, m_baseToInstanceMap); - } - else - { - // Clone entities while applying any data patches. - AZ_Assert(m_dataPatch.IsValid(), "Data patch is not valid for existing scene slice instance!"); - ScriptCanvas::ScriptCanvasData* patchedSceneData = m_dataPatch.Apply(&baseData, serializeContext); - - // Remap Ids & references. - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(patchedSceneData, m_baseToInstanceMap); - serializeContext->CloneObjectInplace(m_scriptCanvasData, patchedSceneData); - } - } - - AZ::DataPatch::FlagsMap ScriptCanvasAssetInstance::GetDataFlagsForPatching() const - { - // Collect all entities' data flags - AZ::DataPatch::FlagsMap dataFlags; - - for (auto& baseIdInstanceIdPair : m_baseToInstanceMap) - { - // Make the addressing relative to InstantiatedContainer (m_dataFlags stores flags relative to the individual entity) - AZ::DataPatch::AddressType addressPrefix; - addressPrefix.push_back(AZ_CRC("Entities", 0x50ec64e5)); - addressPrefix.push_back(static_cast(baseIdInstanceIdPair.first)); - - auto findIt = m_entityToDataFlags.find(baseIdInstanceIdPair.second); - if (findIt != m_entityToDataFlags.end()) - { - for (auto& addressDataFlagsPair : findIt->second) - { - const AZ::DataPatch::AddressType& originalAddress = addressDataFlagsPair.first; - - AZ::DataPatch::AddressType prefixedAddress; - prefixedAddress.reserve(addressPrefix.size() + originalAddress.size()); - prefixedAddress.insert(prefixedAddress.end(), addressPrefix.begin(), addressPrefix.end()); - prefixedAddress.insert(prefixedAddress.end(), originalAddress.begin(), originalAddress.end()); - - dataFlags.emplace(AZStd::move(prefixedAddress), addressDataFlagsPair.second); - } - } - } - - return dataFlags; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.h deleted file mode 100644 index 5e86636d90..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetInstance.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 - -namespace ScriptCanvasEditor -{ - class ScriptCanvasAssetInstance - { - public: - AZ_TYPE_INFO(ScriptCanvasAssetInstance, "{96B16AAB-DB63-4D32-9FC9-7A5DE440B0B7}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetInstance, AZ::SystemAllocator, 0); - - ScriptCanvasAssetInstance() = default; - ~ScriptCanvasAssetInstance(); - static void Reflect(AZ::ReflectContext* context); - - const AZStd::unordered_map& GetBaseToInstanceMap() const { return m_baseToInstanceMap; } - ScriptCanvasAssetReference& GetReference(); - const ScriptCanvasAssetReference& GetReference() const; - - ScriptCanvas::ScriptCanvasData& GetScriptCanvasData(); - const ScriptCanvas::ScriptCanvasData& GetScriptCanvasData() const; - - void ComputeDataPatch(); - void ApplyDataPatch(); - - private: - ScriptCanvasAssetInstance(const ScriptCanvasAssetInstance&) = delete; - AZ::DataPatch::FlagsMap GetDataFlagsForPatching() const; - - ScriptCanvas::ScriptCanvasData m_scriptCanvasData; - ScriptCanvasAssetReference m_assetRef; - AZStd::unordered_map m_baseToInstanceMap; - AZStd::unordered_map m_entityToDataFlags; - - AZ::DataPatch m_dataPatch; - bool m_canApplyPatch; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.cpp deleted file mode 100644 index e4d620ba57..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.cpp +++ /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 - * - */ - -#include "precompiled.h" - -#include -#include -#include - -namespace ScriptCanvasEditor -{ - void ScriptCanvasAssetReference::Reflect(AZ::ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->DataContainer() - ; - } - } - - ScriptCanvasAssetReference::ScriptCanvasAssetReference(AZ::Data::Asset sliceAsset, bool storeInObjectStream) - { - SetAsset(sliceAsset); - SetAssetDataStoredInternally(storeInObjectStream); - } - - void ScriptCanvasAssetReference::SetAsset(AZ::Data::Asset sliceAsset) - { - m_asset = sliceAsset; - } - - const AZ::Data::Asset& ScriptCanvasAssetReference::GetAsset() const - { - return m_asset; - } - - AZ::Data::Asset& ScriptCanvasAssetReference::GetAsset() - { - return m_asset; - } - - void ScriptCanvasAssetReference::SetAssetDataStoredInternally(bool storeInObjectStream) - { - m_storeInObjectStream = storeInObjectStream; - } - - bool ScriptCanvasAssetReference::GetAssetDataStoredInternally() const - { - return m_storeInObjectStream; - } - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.h deleted file mode 100644 index 526296b1c1..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReference.h +++ /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 - * - */ - -#pragma once -#include -#include - -namespace ScriptCanvas -{ - class ScriptCanvasData; -} - -namespace ScriptCanvasEditor -{ - class ScriptCanvasAsset; - - class ScriptCanvasAssetReference - { - public: - AZ_TYPE_INFO(ScriptCanvasAssetReference, "{C1B24507-887C-4E20-A259-BFEEDD7EDF9D}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetReference, AZ::SystemAllocator, 0); - - ScriptCanvasAssetReference() = default; - ScriptCanvasAssetReference(AZ::Data::Asset scriptCanvasAsset, bool storeInObjectStream = false); - static void Reflect(AZ::ReflectContext* context); - - /*! - \param scriptCanvasAsset asset reference to store - \param storeInObjectStream bool which determines if the asset data will serialized out as part of the ObjectStream when serializing - */ - void SetAsset(AZ::Data::Asset scriptCanvasAsset); - const AZ::Data::Asset& GetAsset() const; - AZ::Data::Asset& GetAsset(); - - /*! - \param storeInObjectStream bool which determines if the asset data will serialized out as part of the ObjectStream when serializing - */ - void SetAssetDataStoredInternally(bool storeInObjectStream); - - /*! - Indicates if this scriptCanvas reference contains an asset whose data is stored internally in this class. - \return true if the asset is asset data is serialize as part of this class object stream - */ - bool GetAssetDataStoredInternally() const; - - private: - bool m_storeInObjectStream = false; ///< If true the asset data is stored in the object stream with this class - AZ::Data::Asset m_asset; - friend class ScriptCanvasAssetReferenceContainer; - }; -} - -namespace AZStd -{ - template<> - struct hash - { - using argument_type = ScriptCanvasEditor::ScriptCanvasAssetReference; - using result_type = AZStd::size_t; - AZ_FORCE_INLINE size_t operator()(const argument_type& key) const - { - AZStd::hash hasher; - return hasher(key.GetAsset().GetId()); - } - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReferenceContainer.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReferenceContainer.h deleted file mode 100644 index efff707234..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetReferenceContainer.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 ScriptCanvasAssetReferenceContainer - : public AZ::SerializeContext::IDataContainer - { - public: - ScriptCanvasAssetReferenceContainer() - { - m_storeInObjectStreamElement.m_name = "m_storeInObjectStream"; - m_storeInObjectStreamElement.m_nameCrc = AZ_CRC("m_storeInObjectStream", 0xf5a45371); - m_storeInObjectStreamElement.m_typeId = azrtti_typeid(); - m_storeInObjectStreamElement.m_offset = 0; - m_storeInObjectStreamElement.m_dataSize = sizeof(bool); - m_storeInObjectStreamElement.m_azRtti = nullptr; - m_storeInObjectStreamElement.m_genericClassInfo = AZ::SerializeGenericTypeInfo::GetGenericInfo(); - m_storeInObjectStreamElement.m_editData = nullptr; - m_storeInObjectStreamElement.m_flags = 0; - - m_assetElement.m_name = "m_asset"; - m_assetElement.m_nameCrc = AZ_CRC("m_asset", 0x4e58e538); - m_assetElement.m_typeId = AZ::SerializeGenericTypeInfo>::GetClassTypeId(); - m_assetElement.m_offset = m_storeInObjectStreamElement.m_dataSize; - m_assetElement.m_dataSize = sizeof(AZ::Data::Asset); - m_assetElement.m_azRtti = AZ::GetRttiHelper>(); - m_assetElement.m_genericClassInfo = AZ::SerializeGenericTypeInfo>::GetGenericInfo(); - m_assetElement.m_editData = nullptr; - m_assetElement.m_flags = 0; - - m_baseDataElement.m_name = "m_scriptCanvasData"; - m_baseDataElement.m_nameCrc = AZ_CRC("m_scriptCanvasData", 0x78a93f93); - m_baseDataElement.m_typeId = AZ::SerializeGenericTypeInfo::GetClassTypeId(); - m_baseDataElement.m_offset = m_assetElement.m_offset + m_assetElement.m_dataSize; - m_baseDataElement.m_dataSize = sizeof(ScriptCanvas::ScriptCanvasData); - m_baseDataElement.m_azRtti = AZ::GetRttiHelper(); - m_baseDataElement.m_genericClassInfo = AZ::SerializeGenericTypeInfo::GetGenericInfo(); - m_baseDataElement.m_editData = nullptr; - m_baseDataElement.m_flags = 0; - } - /// Null if element with this name can't be found. - const AZ::SerializeContext::ClassElement* GetElement(AZ::u32 elementNameCrc) const override - { - if (m_storeInObjectStreamElement.m_nameCrc == elementNameCrc) - { - return &m_storeInObjectStreamElement; - } - if (m_assetElement.m_nameCrc == elementNameCrc) - { - return &m_assetElement; - } - if (m_baseDataElement.m_nameCrc == elementNameCrc) - { - return &m_baseDataElement; - } - - return nullptr; - } - - bool GetElement(AZ::SerializeContext::ClassElement& classElement, const AZ::SerializeContext::DataElement& dataElement) const override - { - if (m_storeInObjectStreamElement.m_nameCrc == dataElement.m_nameCrc) - { - classElement = m_storeInObjectStreamElement; - return true; - } - if (m_assetElement.m_nameCrc == dataElement.m_nameCrc) - { - classElement = m_assetElement; - return true; - } - if (m_baseDataElement.m_nameCrc == dataElement.m_nameCrc) - { - classElement = m_baseDataElement; - return true; - } - return false; - } - - /// Enumerate elements in the array. - void EnumElements(void* instance, const ElementCB& cb) override - { - auto assetRef = reinterpret_cast(instance); - - if (!cb(&assetRef->m_storeInObjectStream, m_storeInObjectStreamElement.m_typeId, m_storeInObjectStreamElement.m_genericClassInfo ? m_storeInObjectStreamElement.m_genericClassInfo->GetClassData() : nullptr, &m_storeInObjectStreamElement)) - { - return; - } - - if (!cb(&assetRef->m_asset, m_assetElement.m_typeId, m_assetElement.m_genericClassInfo ? m_assetElement.m_genericClassInfo->GetClassData() : nullptr, &m_assetElement)) - { - return; - } - - if (assetRef->m_storeInObjectStream && assetRef->m_asset.Get()) - { - cb(&assetRef->m_asset.Get()->GetScriptCanvasData(), m_baseDataElement.m_typeId, m_baseDataElement.m_genericClassInfo ? m_baseDataElement.m_genericClassInfo->GetClassData() : nullptr, &m_baseDataElement); - } - } - - void EnumTypes(const ElementTypeCB& cb) override - { - cb(m_storeInObjectStreamElement.m_typeId, &m_storeInObjectStreamElement); - cb(m_assetElement.m_typeId, &m_assetElement); - cb(m_baseDataElement.m_typeId, &m_baseDataElement); - } - - /// Return number of elements in the container. - size_t Size(void* instance) const override - { - auto assetRef = reinterpret_cast(instance); - return assetRef->m_storeInObjectStream && assetRef->m_asset.Get() ? m_numClassElements : m_numClassElements - 1; - } - - /// Returns the capacity of the container. Returns 0 for objects without fixed capacity. - size_t Capacity(void*) const override - { - return m_numClassElements; - } - - /// Returns true if elements pointers don't change on add/remove. If false you MUST enumerate all elements. - bool IsStableElements() const override { return true; } - - /// Returns true if the container is fixed size, otherwise false. - bool IsFixedSize() const override { return false; } - - /// Returns if the container is fixed capacity, otherwise false - bool IsFixedCapacity() const override { return true; } - - /// Returns true if the container is a smart pointer. - bool IsSmartPointer() const override { return false; } - - /// Returns true if elements can be retrieved by index. - bool CanAccessElementsByIndex() const override { return false; } - - /// Reserve element - void* ReserveElement(void* instance, const AZ::SerializeContext::ClassElement* classElement) override - { - auto assetRef = reinterpret_cast(instance); - if (classElement->m_nameCrc == m_storeInObjectStreamElement.m_nameCrc) - { - return &assetRef->m_storeInObjectStream; - } - if (classElement->m_nameCrc == m_assetElement.m_nameCrc) - { - if (assetRef->m_storeInObjectStream) - { - assetRef->m_asset.SetFlags(static_cast(AZ::Data::AssetLoadBehavior::NoLoad)); - } - return &assetRef->m_asset; - } - if (assetRef->m_storeInObjectStream && classElement->m_nameCrc == m_baseDataElement.m_nameCrc) - { - auto* scriptCanvasAsset = aznew ScriptCanvasAsset(assetRef->m_asset.GetId(), AZ::Data::AssetData::AssetStatus::Ready); - assetRef->m_asset = { scriptCanvasAsset, AZ::Data::AssetLoadBehavior::Default }; - return &assetRef->m_asset.Get()->GetScriptCanvasData(); - } - - return instance; - } - - /// Get an element's address by its index (called before the element is loaded). - void* GetElementByIndex(void*, const AZ::SerializeContext::ClassElement*, size_t) override - { - return nullptr; - } - - /// Store element - void StoreElement(void* instance, void* element) override - { - auto assetRef = reinterpret_cast(instance); - if (assetRef->m_storeInObjectStream && assetRef->m_asset.Get() && element == &assetRef->m_asset.Get()->GetScriptCanvasData()) - { - auto existingAsset = AZ::Data::AssetManager::Instance().FindAsset(assetRef->m_asset.GetId(), assetRef->m_asset.GetAutoLoadBehavior()); - if (existingAsset.IsReady()) - { - assetRef->m_asset = existingAsset; - } - } - } - - /// Remove element in the container. - bool RemoveElement(void* instance, const void* element, AZ::SerializeContext* deletePointerDataContext) override - { - if (deletePointerDataContext) - { - auto assetRef = reinterpret_cast(instance); - if (&assetRef->m_storeInObjectStream == element) - { - DeletePointerData(deletePointerDataContext, &m_storeInObjectStreamElement, &assetRef->m_storeInObjectStream); - } - else if (&assetRef->m_asset == element) - { - DeletePointerData(deletePointerDataContext, &m_assetElement, &assetRef->m_asset); - } - } - return false; - } - - /// Remove elements (removed array of elements) regardless if the container is Stable or not (IsStableElements) - size_t RemoveElements(void* instance, const void** elements, size_t numElements, AZ::SerializeContext* deletePointerDataContext) override - { - if (deletePointerDataContext) - { - for (size_t i = 0; i < numElements; ++i) - { - RemoveElement(instance, elements[i], deletePointerDataContext); - } - } - return 0; - } - - /// Clear elements in the instance. - void ClearElements(void*, AZ::SerializeContext*) override - { - } - - AZ::SerializeContext::ClassElement m_storeInObjectStreamElement; - AZ::SerializeContext::ClassElement m_assetElement; - AZ::SerializeContext::ClassElement m_baseDataElement; - const size_t m_numClassElements = 3; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index 4979f5e0e8..24d9aa5ba7 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index a8dd5904fc..8078ef7a78 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -60,7 +60,6 @@ AZ_POP_DISABLE_WARNING #include #include -#include #include #include #include @@ -3127,16 +3126,6 @@ namespace ScriptCanvasEditor } } - bool Graph::IsRuntimeGraph() const - { - return GetAssetType() == azrtti_typeid(); - } - - bool Graph::IsFunctionGraph() const - { - return GetAssetType() == azrtti_typeid(); - } - bool Graph::CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) { bool isEnabled = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 0eb3c3a719..96febf8553 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index b3c4993063..7b6b99d967 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -42,17 +42,6 @@ namespace ScriptCanvasEditor { class ScriptCanvasAsset; - struct LoadTestFunctionResult - { - AZStd::string_view m_graphPath; - AZStd::unique_ptr m_entity; - ScriptCanvas::RuntimeComponent* m_runtimeComponent = nullptr; - bool m_nativeFunctionFound = false; - AZ::Data::Asset m_editorAsset; - AZ::Data::Asset m_runtimeAsset; - AZ::Data::Asset m_scriptAsset; - }; - struct LoadTestGraphResult { AZStd::string_view m_graphPath; diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.h index d121762c93..68782be5cd 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.h @@ -10,8 +10,6 @@ #include #include - -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/Functions/ScriptCanvasFunctionAssetHandler.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/Functions/ScriptCanvasFunctionAssetHandler.h deleted file mode 100644 index f9953aba99..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/Functions/ScriptCanvasFunctionAssetHandler.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 - -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - class SerializeContext; -} - -namespace ScriptCanvasEditor -{ - class ScriptCanvasFunctionAsset; - - /** - * Manages editor Script Canvas graph assets. - */ - class ScriptCanvasFunctionAssetHandler - : public ScriptCanvasAssetHandler - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasFunctionAssetHandler, AZ::SystemAllocator, 0); - AZ_RTTI(ScriptCanvasFunctionAssetHandler, "{CE1EB0B7-D8DA-4B9B-858B-A34DF5092BC2}", ScriptCanvasAssetHandler); - - ScriptCanvasFunctionAssetHandler(AZ::SerializeContext* context = nullptr); - ~ScriptCanvasFunctionAssetHandler(); - - AZ::Data::AssetPtr CreateAsset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override; - AZ::Data::AssetHandler::LoadResult LoadAssetData( - const AZ::Data::Asset& asset, - AZStd::shared_ptr stream, - const AZ::Data::AssetFilterCB& assetLoadFilterCB) override; - bool SaveAssetData(const AZ::Data::Asset& asset, AZ::IO::GenericStream* stream) override; - - bool SaveAssetData(const ScriptCanvasEditor::ScriptCanvasFunctionAsset* assetData, AZ::IO::GenericStream* stream); - - bool SaveAssetData(const ScriptCanvasEditor::ScriptCanvasFunctionAsset* assetData, AZ::IO::GenericStream* stream, AZ::DataStream::StreamType streamType); - - // Called by asset database on registration. - void GetAssetTypeExtensions(AZStd::vector& extensions) override; - void GetHandledAssetTypes(AZStd::vector& assetTypes) override; - - // Provides editor with information about script canvas graph assets. - AZ::Data::AssetType GetAssetType() const override; - const char* GetAssetTypeDisplayName() const override; - - bool CanCreateComponent(const AZ::Data::AssetId& assetId) const override; - - const char* GetGroup() const override; - const char* GetBrowserIcon() const override; - - static AZ::Data::AssetType GetAssetTypeStatic(); - - ScriptCanvasEditor::ScriptCanvasFunctionAsset* m_scriptCanvasAsset; - - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index d9b2be8035..27477b4127 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -154,10 +154,6 @@ namespace ScriptCanvasEditor virtual bool ConvertReferenceToVariableNode(const GraphCanvas::Endpoint& endpoint) = 0; virtual void QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) = 0; - - virtual bool IsRuntimeGraph() const = 0; - virtual bool IsFunctionGraph() const = 0; - virtual bool CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) = 0; virtual ScriptCanvas::Endpoint ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoinnt) const = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 777a84c4fa..8b01177f79 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -267,9 +267,6 @@ namespace ScriptCanvasEditor void QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) override; - bool IsRuntimeGraph() const override; - bool IsFunctionGraph() const override; - bool CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) override; ScriptCanvas::Endpoint ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const override; diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.cpp deleted file mode 100644 index fcdc7b2780..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.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 "precompiled.h" - -#include - -#include -#include - - -namespace ScriptCanvasEditor -{ - namespace Library - { - void Editor::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(1) - ; - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("Editor", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/All.png") - ; - } - } - } - - void Editor::InitNodeRegistry(ScriptCanvas::NodeRegistry& nodeRegistry) - { - ScriptCanvas::Library::AddNodeToRegistry(nodeRegistry); - } - - AZStd::vector Editor::GetComponentDescriptors() - { - return AZStd::vector({ - ScriptCanvasAssetNode::CreateDescriptor(), - }); - } - } - - AZStd::vector GetLibraryDescriptors() - { - return Library::Editor::GetComponentDescriptors(); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.h b/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.h deleted file mode 100644 index 4ea81a869a..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/EditorLibrary.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 - -namespace AZ -{ - class ReflectContext; - class ComponentDescriptor; -} - -namespace ScriptCanvasEditor -{ - namespace Library - { - struct Editor : public ScriptCanvas::Library::LibraryDefinition - { - AZ_RTTI(Editor, "{59697735-4B64-4DC5-8380-02B2999FFCFE}", ScriptCanvas::Library::LibraryDefinition); - - static void Reflect(AZ::ReflectContext*); - static void InitNodeRegistry(ScriptCanvas::NodeRegistry& nodeRegistry); - static AZStd::vector GetComponentDescriptors(); - }; - } - - AZStd::vector GetLibraryDescriptors(); -} diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp deleted file mode 100644 index 9363d5a337..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "precompiled.h" -#include - -#include -#include - -namespace ScriptCanvasEditor -{ - /** - * \note when we reflecting we can check if the class is inheriting from IEventHandler - * and use the this->events. - */ - class ScriptCanvasAssetNodeEventHandler - : public AZ::SerializeContext::IEventHandler - { - void OnReadBegin(void* classPtr) - { - auto* scriptCanvasAssetNode = reinterpret_cast(classPtr); - scriptCanvasAssetNode->ComputeDataPatch(); - } - }; - - void ScriptCanvasAssetNode::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serializeContext = azrtti_cast(context); - if (!serializeContext) - { - return; - } - - serializeContext->Class() - ->Version(0) - ->EventHandler() - ->Field("m_assetInstance", &ScriptCanvasAssetNode::m_scriptCanvasAssetInstance) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("ScriptCanvas Asset", "Script Canvas Asset Node which contains a reference to another ScriptCanvas graph") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Placeholder.png") - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List) - ; - } - } - - ScriptCanvasAssetNode::ScriptCanvasAssetNode(const AZ::Data::Asset& scriptCanvasAsset, bool storeAssetDataInternally) - { - SetAssetDataStoredInternally(storeAssetDataInternally); - SetAsset(scriptCanvasAsset); - } - - ScriptCanvasAssetNode::~ScriptCanvasAssetNode() - { - } - - void ScriptCanvasAssetNode::OnInit() - { - if (GetAsset().GetId().IsValid()) - { - AZ::Data::AssetBus::Handler::BusConnect(GetAsset().GetId()); - AZ::Entity* scriptCanvasEntity = GetScriptCanvasEntity(); - if (scriptCanvasEntity) - { - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Constructed) - { - scriptCanvasEntity->Init(); - } - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Init) - { - scriptCanvasEntity->Activate(); - } - } - } - } - - bool ScriptCanvasAssetNode::GetAssetDataStoredInternally() const - { - return m_scriptCanvasAssetInstance.GetReference().GetAssetDataStoredInternally(); - } - - void ScriptCanvasAssetNode::SetAssetDataStoredInternally(bool storeInObjectStream) - { - m_scriptCanvasAssetInstance.GetReference().SetAssetDataStoredInternally(storeInObjectStream); - } - - ScriptCanvas::ScriptCanvasData& ScriptCanvasAssetNode::GetScriptCanvasData() - { - return m_scriptCanvasAssetInstance.GetScriptCanvasData(); - } - - const ScriptCanvas::ScriptCanvasData& ScriptCanvasAssetNode::GetScriptCanvasData() const - { - return m_scriptCanvasAssetInstance.GetScriptCanvasData(); - } - - AZ::Entity* ScriptCanvasAssetNode::GetScriptCanvasEntity() const - { - return GetScriptCanvasData().GetScriptCanvasEntity(); - } - - AZ::Data::Asset& ScriptCanvasAssetNode::GetAsset() - { - return m_scriptCanvasAssetInstance.GetReference().GetAsset(); - } - - const AZ::Data::Asset& ScriptCanvasAssetNode::GetAsset() const - { - return m_scriptCanvasAssetInstance.GetReference().GetAsset(); - } - - void ScriptCanvasAssetNode::SetAsset(const AZ::Data::Asset& scriptCanvasAsset) - { - m_scriptCanvasAssetInstance.GetReference().SetAsset(scriptCanvasAsset); - if (scriptCanvasAsset.GetId().IsValid()) - { - auto onAssetReady = [](ScriptCanvasMemoryAsset&) {}; - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, scriptCanvasAsset.GetId(), azrtti_typeid(), onAssetReady); - - AZ::Data::AssetBus::Handler::BusConnect(scriptCanvasAsset.GetId()); - ApplyDataPatch(); - } - } - - void ScriptCanvasAssetNode::OnAssetReloaded(AZ::Data::Asset asset) - { - SetAsset(asset); - if (!GetAsset().IsReady()) - { - AZ_Error("Script Canvas", false, "Reloaded graph with id %s is not valid", asset.GetId().ToString().data()); - return; - } - - // Update data patches against the old version of the asset. - ApplyDataPatch(); - } - - void ScriptCanvasAssetNode::OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType) - { - AZ::Data::AssetBus::Handler::BusDisconnect(assetId); - } - - void ScriptCanvasAssetNode::ComputeDataPatch() - { - m_scriptCanvasAssetInstance.ComputeDataPatch(); - } - - void ScriptCanvasAssetNode::ApplyDataPatch() - { - m_scriptCanvasAssetInstance.ApplyDataPatch(); - } - - bool ScriptCanvasAssetNode::Visit(const VisitCB& preVisitCB, const VisitCB & postVisitCB) - { - AZStd::unordered_set visitedGraphs; - return Visit(preVisitCB, postVisitCB, visitedGraphs); - } - - bool ScriptCanvasAssetNode::Visit(const VisitCB& preVisitCB, const VisitCB & postVisitCB, AZStd::unordered_set& visitedGraphs) - { - const AZ::Data::AssetId& visitedAssetId = GetAsset().GetId(); - if (visitedGraphs.count(visitedAssetId) > 0) - { - AZ_Error("Script Canvas", false, "The Script Canvas Asset %s has already been visited, processing will stop", visitedAssetId.ToString().data()); - return false; - } - - if (!preVisitCB || preVisitCB(*this)) - { - auto graph = GetScriptCanvasEntity() ? AZ::EntityUtils::FindFirstDerivedComponent(GetScriptCanvasEntity()) : nullptr; - if (graph) - { - for (AZ::Entity* nodeEntity : graph->GetNodeEntities()) - { - if (auto childAssetNode = AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity)) - { - // Visit ScriptCanvasAssetNodes that are in the asset referenced by @assetNode - if (!childAssetNode->Visit(preVisitCB, postVisitCB, visitedGraphs)) - { - break; - } - - } - } - } - } - - // Visit siblings ScriptCanvasAssetNodes - bool visitSiblings = !postVisitCB || postVisitCB(*this); - visitedGraphs.insert(visitedAssetId); - return visitSiblings; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h b/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.h deleted file mode 100644 index 5b3e07cfbd..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/ScriptCanvasAssetNode.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 - * - */ - -#pragma once - -#include - -#include -#include -#include -#include - -namespace ScriptCanvasEditor -{ - //! A group of entities in a scene - class ScriptCanvasAssetNode - : public ScriptCanvas::Node - , protected AZ::Data::AssetBus::Handler - { - public: - AZ_COMPONENT(ScriptCanvasAssetNode, "{65A34956-B6ED-4EB2-966C-5BC844F7B05E}", ScriptCanvas::Node); - - static void Reflect(AZ::ReflectContext* context); - - ScriptCanvasAssetNode() = default; - ScriptCanvasAssetNode(const AZ::Data::Asset& scriptCanvasAsset, bool storeAssetDataInternally); - ~ScriptCanvasAssetNode() override; - - // AZ::Component - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC("ScriptCanvas_AssetService", 0x17a357ae)); - } - - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC("ScriptCanvas_AssetService", 0x17a357ae)); - } - - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) - { - (void)dependent; - } - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - (void)required; - } - //// - - void OnInit() override; - - // Retrieves the asset associated with this node - AZ::Data::Asset& GetAsset(); - const AZ::Data::Asset& GetAsset() const; - // Sets the asset associated with this node - void SetAsset(const AZ::Data::Asset& scriptCanvasAsset); - - bool GetAssetDataStoredInternally() const; - void SetAssetDataStoredInternally(bool storeInObjectStream); - - ScriptCanvas::ScriptCanvasData& GetScriptCanvasData(); - const ScriptCanvas::ScriptCanvasData& GetScriptCanvasData() const; - - AZ::Entity* GetScriptCanvasEntity() const; - - using VisitCB = AZStd::function; - bool Visit(const VisitCB& preVisitCB, const VisitCB & postVisitCB); - bool Visit(const VisitCB& preVisitCB, const VisitCB & postVisitCB, AZStd::unordered_set& visitedGraphs); - //// - - protected: - // AssetBus::Handler - void OnAssetReloaded(AZ::Data::Asset asset) override; - void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType) override; - //// - - friend class ScriptCanvasAssetNodeEventHandler; - void ComputeDataPatch(); - void ApplyDataPatch(); - - private: - ScriptCanvasAssetNode(const ScriptCanvasAssetNode&) = delete; - //! References to the Script Canvas asset used by this component - ScriptCanvasAssetInstance m_scriptCanvasAssetInstance; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index 2d45f0c644..435aa27331 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -13,10 +13,6 @@ #include #include -#include -#include - -#include #include #include @@ -36,12 +32,9 @@ namespace ScriptCanvasEditor void ReflectComponent::Reflect(AZ::ReflectContext* context) { ScriptCanvas::ScriptCanvasData::Reflect(context); - ScriptCanvasAssetReference::Reflect(context); - ScriptCanvasAssetInstance::Reflect(context); ScriptCanvasAssetHolder::Reflect(context); EditorSettings::EditorWorkspace::Reflect(context); EditorSettings::ScriptCanvasEditorSettings::Reflect(context); - Library::Editor::Reflect(context); LiveLoggingUserSettings::Reflect(context); UndoData::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index a9aa8cd0e9..d462695025 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include @@ -118,7 +117,6 @@ namespace ScriptCanvas auto libraryDescriptors = ScriptCanvasEditor::GetLibraryDescriptors(); m_descriptors.insert(m_descriptors.end(), libraryDescriptors.begin(), libraryDescriptors.end()); - ScriptCanvasEditor::Library::Editor::InitNodeRegistry(GetNodeRegistry().Get()); } AZ::ComponentTypeList ScriptCanvasModule::GetRequiredSystemComponents() const diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 6ab9c9b640..a451787ede 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -47,8 +47,6 @@ #include #include -#include - namespace ScriptCanvasEditor { static const size_t cs_jobThreads = 1; @@ -332,12 +330,6 @@ namespace ScriptCanvasEditor isScriptCanvasAsset = true; } - ScriptCanvasFunctionDescription scriptCanvasFunctionAssetDescription; - if (!isScriptCanvasAsset && AZStd::wildcard_match(AZStd::string::format("*%s", scriptCanvasFunctionAssetDescription.GetExtensionImpl()).c_str(), fullSourceFileName)) - { - isScriptCanvasAsset = true; - } - if (isScriptCanvasAsset) { auto scriptCanvasEditorCallback = [this]([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) @@ -412,7 +404,7 @@ namespace ScriptCanvasEditor nullptr, [this](const AZ::Data::AssetId, const AZ::Data::AssetInfo& assetInfo) { - if (assetInfo.m_assetType == azrtti_typeid() || assetInfo.m_assetType == azrtti_typeid()) + if (assetInfo.m_assetType == azrtti_typeid()) { AddAssetToUpgrade(assetInfo); } @@ -456,11 +448,7 @@ namespace ScriptCanvasEditor if (query == m_assetsToConvert.end()) { - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_assetsToConvert.push_front(assetInfo); - } - else if (assetInfo.m_assetType == azrtti_typeid()) + if (assetInfo.m_assetType == azrtti_typeid()) { m_assetsToConvert.push_back(assetInfo); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h index 26b2eb27d6..8ae511934c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h @@ -15,9 +15,6 @@ #include #include - -#include - #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp index 9c9a19cd9c..0dada0f7aa 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp @@ -1316,56 +1316,6 @@ namespace ScriptCanvasEditor return identifiers; } - AZStd::vector NodePaletteModel::RegisterFunctionInformation(ScriptCanvasFunctionAsset* functionAsset) - { - const AZ::Data::AssetId& assetId = functionAsset->GetId(); - - FunctionNodeModelInformation* modelInformation = aznew FunctionNodeModelInformation(); - - modelInformation->m_functionAssetId = assetId; - modelInformation->m_titlePaletteOverride = "FunctionNodeTitlePalette"; - modelInformation->m_nodeIdentifier = ScriptCanvas::NodeUtils::ConstructFunctionNodeIdentifier(assetId); - - // Temporary until I drive data from the function asset itself - AZStd::string rootPath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); - AZStd::string absolutePath; - - AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); - - AZStd::string category = "User Functions"; - AZStd::string relativePath; - - if (AzFramework::StringFunc::Path::GetFolderPath(assetInfo.m_relativePath.c_str(), relativePath)) - { - AZStd::to_lower(relativePath.begin(), relativePath.end()); - - const AZStd::string root = "scriptcanvas/functions/"; - if (relativePath.starts_with(root)) - { - relativePath = relativePath.substr(root.size(), relativePath.size() - root.size()); - } - - category.append("/"); - category.append(relativePath); - } - - modelInformation->m_categoryPath = category; - - AzFramework::StringFunc::Path::Normalize(absolutePath); - - AzFramework::StringFunc::Path::GetFileName(absolutePath.c_str(), modelInformation->m_displayName); - //// - - m_registeredNodes.emplace(AZStd::make_pair(modelInformation->m_nodeIdentifier, modelInformation)); - m_assetMapping.insert(AZStd::make_pair(assetId, modelInformation->m_nodeIdentifier)); - - AZStd::vector nodeTypeIdentifiers; - nodeTypeIdentifiers.push_back(modelInformation->m_nodeIdentifier); - - return nodeTypeIdentifiers; - } - void NodePaletteModel::RegisterCategoryInformation(const AZStd::string& category, const CategoryInformation& categoryInformation) { auto categoryIter = m_categoryInformation.find(category); @@ -1552,24 +1502,6 @@ namespace ScriptCanvasEditor AZ_TracePrintf("NodePaletteModel", "Could not refresh node palette properly, the asset failed to load correctly."); } } - else if (productEntry->GetAssetType() == azrtti_typeid()) - { - const AZ::Data::AssetId& assetId = productEntry->GetAssetId(); - - auto functionAsset = AZ::Data::AssetManager::Instance().GetAsset(assetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::PreLoad); - functionAsset.BlockUntilLoadComplete(); - - if (functionAsset.IsReady()) - { - ScriptCanvasFunctionAsset* data = functionAsset.GetAs(); - - return RegisterFunctionInformation(data); - } - else - { - AZ_TracePrintf("NodePaletteModel", "Could not refresh node palette properly, the asset failed to load correctly."); - } - } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.h index 2286e8e453..03da4cea27 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.h @@ -22,7 +22,6 @@ #include -#include #include #include @@ -87,7 +86,6 @@ namespace ScriptCanvasEditor // Asset Based Registrations AZStd::vector RegisterScriptEvent(ScriptEvents::ScriptEventsAsset* scriptEventAsset); - AZStd::vector RegisterFunctionInformation(ScriptCanvasFunctionAsset* functionAsset); void RegisterCategoryInformation(const AZStd::string& category, const CategoryInformation& categoryInformation); const CategoryInformation* FindCategoryInformation(const AZStd::string& categoryStyle) const; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index dfeb439c3d..3afa9100d0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -223,7 +223,7 @@ namespace ScriptCanvasEditor void ScriptCanvasRootPaletteTreeItem::SetActiveScriptCanvasId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { - ScriptCanvas::RuntimeRequestBus::EventResult(m_previousAssetId, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetId); + ScriptCanvas::GraphRequestBus::EventResult(m_previousAssetId, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetId); for (auto functionTreePair : m_globalFunctionTreeItems) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index caa39d4ca4..7aa03224e4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -16,7 +16,6 @@ #include #include -#include #include namespace @@ -181,8 +180,7 @@ namespace ScriptCanvasEditor { AZ::Data::AssetInfo assetInfo; AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); - if (assetInfo.m_assetType == azrtti_typeid() - || assetInfo.m_assetType == azrtti_typeid()) + if (assetInfo.m_assetType == azrtti_typeid()) { m_scriptCanvasAssetTreeRoot->RegisterAsset(assetId, assetInfo.m_assetType); } @@ -197,8 +195,7 @@ namespace ScriptCanvasEditor { AZ::Data::AssetInfo assetInfo; AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); - if (assetInfo.m_assetType == azrtti_typeid() - || assetInfo.m_assetType == azrtti_typeid()) + if (assetInfo.m_assetType == azrtti_typeid()) { m_scriptCanvasAssetTreeRoot->RemoveAsset(assetId); } @@ -440,8 +437,7 @@ namespace ScriptCanvasEditor { const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* productEntry = static_cast(entry); - if (productEntry->GetAssetType() == azrtti_typeid() - || productEntry->GetAssetType() == azrtti_typeid()) + if (productEntry->GetAssetType() == azrtti_typeid()) { const AZ::Data::AssetId& assetId = productEntry->GetAssetId(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp index aad178b91d..95e782c137 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp @@ -1053,9 +1053,6 @@ namespace ScriptCanvasEditor AZ::SerializeContext* serializeContext = AZ::EntityUtils::GetApplicationSerializeContext(); AZ::Utils::LoadObjectFromBufferInPlace(byteArray.constData(), static_cast(byteArray.size()), copiedVariableData, serializeContext); - bool isRuntimeGraph = false; - EditorGraphRequestBus::EventResult(isRuntimeGraph, scriptCanvasId, &EditorGraphRequests::IsRuntimeGraph); - ScriptCanvas::GraphVariableManagerRequests* requests = ScriptCanvas::GraphVariableManagerRequestBus::FindFirstHandler(scriptCanvasId); if (requests == nullptr) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp index 9307084e2a..a6ae834f3e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp @@ -758,7 +758,7 @@ namespace ScriptCanvasEditor auto owningGraph = ScriptCanvas::GraphRequestBus::FindFirstHandler(m_scriptCanvasId); - if (runtimeRequests == nullptr) + if (owningGraph == nullptr) { return; } @@ -769,7 +769,7 @@ namespace ScriptCanvasEditor if (propertiesComponent) { - ScriptCanvas::GraphVariable* graphVariable = runtimeRequests->FindVariableById(varId);; + ScriptCanvas::GraphVariable* graphVariable = owningGraph->FindVariableById(varId);; propertiesComponent->SetVariable(graphVariable); selection.push_back(propertiesComponent->GetEntityId()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index fcbd1a1680..7c6c161246 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -150,8 +150,6 @@ #include #include -#include -#include #include #include @@ -264,14 +262,7 @@ namespace ScriptCanvasEditor if (editorRequests) { - if (editorRequests->IsFunctionGraph()) - { - assetSaveData.m_assetType = azrtti_typeid(); - } - else - { - assetSaveData.m_assetType = azrtti_typeid(); - } + assetSaveData.m_assetType = azrtti_typeid(); } activeAssets.push_back(assetSaveData); @@ -1303,8 +1294,7 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unknown AssetId")); } - if (assetInfo.m_assetType != azrtti_typeid() && - assetInfo.m_assetType != azrtti_typeid()) + if (assetInfo.m_assetType != azrtti_typeid()) { return AZ::Failure(AZStd::string("Invalid AssetId provided, it's not a Script Canvas supported type")); } @@ -3680,10 +3670,6 @@ namespace ScriptCanvasEditor { buttonEnabled = false; } - else - { - EditorGraphRequestBus::EventResult(buttonEnabled, GetActiveScriptCanvasId(), &EditorGraphRequests::IsRuntimeGraph); - } m_assignToSelectedEntity->setEnabled(buttonEnabled); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index e35435f5dd..382f2a6784 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -16,8 +16,6 @@ #include "UpgradeHelper.h" -#include - #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeTool.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeTool.cpp index 02fb5b567d..c3ccd3105c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeTool.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeTool.cpp @@ -12,8 +12,6 @@ #include "UpgradeTool.h" -#include - #include #include #include @@ -284,10 +282,6 @@ namespace ScriptCanvasEditor { tmpFilesaved = AZ::Utils::SaveObjectToStream(fileStream, AZ::DataStream::ST_XML, &asset.GetAs()->GetScriptCanvasData()); } - else if (asset.GetType() == azrtti_typeid()) - { - tmpFilesaved = AZ::Utils::SaveObjectToStream(fileStream, AZ::DataStream::ST_XML, &asset.GetAs()->GetScriptCanvasData()); - } fileStream.Close(); } @@ -708,10 +702,6 @@ namespace ScriptCanvasEditor { scriptCanvasEntity = UpgradeGraph(asset, this); } - else if (asset.GetType() == azrtti_typeid()) - { - scriptCanvasEntity = UpgradeGraph(asset, this); - } if (!scriptCanvasEntity) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp index 9ec399f616..4bee3ab351 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp @@ -16,8 +16,6 @@ #include "VersionExplorer.h" -#include - #include #include #include @@ -323,10 +321,6 @@ namespace ScriptCanvasEditor { m_scriptCanvasEntity = UpgradeGraphProcess(asset, this); } - else if (asset.GetType() == azrtti_typeid()) - { - m_scriptCanvasEntity = UpgradeGraphProcess(asset, this); - } if (!m_scriptCanvasEntity) { @@ -358,10 +352,6 @@ namespace ScriptCanvasEditor { tmpFilesaved = AZ::Utils::SaveObjectToStream(fileStream, AZ::DataStream::ST_XML, &asset.GetAs()->GetScriptCanvasData()); } - else if (asset.GetType() == azrtti_typeid()) - { - tmpFilesaved = AZ::Utils::SaveObjectToStream(fileStream, AZ::DataStream::ST_XML, &asset.GetAs()->GetScriptCanvasData()); - } fileStream.Close(); } @@ -647,17 +637,6 @@ namespace ScriptCanvasEditor scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); AZ_Assert(scriptCanvasEntity, "The Script Canvas asset must have a valid entity"); } - else if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasFunctionAsset* scriptCanvasAsset = asset.GetAs(); - if (!scriptCanvasAsset) - { - return; - } - - scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "The Script Canvas asset must have a valid entity"); - } auto graphComponent = scriptCanvasEntity->FindComponent(); AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component"); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp similarity index 98% rename from Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.cpp rename to Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp index 2f20fbbabb..66d01691a8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -19,6 +18,7 @@ #include #include +#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.h similarity index 100% rename from Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.h rename to Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 4545063f56..48e8adb9a7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -13,8 +13,6 @@ #include #include #include - -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h index 172569561c..3977807305 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h @@ -83,7 +83,7 @@ namespace ScriptCanvas //// int m_timeUnits = 0; - int m_tickOrder = static_cast(AZ::TICK_DEFAULT); + int m_tickOrder = 1000; // from TICK_DEFAULT bool m_isActive = false; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp index d383afe02f..c4f8f0edd5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp @@ -443,11 +443,6 @@ namespace ScriptCanvas }); } - void ExpressionNodeBase::OnResult([[maybe_unused]] const ExpressionEvaluation::ExpressionResult& result) - { - AZ_Assert(false, "Implementing node must override OnResult."); - } - ExpressionEvaluation::ParseOutcome ExpressionNodeBase::ParseExpression([[maybe_unused]] const AZStd::string& formatString) { AZ_Assert(false , "Implementing node must override OnResult."); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h index 04d5400061..32886e0cd2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.h @@ -37,8 +37,6 @@ namespace ScriptCanvas AZStd::string GetRawFormat() const; const AZStd::unordered_map& GetSlotsByName() const; - - protected: @@ -76,14 +74,11 @@ namespace ScriptCanvas AZ::Crc32 GetPropertyId() const { return AZ_CRC("FormatStringProperty", 0x2c587efa); } protected: - - virtual void OnResult(const ExpressionEvaluation::ExpressionResult& result); virtual ExpressionEvaluation::ParseOutcome ParseExpression(const AZStd::string& formatString); virtual AZStd::string GetExpressionSeparator() const; private: - void PushVariable(const AZStd::string& variableName, const Datum& datum); // NodePropertyInterface... diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h index 56b17095a7..99679e53bc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h @@ -10,7 +10,6 @@ #include #include #include -#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 b76c3ce87c..7812d80717 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp @@ -86,11 +86,6 @@ namespace ScriptCanvas AZ::Outcome IsExposable(const AZ::BehaviorMethod& method) { - if (method.GetNumArguments() > BehaviorContextMethodHelper::MaxCount) - { - return AZ::Failure(AZStd::string("Too many arguments for a Script Canvas method")); - } - for (size_t argIndex(0), sentinel(method.GetNumArguments()); argIndex != sentinel; ++argIndex) { if (const AZ::BehaviorParameter* argument = method.GetArgument(argIndex)) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp index 17f2242b90..9cbbd03e9a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp @@ -177,11 +177,6 @@ namespace ScriptCanvas m_userData.m_methodDefinition = methodDefinition; AZ_Assert(!event.m_parameters.empty(), "No parameters in event!"); - if (!events[eventIndex].m_function) - { - m_handler->InstallGenericHook(events[eventIndex].m_name, &OnEventGenericHook, &m_userData); - } - if (m_eventMap.find(eventId) == m_eventMap.end()) { m_eventMap[eventId] = ConfigureEbusEntry(*methodDefinition, event, populationMapping); @@ -309,12 +304,6 @@ namespace ScriptCanvas return eBusEventEntry; } - void ReceiveScriptEvent::OnEventGenericHook(void* userData, const char* eventName, int eventIndex, AZ::BehaviorValueParameter* result, int numParameters, AZ::BehaviorValueParameter* parameters) - { - ReceiveScriptEvent::EventHookUserData* eventHookUserData(reinterpret_cast(userData)); - eventHookUserData->m_handler->OnEvent(eventName, eventIndex, result, numParameters, parameters); - } - void ReceiveScriptEvent::SetAutoConnectToGraphOwner(bool enabled) { ScriptCanvas::Slot* connectSlot = ReceiveScriptEventProperty::GetConnectSlot(this); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h index d1aa439b42..59800c943f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h @@ -42,7 +42,6 @@ namespace ScriptCanvas ~ReceiveScriptEvent() override; void OnActivate() override; - void OnPostActivate() override; void OnDeactivate() override; const AZ::Data::AssetId GetAssetId() const { return m_scriptEventAssetId; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.cpp index 83cf0621fb..86fe9681e1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.cpp @@ -12,17 +12,6 @@ namespace ScriptCanvas { namespace Math { - void MathExpression::OnResult(const ExpressionEvaluation::ExpressionResult& result) - { - if (result.is()) - { - Datum output; - output.Set(AZStd::any_cast(result)); - PushOutput(output, (*MathExpressionProperty::GetResultSlot(this))); - SignalOutput(MathExpressionProperty::GetOutSlotId(this)); - } - } - ExpressionEvaluation::ParseOutcome MathExpression::ParseExpression(const AZStd::string& formatString) { const AZStd::unordered_set mathInterfaceSet = { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.h index 76d952b92c..eb091cc095 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathExpression.h @@ -37,7 +37,6 @@ namespace ScriptCanvas return AZ::Success(GetSlotsByType(targetSlotType)); } - void OnResult(const ExpressionEvaluation::ExpressionResult& result) override; ExpressionEvaluation::ParseOutcome ParseExpression(const AZStd::string& formatString) override; AZStd::string GetExpressionSeparator() const override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h index 2b6746156d..068043975f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.h @@ -35,9 +35,7 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void InvokeOperator(); }; - } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h index f28c46e0f8..64ea312f5d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.h @@ -35,9 +35,7 @@ namespace ScriptCanvas void ConfigureContracts(SourceType sourceType, AZStd::vector& contractDescs) override; void OnSourceTypeChanged() override; - void InvokeOperator(); }; - } } } 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 376a6154a9..4e777fff2f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp @@ -207,20 +207,6 @@ namespace ScriptCanvas AZ_UNUSED(dataType); } - void OperatorArithmetic::InvokeOperator() - { - if (!m_result.GetType().IsValid()) - { - return; - } - - Evaluate(m_applicableInputs, m_result); - - PushOutput(m_result, (*m_resultSlot)); - - SignalOutput(m_outSlot); - } - SlotId OperatorArithmetic::CreateSlot(AZStd::string_view name, AZStd::string_view toolTip, ConnectionType connectionType) { DynamicDataSlotConfiguration slotConfiguration; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h index 4fcd6a1905..5b2ea00871 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h @@ -100,8 +100,7 @@ namespace ScriptCanvas virtual void Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result); virtual void InitializeSlot(const SlotId& slotId, const Data::Type& dataType); - virtual void InvokeOperator(); - + ////////////////////////////////////////////////////////////////////////// // Translation AZ::Outcome GetDependencies() const override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp index b2cffe79af..8fb5d666fa 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.cpp @@ -20,11 +20,6 @@ namespace ScriptCanvas , m_seconds(0.f) , m_milliseconds(0.f) {} - - void Timer::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h index fa5f4309ed..14fa3a767c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h @@ -34,11 +34,6 @@ namespace ScriptCanvas float m_seconds; float m_milliseconds; - - protected: - - AZ::ScriptTimePoint m_start; - void OnDeactivate() override; }; } } diff --git a/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp b/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp index 792c72b3f6..fe8e8d20df 100644 --- a/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp +++ b/Gems/ScriptCanvas/Code/Source/ScriptCanvasCommonGem.cpp @@ -20,7 +20,6 @@ #include #include #include -#include namespace ScriptCanvas { @@ -41,7 +40,6 @@ namespace ScriptCanvas ScriptCanvas::Node::CreateDescriptor(), ScriptCanvas::Debugger::ServiceComponent::CreateDescriptor(), ScriptCanvas::Graph::CreateDescriptor(), - ScriptCanvasEditor::ScriptCanvasFunctionDataComponent::CreateDescriptor(), ScriptCanvas::GraphVariableManagerComponent::CreateDescriptor(), ScriptCanvas::RuntimeComponent::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 74e0e2e70c..40b5786303 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -25,9 +25,8 @@ set(FILES Include/ScriptCanvas/Asset/RuntimeAssetHandler.h Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h - Include/ScriptCanvas/Asset/Functions/ScriptCanvasFunctionAsset.h - Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.cpp - Include/ScriptCanvas/Asset/Functions/RuntimeFunctionAssetHandler.h + Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp + Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.h Include/ScriptCanvas/Core/ScriptCanvasBus.h Include/ScriptCanvas/Core/ExecutionNotificationsBus.cpp Include/ScriptCanvas/Core/ExecutionNotificationsBus.h diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index a401a0cc1d..339973aa8e 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -14,5 +14,4 @@ set(FILES Builder/ScriptCanvasBuilderWorker.cpp Builder/ScriptCanvasBuilderWorker.h Builder/ScriptCanvasBuilderWorkerUtility.cpp - Builder/ScriptCanvasFunctionBuilderWorker.cpp ) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index ba84163d64..309fa83edc 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -21,8 +21,6 @@ set(FILES Editor/Assets/ScriptCanvasAssetHelpers.h Editor/Assets/ScriptCanvasAssetHelpers.cpp Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h - Editor/Include/ScriptCanvas/Assets/Functions/ScriptCanvasFunctionAssetHandler.h - Editor/Assets/Functions/ScriptCanvasFunctionAssetHandler.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h Editor/Assets/ScriptCanvasAsset.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h @@ -31,11 +29,6 @@ set(FILES Editor/Assets/ScriptCanvasAssetHandler.cpp Editor/Assets/ScriptCanvasAssetHolder.h Editor/Assets/ScriptCanvasAssetHolder.cpp - Editor/Assets/ScriptCanvasAssetInstance.h - Editor/Assets/ScriptCanvasAssetInstance.cpp - Editor/Assets/ScriptCanvasAssetReference.h - Editor/Assets/ScriptCanvasAssetReference.cpp - Editor/Assets/ScriptCanvasAssetReferenceContainer.h Editor/Assets/ScriptCanvasMemoryAsset.h Editor/Assets/ScriptCanvasMemoryAsset.cpp Editor/Assets/ScriptCanvasUndoHelper.h @@ -127,16 +120,12 @@ set(FILES Editor/Model/LibraryDataModel.cpp Editor/Model/UnitTestBrowserFilterModel.h Editor/Model/UnitTestBrowserFilterModel.cpp - Editor/Nodes/EditorLibrary.h - Editor/Nodes/EditorLibrary.cpp Editor/Nodes/NodeCreateUtils.h Editor/Nodes/NodeCreateUtils.cpp Editor/Nodes/NodeDisplayUtils.h Editor/Nodes/NodeDisplayUtils.cpp Editor/Nodes/NodeUtils.h Editor/Nodes/NodeUtils.cpp - Editor/Nodes/ScriptCanvasAssetNode.h - Editor/Nodes/ScriptCanvasAssetNode.cpp Editor/Translation/TranslationHelper.h Editor/Undo/ScriptCanvasGraphCommand.cpp Editor/Undo/ScriptCanvasGraphCommand.h diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp index f016dd0a8d..97aa1667df 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp @@ -73,19 +73,6 @@ namespace ScriptCanvasDeveloper { return AZ::Failure("Active graph is not the newly created graph."); } - else - { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - ScriptCanvasEditor::GeneralRequestBus::BroadcastResult(scriptCanvasId, &ScriptCanvasEditor::GeneralRequests::GetScriptCanvasId, activeGraphCanvasId); - - bool isRuntimeGraph = false; - ScriptCanvasEditor::EditorGraphRequestBus::EventResult(isRuntimeGraph, scriptCanvasId, &ScriptCanvasEditor::EditorGraphRequests::IsRuntimeGraph); - - if (!isRuntimeGraph) - { - return AZ::Failure("Created a new Graph, but graph is not of type Runtime Graph."); - } - } } return CompoundAction::GenerateReport(); diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomationTests/GraphCreationTests.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomationTests/GraphCreationTests.cpp index bc372a4f50..cb182b1852 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomationTests/GraphCreationTests.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomationTests/GraphCreationTests.cpp @@ -75,19 +75,6 @@ namespace ScriptCanvasDeveloper { ReportError("Active graph is not the newly created graph using hotkey."); } - else - { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - ScriptCanvasEditor::GeneralRequestBus::BroadcastResult(scriptCanvasId, &ScriptCanvasEditor::GeneralRequests::GetScriptCanvasId, activeGraphCanvasId); - - bool isRuntimeGraph = false; - ScriptCanvasEditor::EditorGraphRequestBus::EventResult(isRuntimeGraph, scriptCanvasId, &ScriptCanvasEditor::EditorGraphRequests::IsRuntimeGraph); - - if (!isRuntimeGraph) - { - ReportError("Failed to create Runtime graph using button"); - } - } } GraphCanvas::AssetEditorNotificationBus::Handler::BusDisconnect(); diff --git a/Gems/ScriptCanvasTesting/Code/Platform/Common/MSVC/scriptcanvastesting_editor_tests_msvc.cmake b/Gems/ScriptCanvasTesting/Code/Platform/Common/MSVC/scriptcanvastesting_editor_tests_msvc.cmake index 95d699cd27..0d70c9d05c 100644 --- a/Gems/ScriptCanvasTesting/Code/Platform/Common/MSVC/scriptcanvastesting_editor_tests_msvc.cmake +++ b/Gems/ScriptCanvasTesting/Code/Platform/Common/MSVC/scriptcanvastesting_editor_tests_msvc.cmake @@ -8,7 +8,6 @@ ly_add_source_properties( SOURCES Source/Framework/ScriptCanvasTestUtilities.cpp - Tests/ScriptCanvas_Async.cpp Tests/ScriptCanvas_BehaviorContext.cpp Tests/ScriptCanvas_ContainerSupport.cpp Tests/ScriptCanvas_Core.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Async.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Async.cpp deleted file mode 100644 index e50914c0a6..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Async.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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; - -// Asynchronous ScriptCanvas Behaviors - -#if AZ_COMPILER_MSVC - -#include - -class AsyncEvent : public AZ::EBusTraits -{ -public: - - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - using MutexType = AZStd::recursive_mutex; - static const bool LocklessDispatch = true; - - ////////////////////////////////////////////////////////////////////////// - - virtual void OnAsyncEvent() = 0; -}; - -using AsyncEventNotificationBus = AZ::EBus; - -class LongRunningProcessSimulator3000 -{ -public: - - static void Run(const AZ::EntityId& listener) - { - int duration = 40; - while (--duration > 0) - { - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(10)); - } - - AsyncEventNotificationBus::Event(listener, &AsyncEvent::OnAsyncEvent); - } -}; - -class AsyncNode - : public ScriptCanvas::Node - , protected AsyncEventNotificationBus::Handler - , protected AZ::TickBus::Handler -{ -public: - AZ_COMPONENT(AsyncNode, "{0A7FF6C6-878B-42EC-A8BB-4D29C4039853}", ScriptCanvas::Node); - - bool IsEntryPoint() const { return true; } - - AsyncNode() - : Node() - {} - - static void Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(1) - ; - } - } - - void ConfigureSlots() override - { - AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot()); - AddSlot(ScriptCanvas::CommonSlots::GeneralOutSlot()); - } - - void OnActivate() override - { - ScriptCanvasTestFixture::s_asyncOperationActive = true; - AZ::TickBus::Handler::BusConnect(); - AsyncEventNotificationBus::Handler::BusConnect(GetEntityId()); - - std::packaged_task task([this]() { LongRunningProcessSimulator3000::Run(GetEntityId()); }); // wrap the function - - m_eventThread = AZStd::make_shared(AZStd::move(task)); // launch on a thread - } - - void OnDeactivate() override - { - if (m_eventThread) - { - m_eventThread->join(); - m_eventThread.reset(); - } - - // We've received the event, no longer need the bus connection - AsyncEventNotificationBus::Handler::BusDisconnect(); - - // We're done, kick it out. - SignalOutput(GetSlotId("Out")); - - // Disconnect from tick bus as well - AZ::TickBus::Handler::BusDisconnect(); - } - - virtual void HandleAsyncEvent() - { - EXPECT_GT(m_duration, 0.f); - - Shutdown(); - } - - void OnAsyncEvent() override - { - HandleAsyncEvent(); - } - - void Shutdown() - { - ScriptCanvasTestFixture::s_asyncOperationActive = false; - } - - void OnTick(float deltaTime, AZ::ScriptTimePoint) override - { - AZ_TracePrintf("Debug", "Awaiting async operation: %.2f\n", m_duration); - m_duration += deltaTime; - } - -protected: - AZStd::shared_ptr m_eventThread; -private: - double m_duration = 0.f; -}; - -TEST_F(ScriptCanvasTestFixture, Asynchronous_Behaviors) -{ - using namespace ScriptCanvas; - - RegisterComponentDescriptor(); - - // Make the graph. - ScriptCanvas::Graph* graph =nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - ASSERT_TRUE(graph != nullptr); - - AZ::Entity* graphEntity = graph->GetEntity(); - graphEntity->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::Entity* startEntity{ aznew AZ::Entity }; - startEntity->Init(); - - AZ::EntityId startNodeId; - CreateTestNode(graphUniqueId, startNodeId); - - AZ::EntityId asyncNodeId; - CreateTestNode(graphUniqueId, asyncNodeId); - - EXPECT_TRUE(Connect(*graph, startNodeId, ScriptCanvas::CommonSlots::GeneralOutSlot::GetName(), asyncNodeId, ScriptCanvas::CommonSlots::GeneralInSlot::GetName())); - - { - ScopedOutputSuppression supressOutput; - graphEntity->Activate(); - - // Tick the TickBus while the graph entity is active - while (ScriptCanvasTestFixture::s_asyncOperationActive) - { - AZ::TickBus::ExecuteQueuedEvents(); - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(100)); - AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick, 0.01f, AZ::ScriptTimePoint(AZStd::chrono::system_clock::now())); - } - } - - graphEntity->Deactivate(); - delete graphEntity; -} - -/////////////////////////////////////////////////////////////////////////////// - -namespace -{ - // Fibonacci solver, used to compare against the graph version. - long ComputeFibonacci(int digits) - { - int a = 0; - int b = 1; - long sum = 0; - for (int i = 0; i < digits - 2; ++i) - { - sum = a + b; - a = b; - b = sum; - } - return sum; - } -} - -class AsyncFibonacciComputeNode - : public AsyncNode -{ -public: - AZ_COMPONENT(AsyncFibonacciComputeNode, "{B198F52D-708C-414B-BB90-DFF0462D7F03}", AsyncNode); - - AsyncFibonacciComputeNode() - : AsyncNode() - {} - - bool IsEntryPoint() const { return true; } - - static const int k_numberOfFibonacciDigits = 64; - - static void Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(1) - ; - } - } - - void OnActivate() override - { - AZ::TickBus::Handler::BusConnect(); - AsyncEventNotificationBus::Handler::BusConnect(GetEntityId()); - - int digits = k_numberOfFibonacciDigits; - - std::promise p; - m_computeFuture = p.get_future(); - m_eventThread = AZStd::make_shared([this, digits, p = AZStd::move(p)]() mutable - { - p.set_value(ComputeFibonacci(digits)); - AsyncEventNotificationBus::Event(GetEntityId(), &AsyncEvent::OnAsyncEvent); - }); - } - - void HandleAsyncEvent() override - { - m_result = m_computeFuture.get(); - - EXPECT_EQ(m_result, ComputeFibonacci(k_numberOfFibonacciDigits)); - } - - void OnTick(float deltaTime, AZ::ScriptTimePoint) override - { - AZ_TracePrintf("Debug", "Awaiting async fib operation: %.2f\n", m_duration); - m_duration += deltaTime; - - if (m_result != 0) - { - Shutdown(); - } - } - -private: - std::future m_computeFuture; - long m_result = 0; - double m_duration = 0.f; -}; - -TEST_F(ScriptCanvasTestFixture, ComputeFibonacciAsyncGraphTest) -{ - using namespace ScriptCanvas; - - RegisterComponentDescriptor(); - RegisterComponentDescriptor(); - - // Make the graph. - ScriptCanvas::Graph* graph =nullptr; - SystemRequestBus::BroadcastResult(graph, &SystemRequests::MakeGraph); - ASSERT_NE(graph, nullptr); - - AZ::Entity* graphEntity = graph->GetEntity(); - graphEntity->Init(); - - const ScriptCanvasId& graphUniqueId = graph->GetScriptCanvasId(); - - AZ::EntityId startNodeId; - CreateTestNode(graphUniqueId, startNodeId); - - AZ::EntityId asyncNodeId; - CreateTestNode(graphUniqueId, asyncNodeId); - - EXPECT_TRUE(Connect(*graph, startNodeId, "Out", asyncNodeId, "In")); - - graphEntity->Activate(); - - // Tick the TickBus while the graph entity is active - while (ScriptCanvasTestFixture::s_asyncOperationActive) - { - AZ::TickBus::ExecuteQueuedEvents(); - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(100)); - AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick, 0.01f, AZ::ScriptTimePoint(AZStd::chrono::system_clock::now())); - } - - graphEntity->Deactivate(); - delete graphEntity; -} - -#endif // AZ_COMPILER_MSVC diff --git a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake index 681a3c0ba1..b6ab617e26 100644 --- a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake +++ b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake @@ -15,7 +15,6 @@ set(FILES Source/Framework/ScriptCanvasTestApplication.h Source/Framework/EntityRefTests.h Tests/ScriptCanvasTestingTest.cpp - Tests/ScriptCanvas_Async.cpp Tests/ScriptCanvas_BehaviorContext.cpp Tests/ScriptCanvas_ContainerSupport.cpp Tests/ScriptCanvas_Core.cpp From 4a42c32a4b6b4a624aeccae26ee3a74b022162ca Mon Sep 17 00:00:00 2001 From: pereslav Date: Wed, 7 Jul 2021 00:12:30 +0100 Subject: [PATCH 064/156] LYN-4989 Fixed player spawnable index. Build fix for ScriptCanvas gem when Profiling is on Signed-off-by: pereslav --- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp | 2 +- .../Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index 841c22aa8b..488f891e06 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -735,7 +735,7 @@ namespace Multiplayer NetworkEntityHandle MultiplayerSystemComponent::SpawnDefaultPlayerPrefab() { - PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAsset).c_str()), 1); + PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAsset).c_str())); INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity()); NetworkEntityHandle controlledEntity; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index 64d6a9339e..88ada9ddb1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -60,7 +60,7 @@ namespace ScriptCanvas void RuntimeComponent::Execute() { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeAsset.GetId().ToString().c_str()); + AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); AZ_Assert(m_executionState, "RuntimeComponent::Execute called without an execution state"); SC_EXECUTION_TRACE_GRAPH_ACTIVATED(CreateActivationInfo()); SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); @@ -116,7 +116,7 @@ namespace ScriptCanvas AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); #endif - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeAsset.GetId().ToString().c_str()); + AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeOverrides.m_runtimeAsset.GetId()); m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeOverrides.m_runtimeAsset, *this)); From aca8a730a69adf3b2fd29ab5a154f24b9171cfdc Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Tue, 6 Jul 2021 19:42:12 -0500 Subject: [PATCH 065/156] Fixing simple light types appearing back at 0,0,0 after hiding/unhiding. Signed-off-by: Ken Pruiksma --- .../Code/Source/CoreLights/LightDelegateBase.inl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl index 36c53c8fab..a84487749f 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl @@ -134,6 +134,11 @@ namespace AZ // For lights that get their transform from the shape bus, force an OnShapeChanged to update the transform. OnShapeChanged(ShapeChangeReasons::TransformChanged); } + else + { + // OnShapeChanged() already calls this for delegates with a shape bus + HandleShapeChanged(); + } } } From 8592e4fbbe66aaef15dc836e135ca1af45d844aa Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 6 Jul 2021 20:42:09 -0500 Subject: [PATCH 066/156] Added if checks in the get_project* and get_engine* function to protect against None being returned from get_project_json_data and get_engine_json_data respectively (#1880) Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- scripts/o3de/o3de/manifest.py | 42 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index 3d78c990a2..6e6b50a514 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -278,8 +278,10 @@ def get_repos() -> list: def get_engine_projects() -> list: engine_path = get_this_engine_path() engine_object = get_engine_json_data(engine_path=engine_path) - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['projects'])) if 'projects' in engine_object else [] + if engine_object: + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['projects'])) if 'projects' in engine_object else [] + return [] def get_engine_gems() -> list: @@ -289,22 +291,28 @@ def get_engine_gems() -> list: def get_engine_external_subdirectories() -> list: engine_path = get_this_engine_path() engine_object = get_engine_json_data(engine_path=engine_path) - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['external_subdirectories'])) if 'external_subdirectories' in engine_object else [] + if engine_object: + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['external_subdirectories'])) if 'external_subdirectories' in engine_object else [] + return [] def get_engine_templates() -> list: engine_path = get_this_engine_path() engine_object = get_engine_json_data(engine_path=engine_path) - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['templates'])) + if engine_object: + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['templates'])) if 'templates' in engine_object else [] + return [] def get_engine_restricted() -> list: engine_path = get_this_engine_path() engine_object = get_engine_json_data(engine_path=engine_path) - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['restricted'])) if 'restricted' in engine_object else [] + if engine_object: + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['restricted'])) if 'restricted' in engine_object else [] + return [] # project.json queries @@ -314,20 +322,26 @@ def get_project_gems(project_path: pathlib.Path) -> list: def get_project_external_subdirectories(project_path: pathlib.Path) -> list: project_object = get_project_json_data(project_path=project_path) - return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), - project_object['external_subdirectories'])) if 'external_subdirectories' in project_object else [] + if project_object: + return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), + project_object['external_subdirectories'])) if 'external_subdirectories' in project_object else [] + return [] def get_project_templates(project_path: pathlib.Path) -> list: project_object = get_project_json_data(project_path=project_path) - return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), - project_object['templates'])) + if project_object: + return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), + project_object['templates'])) if 'templates' in project_object else [] + return [] def get_project_restricted(project_path: pathlib.Path) -> list: project_object = get_project_json_data(project_path=project_path) - return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), - project_object['restricted'])) if 'restricted' in project_object else [] + if project_object: + return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), + project_object['restricted'])) if 'restricted' in project_object else [] + return [] # Combined manifest queries From 65ad412f3ecab58709ec42039f0a264ed839cc6c Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 6 Jul 2021 19:27:58 -0700 Subject: [PATCH 067/156] The Great ScriptCanvas Purge, Part VI Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index d462695025..588e1cf1d0 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -114,9 +114,6 @@ namespace ScriptCanvas ScriptCanvasEditor::FunctionDefinitionNodeDescriptorComponent::CreateDescriptor(), ScriptCanvasEditor::NodelingDescriptorComponent::CreateDescriptor() }); - - auto libraryDescriptors = ScriptCanvasEditor::GetLibraryDescriptors(); - m_descriptors.insert(m_descriptors.end(), libraryDescriptors.begin(), libraryDescriptors.end()); } AZ::ComponentTypeList ScriptCanvasModule::GetRequiredSystemComponents() const From 75933ff7fd51fcbc94feb08f1c0fffaccba670f0 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 6 Jul 2021 21:03:31 -0700 Subject: [PATCH 068/156] The Great ScriptCanvas Purge, Part VII Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Include/ScriptCanvas/Core/Connection.cpp | 7 ++++++- .../Code/Include/ScriptCanvas/Core/Connection.h | 2 -- .../Include/ScriptCanvas/Libraries/Core/GetVariable.cpp | 2 +- .../Include/ScriptCanvas/Libraries/Core/SetVariable.cpp | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.cpp index 2a2c055416..d97a208064 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.cpp @@ -168,7 +168,12 @@ namespace ScriptCanvas { if (nodeId == m_sourceEndpoint.GetNodeId() || nodeId == m_targetEndpoint.GetNodeId()) { - GraphRequestBus::Event(*GraphNotificationBus::GetCurrentBusId(), &GraphRequests::DisconnectById, GetEntityId()); + Slot* sourceSlot{}; + NodeRequestBus::EventResult(sourceSlot, m_sourceEndpoint.GetNodeId(), &NodeRequests::GetSlot, m_sourceEndpoint.GetSlotId()); + if (sourceSlot) + { + GraphRequestBus::Event(sourceSlot->GetNode()->GetOwningScriptCanvasId(), &GraphRequests::DisconnectById, GetEntityId()); + } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h index 1a1c47794b..79a73b6f19 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h @@ -60,8 +60,6 @@ namespace ScriptCanvas // GraphNotificationBus void OnNodeRemoved(const ID& nodeId) override; - void UpdateConnectionStatus(NodeUpdateSlotReport& report); - protected: //------------------------------------------------------------------------- static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index 43fc8ed54b..fb6d2f21e7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -288,7 +288,7 @@ namespace ScriptCanvas VariableRequestBus::EventResult(baseType, GetScopedVariableId(), &VariableRequests::GetType); const GraphVariableMapping* variableMap = nullptr; - GraphRequestBus::EventResult(variableMap, *GraphNotificationBus::GetCurrentBusId(), &GraphRequests::GetVariables); + GraphRequestBus::EventResult(variableMap, GetOwningScriptCanvasId(), &GraphRequests::GetVariables); if (variableMap && baseType.IsValid()) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp index 25a73bc7ce..6d6260aabe 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp @@ -243,7 +243,7 @@ namespace ScriptCanvas VariableRequestBus::EventResult(baseType, GetScopedVariableId(), &VariableRequests::GetType); const GraphVariableMapping* variableMap = nullptr; - GraphRequestBus::EventResult(variableMap, *GraphNotificationBus::GetCurrentBusId(), &GraphRequests::GetVariables); + GraphRequestBus::EventResult(variableMap, GetOwningScriptCanvasId(), &GraphRequests::GetVariables); if (variableMap && baseType.IsValid()) { From ef1f95f1d0d7830fe41dde7b3ce69c7e8939cce9 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Wed, 7 Jul 2021 02:21:09 -0700 Subject: [PATCH 069/156] [MeshOptimizer] Determine the original vertex index based on the position (#1562) * Determine the original vertex index based on the position The Assimp library does not expose the FBX control point indices. This change causes vertices that are close enough in their position to be considered as coming from the same control point. This allows the mesh optimizer to consider vertices with the same control point index (or "original vertex index" as it is called in the code) for deduplication. Signed-off-by: Chris Burel * Use a filter view instead of reimplementing a filter view Signed-off-by: Chris Burel * Don't attempt to weld similar vertices if there's blendshapes Signed-off-by: Chris Burel * Add test for the mesh optimizer's ability to weld nearby vertices Signed-off-by: Chris Burel * Add logging call to show mesh optimizer effect on vertex count Signed-off-by: Chris Burel * Use a bunch of temporaries in order to make `position` `const` Signed-off-by: Chris Burel --- .../SceneAPI/SceneData/Groups/MeshGroup.h | 24 ++--- Gems/SceneProcessing/Code/CMakeLists.txt | 1 + .../MeshOptimizer/MeshOptimizerComponent.cpp | 56 +++++++--- .../MeshOptimizerComponentTests.cpp | 100 ++++++++++++++++++ .../sceneprocessing_editor_tests_files.cmake | 1 + 5 files changed, 158 insertions(+), 24 deletions(-) create mode 100644 Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp diff --git a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h index c06c91a808..5b4c4612ad 100644 --- a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h +++ b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h @@ -28,27 +28,27 @@ namespace AZ } namespace SceneData { - class MeshGroup + class SCENE_DATA_CLASS MeshGroup : public DataTypes::IMeshGroup { public: AZ_RTTI(MeshGroup, "{07B356B7-3635-40B5-878A-FAC4EFD5AD86}", DataTypes::IMeshGroup); AZ_CLASS_ALLOCATOR(MeshGroup, SystemAllocator, 0) - MeshGroup(); - ~MeshGroup() override = default; + SCENE_DATA_API MeshGroup(); + SCENE_DATA_API ~MeshGroup() override = default; - const AZStd::string& GetName() const override; - void SetName(const AZStd::string& name); - void SetName(AZStd::string&& name) override; - const Uuid& GetId() const override; - void OverrideId(const Uuid& id) override; + SCENE_DATA_API const AZStd::string& GetName() const override; + SCENE_DATA_API void SetName(const AZStd::string& name); + SCENE_DATA_API void SetName(AZStd::string&& name) override; + SCENE_DATA_API const Uuid& GetId() const override; + SCENE_DATA_API void OverrideId(const Uuid& id) override; - Containers::RuleContainer& GetRuleContainer() override; - const Containers::RuleContainer& GetRuleContainerConst() const override; + SCENE_DATA_API Containers::RuleContainer& GetRuleContainer() override; + SCENE_DATA_API const Containers::RuleContainer& GetRuleContainerConst() const override; - DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() override; - const DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() const override; + SCENE_DATA_API DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() override; + SCENE_DATA_API const DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() const override; static void Reflect(AZ::ReflectContext* context); static bool VersionConverter(SerializeContext& context, SerializeContext::DataElementNode& classElement); diff --git a/Gems/SceneProcessing/Code/CMakeLists.txt b/Gems/SceneProcessing/Code/CMakeLists.txt index 9aa5bc6763..6fb95d8c00 100644 --- a/Gems/SceneProcessing/Code/CMakeLists.txt +++ b/Gems/SceneProcessing/Code/CMakeLists.txt @@ -111,6 +111,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE Gem::SceneProcessing.Editor.Static AZ::AzTest + AZ::SceneData ) ly_add_googletest( NAME Gem::SceneProcessing.Editor.Tests diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp index e3eb617601..b8ab5bc961 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp @@ -106,7 +106,7 @@ namespace AZ::SceneGenerationComponents auto* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(2); + serializeContext->Class()->Version(3); } } @@ -192,17 +192,12 @@ namespace AZ::SceneGenerationComponents const AZStd::vector> meshes = [](const SceneGraph& graph) { AZStd::vector> meshes; - for (auto it = graph.GetContentStorage().cbegin(); it != graph.GetContentStorage().cend(); ++it) + const auto meshNodes = Containers::MakeDerivedFilterView(graph.GetContentStorage()); + for (auto it = meshNodes.cbegin(); it != meshNodes.cend(); ++it) { - // Skip anything that isn't a mesh. - const auto* mesh = azdynamic_cast(it->get()); - if (!mesh) - { - continue; - } - // Get the mesh data and node index and store them in the vector as a pair, so we can iterate over them later. - meshes.emplace_back(mesh, graph.ConvertToNodeIndex(it)); + // The sequential calls to GetBaseIterator unwrap the layers of FilterIterators from the MakeDerivedFilterView + meshes.emplace_back(&(*it), graph.ConvertToNodeIndex(it.GetBaseIterator().GetBaseIterator().GetBaseIterator())); } return meshes; }(graph); @@ -287,6 +282,12 @@ namespace AZ::SceneGenerationComponents auto [optimizedMesh, optimizedUVs, optimizedTangents, optimizedBitangents, optimizedVertexColors, optimizedSkinWeights] = OptimizeMesh(mesh, mesh, uvDatas, tangentDatas, bitangentDatas, colorDatas, skinWeightDatas, meshGroup, hasBlendShapes); + AZ_TracePrintf(AZ::SceneAPI::Utilities::LogWindow, "Base mesh: %zu vertices, optimized mesh: %zu vertices, %0.02f%% of the original", + mesh->GetUsedControlPointCount(), + optimizedMesh->GetUsedControlPointCount(), + ((float)optimizedMesh->GetUsedControlPointCount() / (float)mesh->GetUsedControlPointCount()) * 100.0f + ); + const NodeIndex optimizedMeshNodeIndex = graph.AddChild(graph.GetNodeParent(nodeIndex), name.c_str(), AZStd::move(optimizedMesh)); auto addOptimizedNodes = [&graph, &optimizedMeshNodeIndex](const auto& originalNodeIndexes, auto& optimizedNodes) @@ -433,6 +434,12 @@ namespace AZ::SceneGenerationComponents const float weightThreshold = skinRule ? skinRule->GetWeightThreshold() : 0.001f; meshBuilder.SetSkinningInfo(ExtractSkinningInfo(meshData, skinWeights, maxWeightsPerVertex, weightThreshold)); + constexpr float positionTolerance = 0.0001f; + constexpr float positionToleranceReciprocal = 1.0f / positionTolerance; + AZStd::unordered_map positionMap{}; + + AZ::u32 currentOriginalVertexIndex = 0; + // Add the vertex data to all the layers const AZ::u32 faceCount = meshData->GetFaceCount(); for (AZ::u32 faceIndex = 0; faceIndex < faceCount; ++faceIndex) @@ -440,8 +447,33 @@ namespace AZ::SceneGenerationComponents meshBuilder.BeginPolygon(baseMesh->GetFaceMaterialId(faceIndex)); for (const AZ::u32 vertexIndex : meshData->GetFaceInfo(faceIndex).vertexIndex) { - const int orgVertexNumber = meshData->GetUsedPointIndexForControlPoint(meshData->GetControlPointIndex(vertexIndex)); - AZ_Assert(orgVertexNumber >= 0, "Invalid vertex number"); + const AZ::u32 orgVertexNumber = [&meshData, &hasBlendShapes, &vertexIndex, &positionMap, ¤tOriginalVertexIndex, positionTolerance, positionToleranceReciprocal]() -> AZ::u32 + { + if (hasBlendShapes) + { + // Don't attempt to weld similar vertices if there's blendshapes + // Welding the vertices here based on position could cause the vertices of a base shape to be + // welded, and the vertices of the blendshape to not be welded, resulting in a vertex count + // mismatch between the two + return meshData->GetUsedPointIndexForControlPoint(meshData->GetControlPointIndex(vertexIndex)); + } + + // Round the vertex position so that a float comparison can be made with entires in the positionMap + // pos = floor( x * 10 + 0.5) * 0.1 + const AZ::Vector3 position = AZ::Vector3( + AZ::Simd::Vec3::Floor( + (meshData->GetPosition(vertexIndex) * positionToleranceReciprocal + AZ::Vector3(0.5f)).GetSimdValue() + ) + ) * positionTolerance; + + const auto& [iter, didInsert] = positionMap.try_emplace(position, currentOriginalVertexIndex); + if (didInsert) + { + ++currentOriginalVertexIndex; + } + return iter->second; + }(); + orgVtxLayer->SetCurrentVertexValue(orgVertexNumber); posLayer->SetCurrentVertexValue(meshData->GetPosition(vertexIndex)); diff --git a/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp b/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp new file mode 100644 index 0000000000..f374cc833c --- /dev/null +++ b/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. 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 + +namespace SceneProcessing +{ + using VertexDeduplicationFixture = SceneProcessing::InitSceneAPIFixture; + + TEST_F(VertexDeduplicationFixture, CanDeduplicateVertices) + { + AZ::ComponentApplication app; + AZ::Entity* systemEntity = app.Create({}, {}); + systemEntity->AddComponent(aznew AZ::MemoryComponent()); + systemEntity->AddComponent(aznew AZ::JobManagerComponent()); + systemEntity->Init(); + systemEntity->Activate(); + + AZ::SceneAPI::Containers::Scene scene("testScene"); + AZ::SceneAPI::Containers::SceneGraph& graph = scene.GetGraph(); + + // Create a simple plane with 2 triangles, 6 total vertices, 2 shared vertices + // 0 --- 1 + // | / | + // | / | + // | / | + // 2 --- 3 + const AZStd::array planeVertexPositions = { + AZ::Vector3{0.0f, 0.0f, 0.0f}, + AZ::Vector3{0.0f, 0.0f, 1.0f}, + AZ::Vector3{1.0f, 0.0f, 1.0f}, + AZ::Vector3{1.0f, 0.0f, 1.0f}, + AZ::Vector3{1.0f, 0.0f, 0.0f}, + AZ::Vector3{0.0f, 0.0f, 0.0f}, + }; + { + auto mesh = AZStd::make_unique(); + { + int i = 0; + for (const AZ::Vector3& position : planeVertexPositions) + { + mesh->AddPosition(position); + mesh->AddNormal(AZ::Vector3::CreateAxisY()); + + // This assumes that the data coming from the import process gives a unique control point + // index to every vertex. This follows the behavior of the AssImp library. + mesh->SetVertexIndexToControlPointIndexMap(i, i); + ++i; + } + } + mesh->AddFace({0, 1, 2}, 0); + mesh->AddFace({3, 4, 5}, 0); + + // The original source mesh should have 6 vertices + EXPECT_EQ(mesh->GetVertexCount(), planeVertexPositions.size()); + + graph.AddChild(graph.GetRoot(), "testMesh", AZStd::move(mesh)); + } + + auto meshGroup = AZStd::make_unique(); + meshGroup->GetSceneNodeSelectionList().AddSelectedNode("testMesh"); + scene.GetManifest().AddEntry(AZStd::move(meshGroup)); + + AZ::SceneGenerationComponents::MeshOptimizerComponent component; + AZ::SceneAPI::Events::GenerateSimplificationEventContext context(scene, "pc"); + component.OptimizeMeshes(context); + + AZ::SceneAPI::Containers::SceneGraph::NodeIndex optimizedNodeIndex = graph.Find(AZStd::string("testMesh").append(AZ::SceneAPI::Utilities::OptimizedMeshSuffix)); + ASSERT_TRUE(optimizedNodeIndex.IsValid()) << "Mesh optimizer did not add an optimized version of the mesh"; + + const auto& optimizedMesh = AZStd::rtti_pointer_cast(graph.GetNodeContent(optimizedNodeIndex)); + ASSERT_TRUE(optimizedMesh); + + // The optimized mesh should have 4 vertices, the 2 shared vertices are welded together + EXPECT_EQ(optimizedMesh->GetVertexCount(), 4); + + systemEntity->Deactivate(); + } +} // namespace SceneProcessing diff --git a/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake b/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake index 9ebe2291a3..c06d21233d 100644 --- a/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake +++ b/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake @@ -7,6 +7,7 @@ set(FILES Tests/InitSceneAPIFixture.h + Tests/MeshBuilder/MeshOptimizerComponentTests.cpp Tests/MeshBuilder/MeshBuilderTests.cpp Tests/MeshBuilder/MeshVerticesTests.cpp Tests/MeshBuilder/SkinInfluencesTests.cpp From 23c044037145dcf4cb06e29211c78dc982be4b18 Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Wed, 7 Jul 2021 12:39:01 +0100 Subject: [PATCH 070/156] tick system while in track view batch render. (#1899) As the batch render will disable Editor idle processing which handles the tick. Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com> --- Code/Editor/TrackView/SequenceBatchRenderDialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp b/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp index e5a51051a2..08b0c1a952 100644 --- a/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp +++ b/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp @@ -13,6 +13,7 @@ #include "SequenceBatchRenderDialog.h" +#include #include // Qt @@ -1215,6 +1216,18 @@ void CSequenceBatchRenderDialog::OnKickIdleTimout() // All done with our custom OnKickIdle, restore editor idle. SetEnableEditorIdleProcessing(true); } + + //When we disable the editor idle processing. system tick is no longer invoked. + //so we call it here to ensure rendering + other systems are updated. + if (!m_editorIdleProcessingEnabled) + { + AZ::ComponentApplication* componentApplication = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(componentApplication, &AZ::ComponentApplicationRequests::GetApplication); + if (componentApplication) + { + componentApplication->TickSystem(); + } + } } void CSequenceBatchRenderDialog::OnKickIdle() From 2ab250333726ce1f6ea7494ac7b7a0668757d348 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 7 Jul 2021 05:28:53 -0700 Subject: [PATCH 071/156] Revert "[MeshOptimizer] Determine the original vertex index based on the position (#1562)" (#1902) This reverts commit ef1f95f1d0d7830fe41dde7b3ce69c7e8939cce9. Signed-off-by: Benjamin Jillich --- .../SceneAPI/SceneData/Groups/MeshGroup.h | 24 ++--- Gems/SceneProcessing/Code/CMakeLists.txt | 1 - .../MeshOptimizer/MeshOptimizerComponent.cpp | 56 +++------- .../MeshOptimizerComponentTests.cpp | 100 ------------------ .../sceneprocessing_editor_tests_files.cmake | 1 - 5 files changed, 24 insertions(+), 158 deletions(-) delete mode 100644 Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp diff --git a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h index 5b4c4612ad..c06c91a808 100644 --- a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h +++ b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.h @@ -28,27 +28,27 @@ namespace AZ } namespace SceneData { - class SCENE_DATA_CLASS MeshGroup + class MeshGroup : public DataTypes::IMeshGroup { public: AZ_RTTI(MeshGroup, "{07B356B7-3635-40B5-878A-FAC4EFD5AD86}", DataTypes::IMeshGroup); AZ_CLASS_ALLOCATOR(MeshGroup, SystemAllocator, 0) - SCENE_DATA_API MeshGroup(); - SCENE_DATA_API ~MeshGroup() override = default; + MeshGroup(); + ~MeshGroup() override = default; - SCENE_DATA_API const AZStd::string& GetName() const override; - SCENE_DATA_API void SetName(const AZStd::string& name); - SCENE_DATA_API void SetName(AZStd::string&& name) override; - SCENE_DATA_API const Uuid& GetId() const override; - SCENE_DATA_API void OverrideId(const Uuid& id) override; + const AZStd::string& GetName() const override; + void SetName(const AZStd::string& name); + void SetName(AZStd::string&& name) override; + const Uuid& GetId() const override; + void OverrideId(const Uuid& id) override; - SCENE_DATA_API Containers::RuleContainer& GetRuleContainer() override; - SCENE_DATA_API const Containers::RuleContainer& GetRuleContainerConst() const override; + Containers::RuleContainer& GetRuleContainer() override; + const Containers::RuleContainer& GetRuleContainerConst() const override; - SCENE_DATA_API DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() override; - SCENE_DATA_API const DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() const override; + DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() override; + const DataTypes::ISceneNodeSelectionList& GetSceneNodeSelectionList() const override; static void Reflect(AZ::ReflectContext* context); static bool VersionConverter(SerializeContext& context, SerializeContext::DataElementNode& classElement); diff --git a/Gems/SceneProcessing/Code/CMakeLists.txt b/Gems/SceneProcessing/Code/CMakeLists.txt index 6fb95d8c00..9aa5bc6763 100644 --- a/Gems/SceneProcessing/Code/CMakeLists.txt +++ b/Gems/SceneProcessing/Code/CMakeLists.txt @@ -111,7 +111,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE Gem::SceneProcessing.Editor.Static AZ::AzTest - AZ::SceneData ) ly_add_googletest( NAME Gem::SceneProcessing.Editor.Tests diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp index b8ab5bc961..e3eb617601 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp @@ -106,7 +106,7 @@ namespace AZ::SceneGenerationComponents auto* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(3); + serializeContext->Class()->Version(2); } } @@ -192,12 +192,17 @@ namespace AZ::SceneGenerationComponents const AZStd::vector> meshes = [](const SceneGraph& graph) { AZStd::vector> meshes; - const auto meshNodes = Containers::MakeDerivedFilterView(graph.GetContentStorage()); - for (auto it = meshNodes.cbegin(); it != meshNodes.cend(); ++it) + for (auto it = graph.GetContentStorage().cbegin(); it != graph.GetContentStorage().cend(); ++it) { + // Skip anything that isn't a mesh. + const auto* mesh = azdynamic_cast(it->get()); + if (!mesh) + { + continue; + } + // Get the mesh data and node index and store them in the vector as a pair, so we can iterate over them later. - // The sequential calls to GetBaseIterator unwrap the layers of FilterIterators from the MakeDerivedFilterView - meshes.emplace_back(&(*it), graph.ConvertToNodeIndex(it.GetBaseIterator().GetBaseIterator().GetBaseIterator())); + meshes.emplace_back(mesh, graph.ConvertToNodeIndex(it)); } return meshes; }(graph); @@ -282,12 +287,6 @@ namespace AZ::SceneGenerationComponents auto [optimizedMesh, optimizedUVs, optimizedTangents, optimizedBitangents, optimizedVertexColors, optimizedSkinWeights] = OptimizeMesh(mesh, mesh, uvDatas, tangentDatas, bitangentDatas, colorDatas, skinWeightDatas, meshGroup, hasBlendShapes); - AZ_TracePrintf(AZ::SceneAPI::Utilities::LogWindow, "Base mesh: %zu vertices, optimized mesh: %zu vertices, %0.02f%% of the original", - mesh->GetUsedControlPointCount(), - optimizedMesh->GetUsedControlPointCount(), - ((float)optimizedMesh->GetUsedControlPointCount() / (float)mesh->GetUsedControlPointCount()) * 100.0f - ); - const NodeIndex optimizedMeshNodeIndex = graph.AddChild(graph.GetNodeParent(nodeIndex), name.c_str(), AZStd::move(optimizedMesh)); auto addOptimizedNodes = [&graph, &optimizedMeshNodeIndex](const auto& originalNodeIndexes, auto& optimizedNodes) @@ -434,12 +433,6 @@ namespace AZ::SceneGenerationComponents const float weightThreshold = skinRule ? skinRule->GetWeightThreshold() : 0.001f; meshBuilder.SetSkinningInfo(ExtractSkinningInfo(meshData, skinWeights, maxWeightsPerVertex, weightThreshold)); - constexpr float positionTolerance = 0.0001f; - constexpr float positionToleranceReciprocal = 1.0f / positionTolerance; - AZStd::unordered_map positionMap{}; - - AZ::u32 currentOriginalVertexIndex = 0; - // Add the vertex data to all the layers const AZ::u32 faceCount = meshData->GetFaceCount(); for (AZ::u32 faceIndex = 0; faceIndex < faceCount; ++faceIndex) @@ -447,33 +440,8 @@ namespace AZ::SceneGenerationComponents meshBuilder.BeginPolygon(baseMesh->GetFaceMaterialId(faceIndex)); for (const AZ::u32 vertexIndex : meshData->GetFaceInfo(faceIndex).vertexIndex) { - const AZ::u32 orgVertexNumber = [&meshData, &hasBlendShapes, &vertexIndex, &positionMap, ¤tOriginalVertexIndex, positionTolerance, positionToleranceReciprocal]() -> AZ::u32 - { - if (hasBlendShapes) - { - // Don't attempt to weld similar vertices if there's blendshapes - // Welding the vertices here based on position could cause the vertices of a base shape to be - // welded, and the vertices of the blendshape to not be welded, resulting in a vertex count - // mismatch between the two - return meshData->GetUsedPointIndexForControlPoint(meshData->GetControlPointIndex(vertexIndex)); - } - - // Round the vertex position so that a float comparison can be made with entires in the positionMap - // pos = floor( x * 10 + 0.5) * 0.1 - const AZ::Vector3 position = AZ::Vector3( - AZ::Simd::Vec3::Floor( - (meshData->GetPosition(vertexIndex) * positionToleranceReciprocal + AZ::Vector3(0.5f)).GetSimdValue() - ) - ) * positionTolerance; - - const auto& [iter, didInsert] = positionMap.try_emplace(position, currentOriginalVertexIndex); - if (didInsert) - { - ++currentOriginalVertexIndex; - } - return iter->second; - }(); - + const int orgVertexNumber = meshData->GetUsedPointIndexForControlPoint(meshData->GetControlPointIndex(vertexIndex)); + AZ_Assert(orgVertexNumber >= 0, "Invalid vertex number"); orgVtxLayer->SetCurrentVertexValue(orgVertexNumber); posLayer->SetCurrentVertexValue(meshData->GetPosition(vertexIndex)); diff --git a/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp b/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.cpp deleted file mode 100644 index f374cc833c..0000000000 --- a/Gems/SceneProcessing/Code/Tests/MeshBuilder/MeshOptimizerComponentTests.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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace SceneProcessing -{ - using VertexDeduplicationFixture = SceneProcessing::InitSceneAPIFixture; - - TEST_F(VertexDeduplicationFixture, CanDeduplicateVertices) - { - AZ::ComponentApplication app; - AZ::Entity* systemEntity = app.Create({}, {}); - systemEntity->AddComponent(aznew AZ::MemoryComponent()); - systemEntity->AddComponent(aznew AZ::JobManagerComponent()); - systemEntity->Init(); - systemEntity->Activate(); - - AZ::SceneAPI::Containers::Scene scene("testScene"); - AZ::SceneAPI::Containers::SceneGraph& graph = scene.GetGraph(); - - // Create a simple plane with 2 triangles, 6 total vertices, 2 shared vertices - // 0 --- 1 - // | / | - // | / | - // | / | - // 2 --- 3 - const AZStd::array planeVertexPositions = { - AZ::Vector3{0.0f, 0.0f, 0.0f}, - AZ::Vector3{0.0f, 0.0f, 1.0f}, - AZ::Vector3{1.0f, 0.0f, 1.0f}, - AZ::Vector3{1.0f, 0.0f, 1.0f}, - AZ::Vector3{1.0f, 0.0f, 0.0f}, - AZ::Vector3{0.0f, 0.0f, 0.0f}, - }; - { - auto mesh = AZStd::make_unique(); - { - int i = 0; - for (const AZ::Vector3& position : planeVertexPositions) - { - mesh->AddPosition(position); - mesh->AddNormal(AZ::Vector3::CreateAxisY()); - - // This assumes that the data coming from the import process gives a unique control point - // index to every vertex. This follows the behavior of the AssImp library. - mesh->SetVertexIndexToControlPointIndexMap(i, i); - ++i; - } - } - mesh->AddFace({0, 1, 2}, 0); - mesh->AddFace({3, 4, 5}, 0); - - // The original source mesh should have 6 vertices - EXPECT_EQ(mesh->GetVertexCount(), planeVertexPositions.size()); - - graph.AddChild(graph.GetRoot(), "testMesh", AZStd::move(mesh)); - } - - auto meshGroup = AZStd::make_unique(); - meshGroup->GetSceneNodeSelectionList().AddSelectedNode("testMesh"); - scene.GetManifest().AddEntry(AZStd::move(meshGroup)); - - AZ::SceneGenerationComponents::MeshOptimizerComponent component; - AZ::SceneAPI::Events::GenerateSimplificationEventContext context(scene, "pc"); - component.OptimizeMeshes(context); - - AZ::SceneAPI::Containers::SceneGraph::NodeIndex optimizedNodeIndex = graph.Find(AZStd::string("testMesh").append(AZ::SceneAPI::Utilities::OptimizedMeshSuffix)); - ASSERT_TRUE(optimizedNodeIndex.IsValid()) << "Mesh optimizer did not add an optimized version of the mesh"; - - const auto& optimizedMesh = AZStd::rtti_pointer_cast(graph.GetNodeContent(optimizedNodeIndex)); - ASSERT_TRUE(optimizedMesh); - - // The optimized mesh should have 4 vertices, the 2 shared vertices are welded together - EXPECT_EQ(optimizedMesh->GetVertexCount(), 4); - - systemEntity->Deactivate(); - } -} // namespace SceneProcessing diff --git a/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake b/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake index c06d21233d..9ebe2291a3 100644 --- a/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake +++ b/Gems/SceneProcessing/Code/sceneprocessing_editor_tests_files.cmake @@ -7,7 +7,6 @@ set(FILES Tests/InitSceneAPIFixture.h - Tests/MeshBuilder/MeshOptimizerComponentTests.cpp Tests/MeshBuilder/MeshBuilderTests.cpp Tests/MeshBuilder/MeshVerticesTests.cpp Tests/MeshBuilder/SkinInfluencesTests.cpp From 635473e5cf9053fbb1e16e0b561452b6d2b29ba8 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 7 Jul 2021 11:29:18 -0500 Subject: [PATCH 072/156] [LYN-4990] Fixed legacy launcher/mac/ios icons and removed some remaining unused Editor icons. Signed-off-by: Chris Galvan --- .../Gem/Resources/CryEngineLogoLauncher.bmp | 3 -- AutomatedTesting/Gem/Resources/GameSDK.ico | 4 +- .../AppIcon.appiconset/iPadAppIcon152x152.png | 4 +- .../AppIcon.appiconset/iPadAppIcon76x76.png | 4 +- .../iPadProAppIcon167x167.png | 4 +- .../iPadSettingsIcon29x29.png | 4 +- .../iPadSettingsIcon58x58.png | 4 +- .../iPadSpotlightIcon40x40.png | 4 +- .../iPadSpotlightIcon80x80.png | 4 +- .../iPhoneAppIcon120x120.png | 4 +- .../iPhoneAppIcon180x180.png | 4 +- .../iPhoneSettingsIcon58x58.png | 4 +- .../iPhoneSettingsIcon87x87.png | 4 +- .../iPhoneSpotlightIcon120x120.png | 4 +- .../iPhoneSpotlightIcon80x80.png | 4 +- .../iPadAppIcon152x152.png | 4 +- .../iPadAppIcon76x76.png | 4 +- .../iPadProAppIcon167x167.png | 4 +- .../iPadSettingsIcon29x29.png | 4 +- .../iPadSettingsIcon58x58.png | 4 +- .../iPadSpotlightIcon40x40.png | 4 +- .../iPadSpotlightIcon80x80.png | 4 +- .../iPhoneAppIcon120x120.png | 4 +- .../iPhoneAppIcon180x180.png | 4 +- .../iPhoneSettingsIcon58x58.png | 4 +- .../iPhoneSettingsIcon87x87.png | 4 +- .../iPhoneSpotlightIcon120x120.png | 4 +- .../iPhoneSpotlightIcon80x80.png | 4 +- .../LaunchImage.launchimage/Contents.json | 38 +------------------ .../iPadLaunchImage1024x768.png | 4 +- .../iPadLaunchImage1536x2048.png | 4 +- .../iPadLaunchImage2048x1536.png | 4 +- .../iPadLaunchImage768x1024.png | 4 +- .../iPhoneLaunchImage1242x2688.png | 3 -- .../iPhoneLaunchImage1792x828.png | 3 -- .../iPhoneLaunchImage2688x1242.png | 3 -- .../iPhoneLaunchImage640x1136.png | 4 +- .../iPhoneLaunchImage640x960.png | 4 +- .../iPhoneLaunchImage828x1792.png | 3 -- .../Gem/Resources/LegacyLogoLauncher.bmp | 3 ++ .../AppIcon.appiconset/Contents.json | 4 +- .../AppIcon.appiconset/icon_128 _2x.png | 3 -- .../AppIcon.appiconset/icon_128.png | 4 +- .../AppIcon.appiconset/icon_128_2x.png | 0 .../AppIcon.appiconset/icon_16.png | 4 +- .../AppIcon.appiconset/icon_16_2x.png | 4 +- .../AppIcon.appiconset/icon_256 _2x.png | 3 -- .../AppIcon.appiconset/icon_256.png | 4 +- .../AppIcon.appiconset/icon_256_2x.png | 0 .../AppIcon.appiconset/icon_32.png | 4 +- .../AppIcon.appiconset/icon_32_2x.png | 4 +- .../AppIcon.appiconset/icon_512.png | 4 +- .../AppIcon.appiconset/icon_512_2x.png | 4 +- Code/Editor/editor_lib_files.cmake | 4 -- Code/Editor/res/about_dark.bmp | 3 -- Code/Editor/res/logo.bmp | 3 -- Code/Editor/res/logo.gif | 3 -- Code/Editor/res/sandbox_dark.bmp | 3 -- Code/Editor/res/sb_welcome_dark.bmp | 3 -- .../TestDPAppIcon.appiconset/Contents.json | 4 +- .../TestDPAppIcon.appiconset/icon_128_2x.png} | 0 .../TestDPAppIcon.appiconset/icon_256_2x.png} | 0 .../TestDPAppIcon.appiconset/Contents.json | 4 +- .../TestDPAppIcon.appiconset/icon_128_2x.png | 3 ++ .../TestDPAppIcon.appiconset/icon_256_2x.png | 3 ++ 65 files changed, 98 insertions(+), 165 deletions(-) delete mode 100644 AutomatedTesting/Gem/Resources/CryEngineLogoLauncher.bmp delete mode 100644 AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1242x2688.png delete mode 100644 AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1792x828.png delete mode 100644 AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage2688x1242.png delete mode 100644 AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage828x1792.png create mode 100644 AutomatedTesting/Gem/Resources/LegacyLogoLauncher.bmp delete mode 100644 AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128 _2x.png rename Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png => AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128_2x.png (100%) delete mode 100644 AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256 _2x.png rename Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png => AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256_2x.png (100%) delete mode 100644 Code/Editor/res/about_dark.bmp delete mode 100644 Code/Editor/res/logo.bmp delete mode 100644 Code/Editor/res/logo.gif delete mode 100644 Code/Editor/res/sandbox_dark.bmp delete mode 100644 Code/Editor/res/sb_welcome_dark.bmp rename Templates/{MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png => DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png} (100%) rename Templates/{MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png => DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png} (100%) create mode 100644 Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png create mode 100644 Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png diff --git a/AutomatedTesting/Gem/Resources/CryEngineLogoLauncher.bmp b/AutomatedTesting/Gem/Resources/CryEngineLogoLauncher.bmp deleted file mode 100644 index fe0adc54a4..0000000000 --- a/AutomatedTesting/Gem/Resources/CryEngineLogoLauncher.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cf6d56fe4c367d39bd78500dd34332fcad57ad41241768b52781dbdb60ddd972 -size 347568 diff --git a/AutomatedTesting/Gem/Resources/GameSDK.ico b/AutomatedTesting/Gem/Resources/GameSDK.ico index cb935cd926..0be1f28b6c 100644 --- a/AutomatedTesting/Gem/Resources/GameSDK.ico +++ b/AutomatedTesting/Gem/Resources/GameSDK.ico @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61efd8df621780af995fc1250918df5e00364ff00f849bef67702cd4b0a152e1 -size 65537 +oid sha256:41239f8345fa91fe546442208461ad3cd17c7a7a7047af45018b97363bfea204 +size 109783 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png index b0dd493c11..ad18894411 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon152x152.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e4901093fa6190bf37291b0fb6de23fba1be8ebbd742775a8565a4106722fbb6 -size 31942 +oid sha256:ebfc95bd4c0cbcc53d0ef9d314d26e09a347a22dabbf210597f405d9ed8646bf +size 7729 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png index 21aa62e96b..888d8cf785 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadAppIcon76x76.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e4ae97c4f44910121a61686862c8342ce598db4cdf9d46b29e96d3cb9e43bd06 -size 22158 +oid sha256:99cb7da9282cfcfa64598455827f27ca6791d45ca0d2c3c2dc090d82468dac03 +size 4447 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png index 6b696a84b2..86aa72016a 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadProAppIcon167x167.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:061e2d0ce8dc852dd298c80f2aed5fee8ea4b87511c00662aa2d00922c0ba3c2 -size 30162 +oid sha256:101568e946f1d4cea86d666187bbf71116bbf62e6eaf6d80bc3c5e2e184bdb15 +size 7938 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png index f3dfa05839..79331c29b1 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon29x29.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0fb4b4b77620d99dae7473b7bd8affe14630419835bd5719167ed200e657fa4f -size 17504 +oid sha256:cf930ffd4efb0b7b627e05aac6e0f56252ea206623e8b5d097d803aa315cdfb8 +size 1812 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png index 5325b805fd..27c4aaef2e 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSettingsIcon58x58.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa9b1194f3244025578225a6a87cbc2dd12c70955ff615c8af640ea7f1334f1 -size 19619 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png index 98d8455838..df1630a95a 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon40x40.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c25ffb1af8160b3202977de8c32aaa235e22c643ffd8004e4546c96868ef3b9 -size 18317 +oid sha256:cf087f357cd439d14651073ac079542c60f0648a30dced2a8d19912124b3f8b6 +size 2310 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png index 7482f6c892..4b7f5d6318 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPadSpotlightIcon80x80.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2db961b8f922a552d8ad374fdb56029efd4049a6cde10399b3d961242c82ce53 -size 22571 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png index da987b86f9..674c6da124 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon120x120.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f39d897a57d4da0a70ede7c91339660b28e9d8c57b3e7d749807b13baa4b85f3 -size 28559 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png index 205e025c36..c0c10c2390 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneAppIcon180x180.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:263b75d58328499eef1f8fa2e64c30706f546badcc0c4464a043b231da93cd0d -size 34969 +oid sha256:3b8717c5f2109dfce1bf7b017278059d4915b524a6eb7e83cfb1926e54ed6869 +size 7383 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png index 0deb4f4f35..27c4aaef2e 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon58x58.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33522ad8a8e826b22dd9ad214f56e63e24bf55c00bd8c845925d848b855dfb48 -size 19619 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png index 78591751d7..9093e13867 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSettingsIcon87x87.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f405c9f3d908d038aea26049e533b0d10955adfac370c7b3b80209997ea706d0 -size 24407 +oid sha256:a32908a839a6cb0ca2a76d6aa60376ba8a14b4428f06c13149ec277514eb5676 +size 4533 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png index 034dcb9fed..674c6da124 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon120x120.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d110f6e151799a2327bcdf5ef94d6fc82b114783a8cc973a8915896679ba4a80 -size 28559 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png index f0fa89149c..4b7f5d6318 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AppIcon.appiconset/iPhoneSpotlightIcon80x80.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:db8f00568fad4e49b05249aaa7a48c9fbf85c8b7a78489c83dc9b8161778bcef -size 22571 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon152x152.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon152x152.png index b0dd493c11..ad18894411 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon152x152.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon152x152.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e4901093fa6190bf37291b0fb6de23fba1be8ebbd742775a8565a4106722fbb6 -size 31942 +oid sha256:ebfc95bd4c0cbcc53d0ef9d314d26e09a347a22dabbf210597f405d9ed8646bf +size 7729 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon76x76.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon76x76.png index 21aa62e96b..888d8cf785 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon76x76.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadAppIcon76x76.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e4ae97c4f44910121a61686862c8342ce598db4cdf9d46b29e96d3cb9e43bd06 -size 22158 +oid sha256:99cb7da9282cfcfa64598455827f27ca6791d45ca0d2c3c2dc090d82468dac03 +size 4447 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadProAppIcon167x167.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadProAppIcon167x167.png index 6b696a84b2..86aa72016a 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadProAppIcon167x167.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadProAppIcon167x167.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:061e2d0ce8dc852dd298c80f2aed5fee8ea4b87511c00662aa2d00922c0ba3c2 -size 30162 +oid sha256:101568e946f1d4cea86d666187bbf71116bbf62e6eaf6d80bc3c5e2e184bdb15 +size 7938 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon29x29.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon29x29.png index f3dfa05839..79331c29b1 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon29x29.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon29x29.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0fb4b4b77620d99dae7473b7bd8affe14630419835bd5719167ed200e657fa4f -size 17504 +oid sha256:cf930ffd4efb0b7b627e05aac6e0f56252ea206623e8b5d097d803aa315cdfb8 +size 1812 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon58x58.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon58x58.png index 5325b805fd..27c4aaef2e 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon58x58.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSettingsIcon58x58.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa9b1194f3244025578225a6a87cbc2dd12c70955ff615c8af640ea7f1334f1 -size 19619 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon40x40.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon40x40.png index 98d8455838..df1630a95a 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon40x40.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon40x40.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c25ffb1af8160b3202977de8c32aaa235e22c643ffd8004e4546c96868ef3b9 -size 18317 +oid sha256:cf087f357cd439d14651073ac079542c60f0648a30dced2a8d19912124b3f8b6 +size 2310 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon80x80.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon80x80.png index 7482f6c892..4b7f5d6318 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon80x80.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPadSpotlightIcon80x80.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2db961b8f922a552d8ad374fdb56029efd4049a6cde10399b3d961242c82ce53 -size 22571 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon120x120.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon120x120.png index da987b86f9..674c6da124 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon120x120.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon120x120.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f39d897a57d4da0a70ede7c91339660b28e9d8c57b3e7d749807b13baa4b85f3 -size 28559 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon180x180.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon180x180.png index 205e025c36..c0c10c2390 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon180x180.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneAppIcon180x180.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:263b75d58328499eef1f8fa2e64c30706f546badcc0c4464a043b231da93cd0d -size 34969 +oid sha256:3b8717c5f2109dfce1bf7b017278059d4915b524a6eb7e83cfb1926e54ed6869 +size 7383 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon58x58.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon58x58.png index 0deb4f4f35..27c4aaef2e 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon58x58.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33522ad8a8e826b22dd9ad214f56e63e24bf55c00bd8c845925d848b855dfb48 -size 19619 +oid sha256:ba5fea53b349e254b4625035a308d5731cb06f6d0adc278874d14db2627962cb +size 3424 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon87x87.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon87x87.png index 78591751d7..9093e13867 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSettingsIcon87x87.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f405c9f3d908d038aea26049e533b0d10955adfac370c7b3b80209997ea706d0 -size 24407 +oid sha256:a32908a839a6cb0ca2a76d6aa60376ba8a14b4428f06c13149ec277514eb5676 +size 4533 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon120x120.png index 034dcb9fed..674c6da124 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon120x120.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d110f6e151799a2327bcdf5ef94d6fc82b114783a8cc973a8915896679ba4a80 -size 28559 +oid sha256:0d0044ebf7e0a5dd23ed64a1289c705d8f6c3c41a62d65e5a1371058855b8cec +size 6546 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon80x80.png index f0fa89149c..4b7f5d6318 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/AutomatedTestingAppIcon.appiconset/iPhoneSpotlightIcon80x80.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:db8f00568fad4e49b05249aaa7a48c9fbf85c8b7a78489c83dc9b8161778bcef -size 22571 +oid sha256:421ad4db14c28ed18666158f9ec30747c5b8c757405c1efb32442978911b0c06 +size 4437 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json index 5ea213954f..f836f07ee7 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,41 +1,5 @@ { "images" : [ - { - "extent" : "full-screen", - "filename" : "iPhoneLaunchImage1242x2688.png", - "idiom" : "iphone", - "minimum-system-version" : "12.0", - "orientation" : "portrait", - "scale" : "3x", - "subtype" : "2688h" - }, - { - "extent" : "full-screen", - "filename" : "iPhoneLaunchImage2688x1242.png", - "idiom" : "iphone", - "minimum-system-version" : "12.0", - "orientation" : "landscape", - "scale" : "3x", - "subtype" : "2688h" - }, - { - "extent" : "full-screen", - "filename" : "iPhoneLaunchImage828x1792.png", - "idiom" : "iphone", - "minimum-system-version" : "12.0", - "orientation" : "portrait", - "scale" : "2x", - "subtype" : "1792h" - }, - { - "extent" : "full-screen", - "filename" : "iPhoneLaunchImage1792x828.png", - "idiom" : "iphone", - "minimum-system-version" : "12.0", - "orientation" : "landscape", - "scale" : "2x", - "subtype" : "1792h" - }, { "extent" : "full-screen", "idiom" : "iphone", @@ -202,4 +166,4 @@ "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png index 1249ef3703..9f586d6af3 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31afa7ed44c5d9844c8d6ce08beccac482c3f43590869a3d190d06e2df377ccc -size 137472 +oid sha256:a4018d9df45b4a04d4cf24a40fe01aa7e30e44a9fdd8ad9a41b0d87791786c12 +size 30442 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png index cdb6d5a82a..c978631c22 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0aac8ef9899442820bec0df8bf6434a46cc787d57c5d6d38a04727b8dc310048 -size 338281 +oid sha256:2eea06cb8ad05acefe9664551af5645d52d9763b82473b1fd4a2b2b6f62e96d3 +size 53550 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png index 954d3084c8..a52e832a42 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c07495891f15b138ba09f142777b0f43217bf8be05cbb74ba938319f3425980c -size 321125 +oid sha256:90991aca91ab7222fdb85c03947cff38f549a6492551e7447e0c8f55022aae48 +size 52467 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png index 021319fbc3..3e441fab3b 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d6bf6acb92421a453a36fc143ab6cefda14d631ea5e6dbf95c6e252a445fcbac -size 144797 +oid sha256:6c8439a64d18dbff17dd67f6405bf49f99695e9b22fc2cc541dc72c6e3167307 +size 30564 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1242x2688.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1242x2688.png deleted file mode 100644 index e190d2b585..0000000000 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1242x2688.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fc79117e25cc7533ccf6724453e3f44a01b4eaaecded6fa826abe897456f36ee -size 405896 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1792x828.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1792x828.png deleted file mode 100644 index 5601f081de..0000000000 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage1792x828.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c7191be3bdae09dc621012a26b0c1b9c15de1d567cf65ff1079e00f8636a32a -size 220720 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage2688x1242.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage2688x1242.png deleted file mode 100644 index 844b23fdd9..0000000000 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage2688x1242.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dfbd362f9cb5f285c23807a032af98150cf5409c514445122683736a3c65008c -size 364976 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png index a15fd777fa..e662e9675c 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9ad650fda925b1c076a67d1ef70315fe4f14db888c9fd36ee4eba1d18c1e7d1 -size 166749 +oid sha256:f752615184160d7a78f28d9eef354c86e544f11eb1dde9f651d7acd315b3f2e6 +size 35934 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png index 2855f4069d..2753529fc2 100644 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png +++ b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16f6e9d7bd15fc528d934c252213de8792812e708b1810191c5f1767f7165852 -size 142331 +oid sha256:1a43f1d893e85aa99d335a657ec0f6c13a741db976c033451ab9a2328b8a5970 +size 35559 diff --git a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage828x1792.png b/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage828x1792.png deleted file mode 100644 index 9ebb93e39c..0000000000 --- a/AutomatedTesting/Gem/Resources/IOSLauncher/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage828x1792.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0252b068b232f521ac6eca4a708fad6eaf257d0a66aa03f4f865f6a0b219cfc -size 236433 diff --git a/AutomatedTesting/Gem/Resources/LegacyLogoLauncher.bmp b/AutomatedTesting/Gem/Resources/LegacyLogoLauncher.bmp new file mode 100644 index 0000000000..7a35cddd49 --- /dev/null +++ b/AutomatedTesting/Gem/Resources/LegacyLogoLauncher.bmp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8433178baebafe984ca23d9325d3c71b5a177fc3b3b869afbb01a583542fbe +size 462842 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/Contents.json b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/Contents.json index bfa8bcf478..2b63c0ee15 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/Contents.json @@ -33,7 +33,7 @@ { "size" : "128x128", "idiom" : "mac", - "filename" : "icon_128 _2x.png", + "filename" : "icon_128_2x.png", "scale" : "2x" }, { @@ -45,7 +45,7 @@ { "size" : "256x256", "idiom" : "mac", - "filename" : "icon_256 _2x.png", + "filename" : "icon_256_2x.png", "scale" : "2x" }, { diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128 _2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128 _2x.png deleted file mode 100644 index 5970ea34ba..0000000000 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128 _2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2 -size 32037 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128.png index 9e30e09547..5a73a4a54d 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9f41a37d2347a617e93bd97adaf6d4c161c471ca3ef7e04b98c65ddda52396dc -size 27833 +oid sha256:f3c651ca45a83d0f68bdaa466826a29b2ca6f674e225d90e68b7dbadc2ba582d +size 6620 diff --git a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128_2x.png similarity index 100% rename from Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png rename to AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_128_2x.png diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16.png index aeb29abd0a..a7ec66841f 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b07984494059bf827bc485cbea06d12e0283811face1a18799495f9ba7ae8af1 -size 20779 +oid sha256:f7d5b15add5104d91a03df7d86898f4bc415d095d11c23555b24440497371948 +size 1061 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16_2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16_2x.png index 445a389d61..474378c926 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16_2x.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_16_2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926 -size 21857 +oid sha256:148fdae6493d7b7e1bb6cc6aae1861e0469838f54dcb3c15cc157a548c707fec +size 1910 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256 _2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256 _2x.png deleted file mode 100644 index 0904cf7ce8..0000000000 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256 _2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:07631f41b8dea80713d2463f81a713a9a93798975b6fb50afbeeb13d26c57fa2 -size 48899 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256.png index 5970ea34ba..d30f2d3686 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2 -size 32037 +oid sha256:094620c172320b062f9a1f8cc758ef4bbee11bc0a6049f46ad6b42f9bf613c92 +size 9679 diff --git a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256_2x.png similarity index 100% rename from Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png rename to AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_256_2x.png diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32.png index 445a389d61..474378c926 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926 -size 21857 +oid sha256:148fdae6493d7b7e1bb6cc6aae1861e0469838f54dcb3c15cc157a548c707fec +size 1910 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32_2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32_2x.png index 1fad9bda96..3359e99cd4 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32_2x.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_32_2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad83faf98b49f4e37112baedeae726f4f8d71bcdd1961d9cdad31f043f8ca666 -size 24003 +oid sha256:749bcd29d73e5ef2d1ef8b2d878626d0bca09c6b0d5f1c9dc6cefe7b9082c8cc +size 3758 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512.png index e1517dddb6..f9ff1c15e3 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68529a6c11d5ffa7ecd9d5bbb11ceea28e6852bd45946b525af09602c9a1e1bf -size 48899 +oid sha256:934502e242ff7a2e34e21eed1424b5e0953e701761d158520b3297944132328e +size 18716 diff --git a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512_2x.png b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512_2x.png index b425cb685f..a736c7f6b8 100644 --- a/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512_2x.png +++ b/AutomatedTesting/Gem/Resources/MacLauncher/Images.xcassets/AppIcon.appiconset/icon_512_2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a70003840b418848b2ce6c18ed7cbbfcd6fcf76598a6601dca8b98d9b6c1a2f -size 114706 +oid sha256:5719043940db268dccd2e20bd9d6aa13131890d43edf002a173714ae33890422 +size 29510 diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 5988d9385b..a7331edf70 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -21,7 +21,6 @@ set(FILES res/TreeView.bmp res/VisualLog_PlayerButtons.bmp res/ab_toolbar.bmp - res/about_dark.bmp res/anim.bmp res/animatio.bmp res/animations_tree_soundevent.bmp @@ -137,7 +136,6 @@ set(FILES res/litebulb.bmp res/lock_sel.bmp res/locksele.bmp - res/logo.bmp res/mainfram.bmp res/mann_tagdef_toolbar.bmp res/mann_tagdef_tree.bmp @@ -184,8 +182,6 @@ set(FILES res/rename.ico res/replace.ico res/ribbon_system_button.png - res/sandbox_dark.bmp - res/sb_welcome_dark.bmp res/selectobj.bmp res/seq_1_colour_keys.bmp res/seq_2_colour_keys.bmp diff --git a/Code/Editor/res/about_dark.bmp b/Code/Editor/res/about_dark.bmp deleted file mode 100644 index 2bf31764a6..0000000000 --- a/Code/Editor/res/about_dark.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:887d184cf49cf78c62a1fe53eac3cb8e7b071bb67e09b801a4893445ac4c800f -size 542456 diff --git a/Code/Editor/res/logo.bmp b/Code/Editor/res/logo.bmp deleted file mode 100644 index c67ca02a07..0000000000 --- a/Code/Editor/res/logo.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b65af2765042354ae4110dc7bcbde905e4a55a4995f66b626d15ec6c0fa18c1 -size 96056 diff --git a/Code/Editor/res/logo.gif b/Code/Editor/res/logo.gif deleted file mode 100644 index 00534c61cc..0000000000 --- a/Code/Editor/res/logo.gif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79412e83b32bb6712d9701f78465878a2057a590698a4dc8d8c7aa11de2623ef -size 4227 diff --git a/Code/Editor/res/sandbox_dark.bmp b/Code/Editor/res/sandbox_dark.bmp deleted file mode 100644 index 2bf31764a6..0000000000 --- a/Code/Editor/res/sandbox_dark.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:887d184cf49cf78c62a1fe53eac3cb8e7b071bb67e09b801a4893445ac4c800f -size 542456 diff --git a/Code/Editor/res/sb_welcome_dark.bmp b/Code/Editor/res/sb_welcome_dark.bmp deleted file mode 100644 index 979c61e4af..0000000000 --- a/Code/Editor/res/sb_welcome_dark.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:704faeb96d930d3e6992a1449908aa6d7860b648e2feb38da8bf37cd7268a694 -size 184856 diff --git a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json index bfa8bcf478..2b63c0ee15 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json @@ -33,7 +33,7 @@ { "size" : "128x128", "idiom" : "mac", - "filename" : "icon_128 _2x.png", + "filename" : "icon_128_2x.png", "scale" : "2x" }, { @@ -45,7 +45,7 @@ { "size" : "256x256", "idiom" : "mac", - "filename" : "icon_256 _2x.png", + "filename" : "icon_256_2x.png", "scale" : "2x" }, { diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png similarity index 100% rename from Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png rename to Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png similarity index 100% rename from Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png rename to Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json index bfa8bcf478..2b63c0ee15 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json @@ -33,7 +33,7 @@ { "size" : "128x128", "idiom" : "mac", - "filename" : "icon_128 _2x.png", + "filename" : "icon_128_2x.png", "scale" : "2x" }, { @@ -45,7 +45,7 @@ { "size" : "256x256", "idiom" : "mac", - "filename" : "icon_256 _2x.png", + "filename" : "icon_256_2x.png", "scale" : "2x" }, { diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png new file mode 100644 index 0000000000..d30f2d3686 --- /dev/null +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:094620c172320b062f9a1f8cc758ef4bbee11bc0a6049f46ad6b42f9bf613c92 +size 9679 diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png new file mode 100644 index 0000000000..f9ff1c15e3 --- /dev/null +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:934502e242ff7a2e34e21eed1424b5e0953e701761d158520b3297944132328e +size 18716 From 91656ded9f6602a02e9e44923c009e3d47eae66c Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 7 Jul 2021 11:58:41 -0500 Subject: [PATCH 073/156] Ensured EditContext is created for the legacy tools framework application (Lua) so that settings are able to be displayed Signed-off-by: Chris Galvan --- .../UI/LegacyFramework/Core/EditorFrameworkApplication.cpp | 6 ++++++ .../UI/LegacyFramework/Core/EditorFrameworkApplication.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp index ccc7ef1fd7..f342b1afab 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp @@ -151,6 +151,12 @@ namespace LegacyFramework specializations.Append("tools"); } + void Application::CreateReflectionManager() + { + AZ::ComponentApplication::CreateReflectionManager(); + GetSerializeContext()->CreateEditContext(); + } + int Application::Run(const ApplicationDesc& desc) { if (!AZ::AllocatorInstance::IsReady()) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.h index 42aacf3dbd..5cde088c2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.h @@ -56,6 +56,8 @@ namespace LegacyFramework virtual int Run(const ApplicationDesc& desc); Application(); + void CreateReflectionManager() override; + protected: // ------------------------------------------------------------------ From 29652994d88d2c34431a55bc43a2f089eeef1ac4 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 7 Jul 2021 10:45:16 -0700 Subject: [PATCH 074/156] The Great ScriptCanvas Purge, Part VIII Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Builder/ScriptCanvasBuilderComponent.cpp | 5 ++-- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 26 +++++-------------- .../Code/Include/ScriptCanvas/Core/Graph.h | 4 --- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index a953edeae8..2f30106707 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -5,17 +5,16 @@ * */ -#include - #include #include #include #include #include #include -#include #include +#include #include +#include #include namespace ScriptCanvasBuilder diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 48e8adb9a7..d4eb1cd515 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -50,6 +50,7 @@ namespace GraphCpp MergeScriptAssetDescriptions, VariablePanelSymantics, AddVersionData, + RemoveFunctionGraphMarker, // label your version above Current }; @@ -69,6 +70,11 @@ namespace ScriptCanvas componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid()); } + if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::RemoveFunctionGraphMarker) + { + componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph")); + } + return true; } @@ -99,18 +105,15 @@ namespace ScriptCanvas Nodes::ComparisonExpression::Reflect(context); Datum::Reflect(context); BehaviorContextObjectPtrReflect(context); - GraphData::Reflect(context); - AZ::SerializeContext* serializeContext = azrtti_cast(context); - if (serializeContext) + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(GraphCpp::GraphVersion::Current, &GraphComponentVersionConverter) ->Field("m_graphData", &Graph::m_graphData) ->Field("executionMode", &Graph::m_executionMode) ->Field("m_assetType", &Graph::m_assetType) - ->Field("isFunctionGraph", &Graph::m_isFunctionGraph) ->Field("versionData", &Graph::m_versionData) ; } @@ -150,21 +153,6 @@ namespace ScriptCanvas StatusRequestBus::Handler::BusConnect(scriptCanvasId); } - bool Graph::IsFunctionGraph() const - { - if (m_isFunctionGraph) - { - return true; - } - - return false; - } - - void Graph::MarkFunctionGraph() - { - m_isFunctionGraph = true; - } - void Graph::MarkVersion() { m_versionData.MarkLatest(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 92de8f3c3e..bdd71a73f8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -110,9 +110,6 @@ namespace ScriptCanvas Graph* GetGraph() { return this; } - bool IsFunctionGraph() const; - void MarkFunctionGraph(); - GraphData* GetGraphData() override { return &m_graphData; } const GraphData* GetGraphDataConst() const override { return &m_graphData; } const VariableData* GetVariableDataConst() const { return const_cast(this)->GetVariableData(); } @@ -204,7 +201,6 @@ namespace ScriptCanvas AZ::Data::AssetType m_assetType; private: - bool m_isFunctionGraph = false; ScriptCanvasId m_scriptCanvasId; ExecutionMode m_executionMode = ExecutionMode::Interpreted; VersionData m_versionData; From b9f70412c4a73b780b31f7a142f7c1f05b063ef5 Mon Sep 17 00:00:00 2001 From: sharmajs-amzn <82233357+sharmajs-amzn@users.noreply.github.com> Date: Wed, 7 Jul 2021 11:16:14 -0700 Subject: [PATCH 075/156] Moving flaky test test_WindowsAndMac_ComparisonOperations_Success to sandbox test suite (#1750) Signed-off-by: sharmajs --- .../asset_processor_tests/CMakeLists.txt | 13 +++++++++++++ .../asset_bundler_batch_tests.py | 1 + 2 files changed, 14 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt index f05aff6db3..baf8e9733e 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt @@ -103,6 +103,19 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AssetBundlerBatch ) + ly_add_pytest( + NAME AssetPipelineTests.AssetBundler_SandBox + TEST_SUITE sandbox + PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py + PYTEST_MARKS "SUITE_sandbox" # run only sandbox tests in this file + EXCLUDE_TEST_RUN_TARGET_FROM_IDE + TEST_SERIAL + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + AZ::AssetBundlerBatch + ) + ly_add_pytest( NAME AssetPipelineTests.AssetBuilder PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py index 926f1cc602..1a5ece92e1 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py @@ -730,6 +730,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): @pytest.mark.BAT @pytest.mark.assetpipeline + @pytest.mark.SUITE_sandbox @pytest.mark.test_case_id("C16877174") @pytest.mark.test_case_id("C16877175") @pytest.mark.test_case_id("C16877178") From 02922806a5ba3d284cb3d740f9f65fe17161f081 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 7 Jul 2021 13:29:33 -0500 Subject: [PATCH 076/156] Updated gem.json for all top-level Gems. (#1715) (#1917) * Updated gem.json for all top-level Gems. All the top level gems now have identical gem.json formats based on the DefautlGem template gem.json. Two additional fields have been added, a type: field and a requirements: field. These fields are for display in Project Mananger. All gem.json files have a default requirements: value of None. Devs are responsible for providing requirements. Gem descriptions and tags have been signed off by developers. Signed-off-by: Cronin * Fixed minor formatting issues with RADTelemetry gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to QtForPython gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the Twitch gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to AWSCore gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the AtomTressFX gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the AudioEngineWwise gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the CertificateManager gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing extra whitespace in summary of CrashReporting gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the CustomAssetExample gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing extra whitespace in editorPythonBindings gem summary Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the ScriptedEntityTweener gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the Gestures gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing extra whitetspace in the summary of the GameStateSamples gem Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding newline to the end of the ExpressionEvaluation gem.json Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the ProjectManager PythonBindings.cpp code to reference the newer fields in the gem.json files Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updating the Gem and Project templates gem.json files to include the "type" and the "requirements" field. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the default "requirments" field value to be empty string instead of "None" This works better with the ProjectManager GemInfoFromPath function. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Correcting "summary" field name Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added the requirements text to the AudioEngineWwise Gem This gem requires downloading the Wwise 3rdParty library from AudioKinetic's website Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Co-authored-by: Mike Cronin <58789750+micronAMZN@users.noreply.github.com> --- AutomatedTesting/Gem/gem.json | 24 +++---- .../ProjectManager/Source/PythonBindings.cpp | 26 +++++-- Gems/AWSClientAuth/gem.json | 18 ++--- Gems/AWSCore/gem.json | 24 +++---- Gems/AWSMetrics/gem.json | 22 +++--- Gems/Achievements/gem.json | 22 +++--- Gems/AssetMemoryAnalyzer/gem.json | 31 +++------ Gems/AssetValidation/gem.json | 22 +++--- Gems/Atom/Asset/ImageProcessingAtom/gem.json | 6 +- Gems/Atom/Asset/Shader/gem.json | 6 +- Gems/Atom/Bootstrap/gem.json | 6 +- Gems/Atom/Component/DebugCamera/gem.json | 6 +- Gems/Atom/Feature/Common/gem.json | 6 +- Gems/Atom/RHI/DX12/gem.json | 6 +- Gems/Atom/RHI/Metal/gem.json | 6 +- Gems/Atom/RHI/Null/gem.json | 6 +- Gems/Atom/RHI/Vulkan/gem.json | 6 +- Gems/Atom/RHI/gem.json | 6 +- Gems/Atom/RPI/gem.json | 6 +- Gems/Atom/Tools/AtomToolsFramework/gem.json | 6 +- Gems/Atom/Tools/MaterialEditor/gem.json | 6 +- Gems/Atom/gem.json | 11 ++- Gems/AtomContent/ReferenceMaterials/gem.json | 18 ++--- Gems/AtomContent/Sponza/gem.json | 18 ++--- Gems/AtomContent/gem.json | 18 +++-- Gems/AtomLyIntegration/AtomBridge/gem.json | 6 +- Gems/AtomLyIntegration/AtomFont/gem.json | 6 +- .../AtomLyIntegration/AtomImGuiTools/gem.json | 8 ++- .../AtomViewportDisplayIcons/gem.json | 6 +- .../AtomViewportDisplayInfo/gem.json | 6 +- .../AtomLyIntegration/CommonFeatures/gem.json | 6 +- Gems/AtomLyIntegration/EMotionFXAtom/gem.json | 6 +- Gems/AtomLyIntegration/ImguiAtom/gem.json | 6 +- .../DccScriptingInterface/gem.json | 6 +- Gems/AtomLyIntegration/gem.json | 9 ++- Gems/AtomTressFX/gem.json | 19 +++--- Gems/AudioEngineWwise/gem.json | 34 +++------- Gems/AudioSystem/gem.json | 27 +++----- Gems/AutomatedLauncherTesting/gem.json | 22 +++--- Gems/Blast/gem.json | 43 +++--------- Gems/Camera/gem.json | 27 +++----- Gems/CameraFramework/gem.json | 27 +++----- Gems/CertificateManager/gem.json | 18 ++--- Gems/CrashReporting/gem.json | 27 +++----- Gems/CustomAssetExample/gem.json | 25 +++---- Gems/DebugDraw/gem.json | 19 +++--- Gems/DevTextures/gem.json | 18 ++--- Gems/EMotionFX/gem.json | 29 +++----- Gems/EditorPythonBindings/gem.json | 25 +++---- Gems/ExpressionEvaluation/gem.json | 22 +++--- Gems/FastNoise/gem.json | 43 +++--------- Gems/GameState/gem.json | 22 +++--- Gems/GameStateSamples/gem.json | 55 +++------------ Gems/Gestures/gem.json | 17 ++--- Gems/GradientSignal/gem.json | 43 +++--------- Gems/GraphCanvas/gem.json | 19 +++--- Gems/GraphModel/gem.json | 32 +++------ Gems/HttpRequestor/gem.json | 18 ++--- Gems/ImGui/gem.json | 36 +++------- Gems/InAppPurchases/gem.json | 18 ++--- Gems/LandscapeCanvas/gem.json | 67 +++---------------- Gems/LmbrCentral/gem.json | 21 +++--- Gems/LocalUser/gem.json | 22 +++--- Gems/LyShine/gem.json | 45 +++---------- Gems/LyShineExamples/gem.json | 32 +++------ Gems/Maestro/gem.json | 21 +++--- Gems/MessagePopup/gem.json | 31 +++------ Gems/Metastream/gem.json | 18 ++--- Gems/Microphone/gem.json | 25 +++---- Gems/Multiplayer/gem.json | 17 ++--- Gems/MultiplayerCompression/gem.json | 12 ++-- Gems/NvCloth/gem.json | 12 ++-- Gems/PBSreferenceMaterials/gem.json | 18 ++--- Gems/PhysX/gem.json | 28 +++----- Gems/PhysXDebug/gem.json | 35 +++------- Gems/PhysXSamples/gem.json | 48 +++---------- Gems/Prefab/PrefabBuilder/gem.json | 23 +++---- Gems/Presence/gem.json | 22 +++--- Gems/PrimitiveAssets/gem.json | 18 ++--- Gems/PythonAssetBuilder/gem.json | 25 +++---- Gems/QtForPython/gem.json | 34 +++------- Gems/RADTelemetry/gem.json | 18 ++--- Gems/SaveData/gem.json | 24 +++---- Gems/SceneLoggingExample/gem.json | 20 +++--- Gems/SceneProcessing/gem.json | 28 +++----- Gems/ScriptCanvas/gem.json | 38 +++-------- Gems/ScriptCanvasDeveloper/gem.json | 38 +++-------- Gems/ScriptCanvasPhysics/gem.json | 40 +++-------- Gems/ScriptCanvasTesting/gem.json | 37 +++------- Gems/ScriptEvents/gem.json | 27 +++----- Gems/ScriptedEntityTweener/gem.json | 20 +++--- Gems/SliceFavorites/gem.json | 22 +++--- Gems/StartingPointCamera/gem.json | 41 +++--------- Gems/StartingPointInput/gem.json | 27 +++----- Gems/StartingPointMovement/gem.json | 27 +++----- Gems/SurfaceData/gem.json | 36 +++------- Gems/TestAssetBuilder/gem.json | 23 +++---- Gems/TextureAtlas/gem.json | 23 +++---- Gems/TickBusOrderViewer/gem.json | 22 +++--- Gems/Twitch/gem.json | 25 +++---- Gems/UiBasics/gem.json | 18 ++--- Gems/Vegetation/gem.json | 50 +++----------- Gems/VideoPlaybackFramework/gem.json | 22 +++--- Gems/VirtualGamepad/gem.json | 24 +++---- Gems/WhiteBox/gem.json | 27 +++----- Templates/AssetGem/Template/gem.json | 9 ++- Templates/DefaultGem/Template/gem.json | 8 ++- .../DefaultProject/Template/Code/gem.json | 8 ++- .../MinimalProject/Template/Code/gem.json | 8 ++- 109 files changed, 900 insertions(+), 1466 deletions(-) diff --git a/AutomatedTesting/Gem/gem.json b/AutomatedTesting/Gem/gem.json index b1638002af..6c8c7829ce 100644 --- a/AutomatedTesting/Gem/gem.json +++ b/AutomatedTesting/Gem/gem.json @@ -1,16 +1,12 @@ { - "GemFormatVersion": 4, - "Uuid": "afc25e1593194d6283d9ff744ab6d5a1", - "Name": "AutomatedTesting", - "DisplayName": "AutomatedTesting", - "Version": "0.1.0", - "Summary": "A short description of my Gem.", - "Tags": ["Game"], - "IconPath": "preview.png", - "IsGameGem": true, - "Modules": [ - { - "Type": "GameModule" - } - ] + "gem_name": "AutomatedTesting", + "display_name": "AutomatedTesting", + "license": "Apache-2.0 Or MIT", + "origin": "Amazon Web Services, Inc.", + "type": "Code", + "summary": "Project Gem for customizing the AutomatedTesting project functionality.", + "canonical_tags": ["Gem"], + "user_tags": [], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index ca49542ccf..167cf6d10e 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -648,10 +648,10 @@ namespace O3DE::ProjectManager gemInfo.m_name = Py_To_String(data["gem_name"]); // optional - gemInfo.m_displayName = Py_To_String_Optional(data, "DisplayName", gemInfo.m_name); - gemInfo.m_summary = Py_To_String_Optional(data, "Summary", ""); - gemInfo.m_version = Py_To_String_Optional(data, "Version", ""); - gemInfo.m_requirement = Py_To_String_Optional(data, "Requirements", ""); + gemInfo.m_displayName = Py_To_String_Optional(data, "display_name", gemInfo.m_name); + gemInfo.m_summary = Py_To_String_Optional(data, "summary", ""); + gemInfo.m_version = ""; + gemInfo.m_requirement = Py_To_String_Optional(data, "requirements", ""); gemInfo.m_creator = Py_To_String_Optional(data, "origin", ""); if (gemInfo.m_creator.contains("Open 3D Engine")) @@ -659,13 +659,27 @@ namespace O3DE::ProjectManager gemInfo.m_gemOrigin = GemInfo::GemOrigin::Open3DEEngine; } - if (data.contains("Tags")) + if (data.contains("user_tags")) { - for (auto tag : data["Tags"]) + for (auto tag : data["user_tags"]) { gemInfo.m_features.push_back(Py_To_String(tag)); } } + + QString gemType = Py_To_String_Optional(data, "type", ""); + if (gemType == "Asset") + { + gemInfo.m_types |= GemInfo::Type::Asset; + } + if (gemType == "Code") + { + gemInfo.m_types |= GemInfo::Type::Code; + } + if (gemType == "Tool") + { + gemInfo.m_types |= GemInfo::Type::Tool; + } } catch ([[maybe_unused]] const std::exception& e) { diff --git a/Gems/AWSClientAuth/gem.json b/Gems/AWSClientAuth/gem.json index 89beb4a382..76183cd785 100644 --- a/Gems/AWSClientAuth/gem.json +++ b/Gems/AWSClientAuth/gem.json @@ -1,12 +1,12 @@ { "gem_name": "AWSClientAuth", - "GemFormatVersion": 3, - "Uuid": "c74f2756f5874c0d8d29646dfc9cb0ad", - "Name": "AWSClientAuth", - "DisplayName": "AWS Client Auth", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "AWS Client Auth provides client authentication and AWS authorization solution", - "Tags": ["AWS", "Amazon Cognito", "Authentication", "Authorization"], - "IconPath": "preview.png" + "display_name": "AWS Client Authorization", + "license": "Apache-2.0 Or MIT", + "origin": "Amazon Web Services, Inc.", + "type": "Code", + "summary": "AWS Client Auth provides client authentication and AWS authorization solution.", + "canonical_tags": ["Gem"], + "user_tags": ["AWS", "Network", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AWSCore/gem.json b/Gems/AWSCore/gem.json index af52acf746..bbaa4eb155 100644 --- a/Gems/AWSCore/gem.json +++ b/Gems/AWSCore/gem.json @@ -1,18 +1,12 @@ { "gem_name": "AWSCore", - "GemFormatVersion": 4, - "Uuid": "c3710872891c4401b0cbdabfca066cb5", - "Name": "AWSCore", - "DisplayName": "AWS Core", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "This Gem is automatically enabled when selecting any of the AWS Feature Gems. It provides basic shared functionalities such as AWS SDK initialization and client configuration.", - "Tags": [ - "AWS", - "API", - "AWSCore", - "Cloud", - "Connected" - ], - "IconPath": "preview.png" + "display_name": "AWS Core", + "license": "Apache-2.0 Or MIT", + "origin": "Amazon Web Services, Inc.", + "type": "Code", + "summary": "The AWS Core Gem provides basic shared AWS functionality such as AWS SDK initialization and client configuration, and is automatically added when selecting any AWS feature Gem.", + "canonical_tags": ["Gem"], + "user_tags": ["AWS", "Network", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AWSMetrics/gem.json b/Gems/AWSMetrics/gem.json index 014434d408..480200c565 100644 --- a/Gems/AWSMetrics/gem.json +++ b/Gems/AWSMetrics/gem.json @@ -1,16 +1,12 @@ { "gem_name": "AWSMetrics", - "GemFormatVersion": 4, - "Uuid": "cc6fc7a18fc047039a369a26100fcbbe", - "Name": "AWSMetrics", - "DisplayName": "AWS Metrics", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "AWS Metrics provides metrics submission and analytics solution.", - "Tags": [ - "AWS", - "AWSMetrics", - "Cloud" - ], - "IconPath": "preview.png" + "display_name": "AWS Metrics", + "license": "Apache-2.0 Or MIT", + "origin": "Amazon Web Services, Inc.", + "type": "Code", + "summary": "The AWS Metrics Gem provides a solution for AWS metrics submission and analytics.", + "canonical_tags": ["Gem"], + "user_tags": ["AWS", "Network", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Achievements/gem.json b/Gems/Achievements/gem.json index 746e2a1e50..8a30390295 100644 --- a/Gems/Achievements/gem.json +++ b/Gems/Achievements/gem.json @@ -1,16 +1,12 @@ { "gem_name": "Achievements", - "GemFormatVersion": 4, - "Uuid": "6f8d953dd4fc4bb6ad34c9118a7b789f", - "Name": "Achievements", - "DisplayName": "Achievements", - "Version": "0.1.0", - "Summary": "Platform agnostic interface for retrieving achievement details and unlocking achievements.", - "Tags": ["Achievement", "Achievements", "Trophy", "Trophies"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Achievements", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Achievements Gem provides a target platform agnostic interface for retrieving achievement details and unlocking achievements.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Achievements"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AssetMemoryAnalyzer/gem.json b/Gems/AssetMemoryAnalyzer/gem.json index 62b4387508..8c63d51e1a 100644 --- a/Gems/AssetMemoryAnalyzer/gem.json +++ b/Gems/AssetMemoryAnalyzer/gem.json @@ -1,25 +1,12 @@ { "gem_name": "AssetMemoryAnalyzer", - "GemFormatVersion": 4, - "Uuid": "35414634480a4d4c8412c60fe62f4c81", - "Name": "AssetMemoryAnalyzer", - "DisplayName": "AssetMemoryAnalyzer", - "Version": "0.1.0", - "Summary": "Provides debug visualization of the AssetMemoryDriller to show how individual assets are consuming memory.", - "Tags": ["debug"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "bab8807a1bc646b3909f3cc200ffeedf", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "ImGui GEM" - } - ] + "display_name": "Asset Memory Analyzer", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Asset Memory Analyzer Gem provides tools to profile asset memory usage in Open 3D Engine through ImGUI (Immediate Mode Graphical User Interface).", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Utillity", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AssetValidation/gem.json b/Gems/AssetValidation/gem.json index 1f27fcb20f..8a00dc27ca 100644 --- a/Gems/AssetValidation/gem.json +++ b/Gems/AssetValidation/gem.json @@ -1,16 +1,12 @@ { "gem_name": "AssetValidation", - "GemFormatVersion": 4, - "Uuid": "5a5c3c10b91d4b4ea8baef474c5b5d49", - "Name": "AssetValidation", - "DisplayName": "AssetValidation", - "Version": "0.1.0", - "Summary": "Tools for managing your assets and their dependencies during development", - "Tags": ["Untagged"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Asset Validation", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Asset Validation Gem provides seed-related commands to ensure assets have valid seeds for asset bundling.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Utility", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json index 86256bff9d..45d96f7168 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/gem.json +++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json @@ -1,10 +1,14 @@ { "gem_name": "ImageProcessingAtom", "display_name": "Atom Image Processing", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Asset/Shader/gem.json b/Gems/Atom/Asset/Shader/gem.json index 71c741f436..eadf34acff 100644 --- a/Gems/Atom/Asset/Shader/gem.json +++ b/Gems/Atom/Asset/Shader/gem.json @@ -1,10 +1,14 @@ { "gem_name": "AtomShader", "display_name": "Atom Shader Builder", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json index 8aa5cade6e..d5f287eb7f 100644 --- a/Gems/Atom/Bootstrap/gem.json +++ b/Gems/Atom/Bootstrap/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_Bootstrap", "display_name": "Atom Bootstrap", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json index 06d39d1fc0..cb2c597b07 100644 --- a/Gems/Atom/Component/DebugCamera/gem.json +++ b/Gems/Atom/Component/DebugCamera/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_Component_DebugCamera", "display_name": "Atom Debug Camera Component", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json index 6980863b4c..cbaa56e0d7 100644 --- a/Gems/Atom/Feature/Common/gem.json +++ b/Gems/Atom/Feature/Common/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_Feature_Common", "display_name": "Atom Feature Common", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json index 683ccfb43a..df0ae12cc4 100644 --- a/Gems/Atom/RHI/DX12/gem.json +++ b/Gems/Atom/RHI/DX12/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_RHI_DX12", "display_name": "Atom RHI DX12", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json index 3e1726e8fa..497e0149b6 100644 --- a/Gems/Atom/RHI/Metal/gem.json +++ b/Gems/Atom/RHI/Metal/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_RHI_Metal", "display_name": "Atom RHI Metal", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json index 4fa5f1e480..aa2e08501a 100644 --- a/Gems/Atom/RHI/Null/gem.json +++ b/Gems/Atom/RHI/Null/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_RHI_Null", "display_name": "Atom RHI Null", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json index 1f2fcd7f30..2b43de4ab1 100644 --- a/Gems/Atom/RHI/Vulkan/gem.json +++ b/Gems/Atom/RHI/Vulkan/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_RHI_Vulkan", "display_name": "Atom RHI Vulkan", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index eb67e40a4a..015ee64994 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_RHI", "display_name": "Atom RHI", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json index 7e822611a9..f30a1c3201 100644 --- a/Gems/Atom/RPI/gem.json +++ b/Gems/Atom/RPI/gem.json @@ -2,9 +2,13 @@ "gem_name": "Atom_RPI", "display_name": "Atom API", "summary": "", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json index 3060d3f51a..5cea71c5cc 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/gem.json +++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json @@ -1,10 +1,14 @@ { "gem_name": "AtomToolsFramework", "display_name": "Atom Tools Framework", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/Tools/MaterialEditor/gem.json b/Gems/Atom/Tools/MaterialEditor/gem.json index 5113effc0a..83d9909a84 100644 --- a/Gems/Atom/Tools/MaterialEditor/gem.json +++ b/Gems/Atom/Tools/MaterialEditor/gem.json @@ -1,10 +1,14 @@ { "gem_name": "MaterialEditor", "display_name": "Atom Material Editor", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", "summary": "Editor for creating, modifying, and previewing materials", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json index 91bc9bcf53..c2aa033bf7 100644 --- a/Gems/Atom/gem.json +++ b/Gems/Atom/gem.json @@ -1,5 +1,12 @@ { "gem_name": "Atom", - "display_name": "Atom", - "summary": "Next-Gen Rendering Package for the O3DE engine" + "display_name": "Atom Renderer", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Atom Renderer Gem provides Atom Renderer and its associated tools (such as Material Editor), utilites, libraries, and interfaces.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Core"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AtomContent/ReferenceMaterials/gem.json b/Gems/AtomContent/ReferenceMaterials/gem.json index baa89f2a4a..cb1d6f7a2e 100644 --- a/Gems/AtomContent/ReferenceMaterials/gem.json +++ b/Gems/AtomContent/ReferenceMaterials/gem.json @@ -1,12 +1,12 @@ { "gem_name": "ReferenceMaterials", - "GemFormatVersion": 3, - "Uuid": "99eac95298d847a6914d7b9e69db6f84", - "Name": "ReferenceMaterials", - "DisplayName": "ReferenceMaterials", - "Version": "0.1.0", - "LinkType": "NoCode", - "Summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)", - "Tags": ["Asset"], - "IconPath": "preview.png" + "display_name": "ReferenceMaterials", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)", + "canonical_tags": ["Gem"], + "user_tags": ["Assets"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AtomContent/Sponza/gem.json b/Gems/AtomContent/Sponza/gem.json index 0bf54d8e36..ef054ce55a 100644 --- a/Gems/AtomContent/Sponza/gem.json +++ b/Gems/AtomContent/Sponza/gem.json @@ -1,12 +1,12 @@ { "gem_name": "Sponza", - "GemFormatVersion": 3, - "Uuid": "860d8ef2aec5425ab197adc4484c09f1", - "Name": "Sponza", - "DisplayName": "Sponza", - "Version": "0.1.0", - "LinkType": "NoCode", - "Summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", - "Tags": ["Asset"], - "IconPath": "preview.png" + "display_name": "Sponza", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", + "canonical_tags": ["Gem"], + "user_tags": ["Assets"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json index b043cbbaca..b1bc35b77b 100644 --- a/Gems/AtomContent/gem.json +++ b/Gems/AtomContent/gem.json @@ -1,14 +1,12 @@ { "gem_name": "AtomContent", - "origin": "The primary repo for Atom goes here: i.e. http://www.mydomain.com", - "license": "What license Atom uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "Atom Content", - "summary": "ontains multiple packages containing source Assets that can be used with Atom", - "canonical_tags": [ - "Gem" - ], - "user_tags": [ - "AtomContent" - ], - "icon_path": "preview.png" + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The Atom Content Gem provides assets for Atom Renderer and a modified version of the Pixar Look Development Studio (https://renderman.pixar.com/look-development-studio).", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Assets", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json index 329741bb8e..49a56d2201 100644 --- a/Gems/AtomLyIntegration/AtomBridge/gem.json +++ b/Gems/AtomLyIntegration/AtomBridge/gem.json @@ -1,10 +1,14 @@ { "gem_name": "Atom_AtomBridge", "display_name": "Atom Bridge", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json index a609061ea3..7e1a71db86 100644 --- a/Gems/AtomLyIntegration/AtomFont/gem.json +++ b/Gems/AtomLyIntegration/AtomFont/gem.json @@ -1,10 +1,14 @@ { "gem_name": "AtomFont", "display_name": "Atom Font", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json index 5cee62f7bb..ff20d5a19f 100644 --- a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json +++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json @@ -1,10 +1,16 @@ { "gem_name": "AtomImGuiTools", "display_name": "Atom ImGui", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + "Debug", + "Rendering" + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json index 41f69e33a0..52dbb219d3 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json @@ -1,10 +1,14 @@ { "gem_name": "AtomViewportDisplayIcons", "display_name": "Atom Viewport Display Icons", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json index 04e2464a26..f277d6cf82 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json @@ -1,10 +1,14 @@ { "gem_name": "AtomViewportDisplayInfo", "display_name": "Atom Viewport Display Info", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json index 306c61e6d7..8eceb50932 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/gem.json +++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json @@ -1,10 +1,14 @@ { "gem_name": "CommonFeaturesAtom", "display_name": "Common Features Atom", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json index e2a81d0a5e..a7c3e96d2b 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json +++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json @@ -1,10 +1,14 @@ { "gem_name": "EMotionFX_Atom", "display_name": "EMotionFX Atom", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json index 6d6551b5fa..918414f053 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/gem.json +++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json @@ -1,10 +1,14 @@ { "gem_name": "ImguiAtom", "display_name": "Imgui Atom", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json index a867fe0f0f..f978d777cf 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json @@ -2,6 +2,9 @@ "gem_name": "DccScriptingInterface", "display_name": "Atom DccScriptingInterface (DCCsi)", "summary": "A python framework for working with various DCC tools and workflows.", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", "canonical_tags": [ "Gem" ], @@ -10,5 +13,6 @@ "Digital", "Content", "Creation" - ] + ], + "requirements": "" } diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json index 4f587a8806..72be2f9151 100644 --- a/Gems/AtomLyIntegration/gem.json +++ b/Gems/AtomLyIntegration/gem.json @@ -1,5 +1,12 @@ { "gem_name": "AtomLyIntegration", "display_name": "Atom O3DE Integration", - "summary": "Collection of module targets for integrating Atom with the O3DE engine" + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Atom O3DE Integration Gem provides components, libraries, and functionality to support and integrate Atom Renderer in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Core", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AtomTressFX/gem.json b/Gems/AtomTressFX/gem.json index 056ead5ec1..0099906dd1 100644 --- a/Gems/AtomTressFX/gem.json +++ b/Gems/AtomTressFX/gem.json @@ -1,13 +1,12 @@ { "gem_name": "AtomTressFX", - "GemFormatVersion": 3, - "Uuid": "d4a3e3d6b9b14e12982c774f35f48a7c", - "Name": "AtomTressFX", - "DisplayName": "AtomTressFX [PREVIEW]", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The AtomTressFX is a cutting edge hair technology based on TressFX 4.1 SDK from AMD. It was altered to integrate into Atom harnessing Atom's design and pipeline.", - "Tags": ["Hair", "TressFX"], - "IconPath": "preview.png", - "EditorModule": true + "display_name": "Atom TressFX", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Atom TressFX Gem provides realistic hair and fur simulation and rendering in Atom and Open 3D Engine with AMD TressFX.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Physics", "Animation"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AudioEngineWwise/gem.json b/Gems/AudioEngineWwise/gem.json index 5608641434..8c6b5767b0 100644 --- a/Gems/AudioEngineWwise/gem.json +++ b/Gems/AudioEngineWwise/gem.json @@ -1,28 +1,12 @@ { "gem_name": "AudioEngineWwise", - "GemFormatVersion": 4, - "Uuid": "67a80e2ac865406c990f2715feb55f7f", - "Name": "AudioEngineWwise", - "DisplayName": "Wwise Audio Integration", - "Version": "0.1.0", - "Summary": "Wwise engine integration and plugin to Audio Controls Editor.", - "Tags": ["Audio", "Sound", "Wwise"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "6f63f2b6d07f4b89b4b7c86ebee7feb8", - "VersionConstraints": [">=0.1.0"], - "_comment": "AudioSystem" - } - ] + "display_name": "Wwise Audio Engine", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Wwise Audio Engine Gem provides support for Audiokinetic Wave Works Interactive Sound Engine (Wwise).", + "canonical_tags": ["Gem"], + "user_tags": ["Audio", "Utiltity", "Tools"], + "icon_path": "preview.png", + "requirements": "Users will need to download WWise from the AudioKinetic web site: https://www.audiokinetic.com/download/" } diff --git a/Gems/AudioSystem/gem.json b/Gems/AudioSystem/gem.json index fc43c37419..a1dbe9406f 100644 --- a/Gems/AudioSystem/gem.json +++ b/Gems/AudioSystem/gem.json @@ -1,21 +1,12 @@ { "gem_name": "AudioSystem", - "GemFormatVersion": 4, - "Uuid": "6f63f2b6d07f4b89b4b7c86ebee7feb8", - "Name": "AudioSystem", - "DisplayName": "Audio System", - "Version": "0.1.0", - "Summary": "Contains CrySoundSystem, the Audio Translation Layer (ATL), and the Audio Controls Editor", - "Tags": ["Audio", "Sound"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ] + "display_name": "Audio System", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Audio System Gem provides the Audio Translation Layer (ATL) and Audio Controls Editor, which add support for audio in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Audio", "Utiltity", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/AutomatedLauncherTesting/gem.json b/Gems/AutomatedLauncherTesting/gem.json index 80abdc1cf0..c7ecd02739 100644 --- a/Gems/AutomatedLauncherTesting/gem.json +++ b/Gems/AutomatedLauncherTesting/gem.json @@ -1,16 +1,12 @@ { "gem_name": "AutomatedLauncherTesting", - "GemFormatVersion": 4, - "Uuid": "69504dac61f84a11bf895b8f05e4227f", - "Name": "AutomatedLauncherTesting", - "DisplayName": "Automated Launcher Testing", - "Version": "0.1.0", - "Summary": "This GEM is used to manage running of Automated Launcher Tests", - "Tags": ["Untagged"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Automated Launcher Testing", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Automated Launcher Testing Gem manages automated Open 3D Engine (O3DE) launcher tests.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Blast/gem.json b/Gems/Blast/gem.json index 0ba5aab8b1..a4eb9d6b31 100644 --- a/Gems/Blast/gem.json +++ b/Gems/Blast/gem.json @@ -1,37 +1,12 @@ { "gem_name": "Blast", - "GemFormatVersion": 4, - "Uuid": "414bd211c99d4f74aef3a266b9ca208c", - "Name": "Blast", - "DisplayName": "NVIDIA Blast [Experimental]", - "Version": "0.1.0", - "Summary": "Enables support for NVIDIA Blast objects in Lumberyard for high-fidelity destruction.", - "Tags": [ "Physics" ], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "4e08125824434932a0fe3717259caa47", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "PhysX" - } - ] + "display_name": "NVIDIA Blast", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The NVIDIA Blast Gem provides tools to author fractured mesh assets in Houdini, and functionality to create realistic destruction simulations in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Physics", "Simulation", "Animation"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Camera/gem.json b/Gems/Camera/gem.json index 2d7e7370f5..f59bb8cc0d 100644 --- a/Gems/Camera/gem.json +++ b/Gems/Camera/gem.json @@ -1,21 +1,12 @@ { "gem_name": "Camera", - "GemFormatVersion": 4, - "Uuid": "f910686b6725452fbfc4671f95f733c6", - "Name": "Camera", - "Version": "0.1.0", - "DisplayName": "Camera", - "Tags": ["Camera"], - "Summary": "The Camera Gem includes a basic camera component that defines a frustum for runtime rendering.", - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ] + "display_name": "Camera", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Camera Gem provides a basic camera component that defines a frustum for runtime rendering.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/CameraFramework/gem.json b/Gems/CameraFramework/gem.json index 6a05537acf..6a6cbaf1f0 100644 --- a/Gems/CameraFramework/gem.json +++ b/Gems/CameraFramework/gem.json @@ -1,21 +1,12 @@ { "gem_name": "CameraFramework", - "Dependencies": [ - { - "Uuid": "f910686b6725452fbfc4671f95f733c6", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "Camera" - } - ], - "GemFormatVersion": 3, - "Uuid": "54f2763fe191432fa681ce4a354eedf5", - "Name": "CameraFramework", - "Version": "0.1.0", - "LinkType": "Dynamic", - "DisplayName": "Camera Framework [PREVIEW]", - "Tags": ["Camera", "Framework"], - "Summary": "The Camera Framework Gem includes the camera rig component which drives an entity through camera behaviors. Behaviors are provided in the Starting Point Camera Gem.", - "IconPath": "preview.png" + "display_name": "Camera Framework", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Camera Framework Gem provides a base for implementing more complex camera systems.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Framework", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/CertificateManager/gem.json b/Gems/CertificateManager/gem.json index c77afa4211..38005a7cd1 100644 --- a/Gems/CertificateManager/gem.json +++ b/Gems/CertificateManager/gem.json @@ -1,12 +1,12 @@ { "gem_name": "CertificateManager", - "GemFormatVersion": 3, - "Uuid": "659CFFFF33B14A10835BAFC6EA623F98", - "Name": "CertificateManager", - "DisplayName": "Amazon Certificate Manager", - "Version": "0.0.1", - "LinkType": "Dynamic", - "Summary": "The Amazon Certificate Manager Gem provides access to authentication files for secure game connections from S3, files on disk, and other 3rd party sources", - "Tags": ["Amazon Certificate Manager","Security","Multiplayer","Networking"], - "IconPath": "preview.png" + "display_name": "Certificate Manager", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Certificate Manager Gem provides access to authentication files for secure game connections from Amazon S3, files on disk, and other 3rd party sources.", + "canonical_tags": ["Gem"], + "user_tags": ["Network", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/CrashReporting/gem.json b/Gems/CrashReporting/gem.json index 12297936ab..e1e06f0ac1 100644 --- a/Gems/CrashReporting/gem.json +++ b/Gems/CrashReporting/gem.json @@ -1,21 +1,12 @@ { "gem_name": "CrashReporting", - "GemFormatVersion": 4, - "Uuid": "089562a2cbbd41749b359f85fa04f1c9", - "Name": "CrashReporting", - "DisplayName": "CrashReporting", - "Version": "0.1.0", - "Summary": "Enable external crash reporting for a game project", - "Tags": ["Untagged"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "StaticLib", - "Name": "StaticLibrary" - }, - { - "Type": "Standalone", - "Name": "Uploader" - } - ] + "display_name": "Crash Reporting", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Crash Reporting Gem provides support for external crash reporting for Open 3D Engine projects.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/CustomAssetExample/gem.json b/Gems/CustomAssetExample/gem.json index 47de0bc966..62bdcb1ff6 100644 --- a/Gems/CustomAssetExample/gem.json +++ b/Gems/CustomAssetExample/gem.json @@ -1,19 +1,12 @@ { "gem_name": "CustomAssetExample", - "GemFormatVersion": 3, - "Uuid": "ad082dd50c6545849729e9afeaaeaa1d", - "Name": "CustomAssetExample", - "DisplayName": "CustomAssetExample", - "Version": "0.1.0", - "Summary": "Contians example code for creating a custom asset in Lumberyard's asset pipeline", - "Tags": ["Assets, Example"], - "LinkType": "Dynamic", - "IconPath": "preview.png", - "EditorModule": true, - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] + "display_name": "Custom Asset Example", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Custom Asset Example Gem provides example code for creating a custom asset for Open 3D Engine's asset pipeline.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/DebugDraw/gem.json b/Gems/DebugDraw/gem.json index 375483642e..0dd2e179f3 100644 --- a/Gems/DebugDraw/gem.json +++ b/Gems/DebugDraw/gem.json @@ -1,13 +1,12 @@ { "gem_name": "DebugDraw", - "GemFormatVersion": 3, - "Uuid": "66239f50bf754354b514c850c8b841fb", - "Name": "DebugDraw", - "DisplayName": "DebugDraw [PREVIEW]", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The DebugDraw Gem provides editor and game runtime debug visualization features.", - "Tags": ["Debugging"], - "IconPath": "preview.png", - "EditorModule": true + "display_name": "Debug Draw", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Debug Draw Gem provides Editor and runtime debug visualization features for Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Tools", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/DevTextures/gem.json b/Gems/DevTextures/gem.json index a379bb8ad7..7a27d7c776 100644 --- a/Gems/DevTextures/gem.json +++ b/Gems/DevTextures/gem.json @@ -1,12 +1,12 @@ { "gem_name": "DevTextures", - "GemFormatVersion": 3, - "Uuid": "2c227161447b4d77a5b07c093e214fe3", - "Name": "DevTextures", - "DisplayName": "DevTextures", - "Version": "0.1.0", - "LinkType": "NoCode", - "Summary": "Collection of general purpose textures useful for prototypes and preproduction. ", - "Tags": ["Asset"], - "IconPath": "preview.png" + "display_name": "Dev Textures", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The Dev Textures Gem provides a collection of general purpose texture assets useful for prototypes and preproduction.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Debug", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/EMotionFX/gem.json b/Gems/EMotionFX/gem.json index f116a6a2c0..74a060ed52 100644 --- a/Gems/EMotionFX/gem.json +++ b/Gems/EMotionFX/gem.json @@ -1,23 +1,12 @@ { "gem_name": "EMotionFX", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ], - "GemFormatVersion": 3, - "Uuid": "044a63ea67d04479aa5daf62ded9d9ca", - "Name": "EMotionFX", - "DisplayName": "EMotion FX Animation", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "EMotion FX is a character animation system used to set up animated controllable characters inside your project.\n", - "Tags": ["Animation"], - "IconPath": "EMotionFX.png", - "EditorModule" : true, - "DisableGemAutoUselib": true + "display_name": "EMotion FX Animation", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The EMotion FX Animation Gem provides Open 3D Engine's animation system for rigged actors and includes Animation Editor, a tool for creating animated behaviors, simulated objects, and colliders for rigged actors.", + "canonical_tags": ["Gem"], + "user_tags": ["Animation", "Tools", "Simulation"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/EditorPythonBindings/gem.json b/Gems/EditorPythonBindings/gem.json index 41d65cea43..a8ae59b22e 100644 --- a/Gems/EditorPythonBindings/gem.json +++ b/Gems/EditorPythonBindings/gem.json @@ -1,17 +1,12 @@ { - "gem_name": "EditorPythonBindings", - "GemFormatVersion": 4, - "Uuid": "b658359393884c4381c2fe2952b1472a", - "Name": "EditorPythonBindings", - "DisplayName": "EditorPythonBindings", - "Version": "0.1.0", - "Summary": "A gem to bind Editor commands via Python scripts.", - "Tags": ["Editor", "Assets", "Asset Pipeline", "Python"], - "IconPath": "preview.png", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] + "gem_name": "EditorPythonBindings", + "display_name": "Editor Python Bindings", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Editor Python Bindings Gem provides Python commands for Open 3D Engine Editor functions.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/ExpressionEvaluation/gem.json b/Gems/ExpressionEvaluation/gem.json index f85311a68c..9302af152a 100644 --- a/Gems/ExpressionEvaluation/gem.json +++ b/Gems/ExpressionEvaluation/gem.json @@ -1,16 +1,12 @@ { "gem_name": "ExpressionEvaluation", - "GemFormatVersion": 4, - "Uuid": "4c6f9df57ca2468f93c8d860ee6a1167", - "Name": "ExpressionEvaluation", - "DisplayName": "Expression Evaluation", - "Version": "0.1.0", - "Summary": "Provides a method for parsing and executing various string expressions(e.g. 1+1 or 2>3).", - "Tags": ["Untagged"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Expression Evaluation", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Expression Evaluation Gem provides a method for parsing and executing string expressions in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Utiltity"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/FastNoise/gem.json b/Gems/FastNoise/gem.json index 4d4da11ee1..f49db2aa02 100644 --- a/Gems/FastNoise/gem.json +++ b/Gems/FastNoise/gem.json @@ -1,37 +1,12 @@ { "gem_name": "FastNoise", - "GemFormatVersion": 4, - "Uuid": "c5f23032407f49ca8d8de1733423565c", - "Name": "FastNoise", - "DisplayName": "Fast Noise Gradient [PREVIEW]", - "Version": "0.1.0", - "Summary": "A Lumberyard Gem that provides a Gradient Signal component for FastNoise. FastNoise is a realtime noise generation library with a large collection of different noise algorithms.", - "Tags": ["Gradient"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "8825563d9d964ec3be3bab681f3bd9f2", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "GradientSignal" - }, - { - "Uuid": "5de82d29d6094bfe97c1a4d35fcd5fbe", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "SurfaceData" - } - ] + "display_name": "Fast Noise", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The FastNoise Gradient Gem uses the third-party, open source FastNoise library to provide a variety of high-performance noise generation algorithms.", + "canonical_tags": ["Gem"], + "user_tags": ["Utility", "Tools", "Design"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/GameState/gem.json b/Gems/GameState/gem.json index e9b79f64ae..fe9569eb75 100644 --- a/Gems/GameState/gem.json +++ b/Gems/GameState/gem.json @@ -1,16 +1,12 @@ { "gem_name": "GameState", - "GemFormatVersion": 4, - "Uuid": "1a557ac19dc34f5697fe03f30be5b6e4", - "Name": "GameState", - "DisplayName": "GameState", - "Version": "0.1.0", - "Summary": "Provides a generic framework for managing game states and the transitions between them. Some sample game states are provided in the GameStateSamples Gem.", - "Tags": ["Game State"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Game State", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Game State Gem provides a generic framework to determine and manage game states and game state transitions in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Framework", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/GameStateSamples/gem.json b/Gems/GameStateSamples/gem.json index 992ca59237..ce0fcbd868 100644 --- a/Gems/GameStateSamples/gem.json +++ b/Gems/GameStateSamples/gem.json @@ -1,49 +1,12 @@ { "gem_name": "GameStateSamples", - "Dependencies": - [ - { - "Uuid" : "1a557ac19dc34f5697fe03f30be5b6e4", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "GameState" - }, - { - "Uuid" : "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "LmbrCentral" - }, - { - "Uuid" : "93ccb44a96b142f7942a3fb6b9ca36e1", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "LocalUser" - }, - { - "Uuid" : "c7935ecf5e8047fe8ca947b34b11cadb", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "LyShineExamples" - }, - { - "Uuid" : "89225422672547deaca9e7a22b883973", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "MessagePopup" - }, - { - "Uuid" : "d96ab03f53d14c9e83f9b4528c8576d7", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "SaveData" - } - ], - "GemFormatVersion": 4, - "Uuid": "76db0b1bcff84224a92cbceb373f4a85", - "Name": "GameStateSamples", - "DisplayName": "GameStateSamples", - "Version": "0.1.0", - "Summary": "Provides a set of sample game states (built on top of the generic GameState Gem), including primary user selection, main menu, level loading, level running, and level paused.", - "Tags": ["Game State", "Main Menu", "Level Loading", "Pause Menu", "Primary User", "Local Multiplayer", "Local Co-op", "Split Screen"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Game State Samples", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Game State Samples Gem provides a set of sample game states (built on top of the Game State Gem), including primary user selection, main menu, level loading, level running, and level paused.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Samples", "Assets"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Gestures/gem.json b/Gems/Gestures/gem.json index efd3fa65b2..4c2f5fe67a 100644 --- a/Gems/Gestures/gem.json +++ b/Gems/Gestures/gem.json @@ -1,11 +1,12 @@ { "gem_name": "Gestures", - "GemFormatVersion": 3, - "Uuid": "6056556b6088413984309c4a413593ad", - "Name": "Gestures", - "Version": "1.0.0", - "LinkType": "Dynamic", - "Summary": "Gesture-based input, including click/tap, drag, hold, pinch, rotate, and swipe.", - "IconPath": "preview.png", - "Tags": ["Input", "Gestures"] + "display_name": "Gestures", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Gestures Gem provides detection for common gesture-based input actions on iOS and Android devices.", + "canonical_tags": ["Gem"], + "user_tags": ["Input", "Gameplay", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/GradientSignal/gem.json b/Gems/GradientSignal/gem.json index 4186bbe71e..cae1a272b1 100644 --- a/Gems/GradientSignal/gem.json +++ b/Gems/GradientSignal/gem.json @@ -1,37 +1,12 @@ { "gem_name": "GradientSignal", - "GemFormatVersion": 4, - "Uuid": "8825563d9d964ec3be3bab681f3bd9f2", - "Name": "GradientSignal", - "DisplayName": "Gradient Signal [PREVIEW]", - "Version": "0.1.0", - "Summary": "A Lumberyard Gem that provides a number of components for generating (ex: Random, Perlin), modifying (ex: Levels, Threshold), and mixing gradient signals.", - "Tags": ["Gradient", "Surface"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "5de82d29d6094bfe97c1a4d35fcd5fbe", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "SurfaceData" - } - ] + "display_name": "Gradient Signal", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Gradient Signal Gem provides a number of components for generating, modifying, and mixing gradient signals.", + "canonical_tags": ["Gem"], + "user_tags": ["Utility", "Tools", "Design"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/GraphCanvas/gem.json b/Gems/GraphCanvas/gem.json index 32c828ea16..6884f6b9cb 100644 --- a/Gems/GraphCanvas/gem.json +++ b/Gems/GraphCanvas/gem.json @@ -1,13 +1,12 @@ { "gem_name": "GraphCanvas", - "GemFormatVersion": 3, - "Uuid": "875b6fcbdeea44deaae7984ad9bb6cdc", - "Name": "GraphCanvas", - "DisplayName": "GraphCanvas", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The Graph Canvas Gem includes a C++ framework for creating custom graphical node based editors.", - "Tags": ["GraphCanvas"], - "IconPath": "preview.png", - "EditorModule" : true + "display_name": "Graph Canvas", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Graph Canvas Gem provides a C++ framework for creating custom graphical node based editors for Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Framework", "Tools", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/GraphModel/gem.json b/Gems/GraphModel/gem.json index 939b6719d3..52c914357d 100644 --- a/Gems/GraphModel/gem.json +++ b/Gems/GraphModel/gem.json @@ -1,26 +1,12 @@ { "gem_name": "GraphModel", - "GemFormatVersion": 4, - "Uuid": "0844f64a3acf4f5abf3a535dc9b63bc9", - "Name": "GraphModel", - "DisplayName": "GraphModel", - "Version": "0.1.0", - "Summary": "A generic node graph data model framework.", - "Tags": ["GraphModel", "Scripting", "Vegetation"], - "IconPath": "graphModelIcon.svg", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ], - "Dependencies": [ - { - "Uuid": "875b6fcbdeea44deaae7984ad9bb6cdc", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "GraphCanvas" - } - ] + "display_name": "Graph Model", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Graph Model Gem provides a generic node graph data model framework for Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Framework", "Tools", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/HttpRequestor/gem.json b/Gems/HttpRequestor/gem.json index 989a55d637..8beb77d839 100644 --- a/Gems/HttpRequestor/gem.json +++ b/Gems/HttpRequestor/gem.json @@ -1,12 +1,12 @@ { "gem_name": "HttpRequestor", - "GemFormatVersion": 3, - "Uuid": "28479e255bde466e91fc34eec808d9c7", - "Name": "HttpRequestor", - "DisplayName": "HttpRequestor", - "Version": "1.0.0", - "LinkType": "Dynamic", - "Summary": "A Gem to handle HTTP/HTTPs requests.", - "Tags": ["http", "https", "rest"], - "IconPath": "preview.png" + "display_name": "HTTP Requestor", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The HTTP Requestor Gem provides functionality to make asynchronous HTTP/HTTPS requests and return data through a user-provided call back function.", + "canonical_tags": ["Gem"], + "user_tags": ["Network", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/ImGui/gem.json b/Gems/ImGui/gem.json index ed31217323..327e417bcf 100644 --- a/Gems/ImGui/gem.json +++ b/Gems/ImGui/gem.json @@ -1,30 +1,12 @@ { "gem_name": "ImGui", - "GemFormatVersion": 4, - "Uuid": "bab8807a1bc646b3909f3cc200ffeedf", - "Name": "ImGui", - "DisplayName": "ImGui", - "Version": "0.1.0", - "Summary": "A GEM that houses 3rdParty lib IMGUI. Great for quick programmer art GUI fit for debug type menus.", - "Tags": ["Debug"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ] + "display_name": "Immediate Mode GUI (IMGUI)", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Immediate Mode GUI Gem provides the 3rdParty library IMGUI which can be used to create run time immediate mode overlays for debugging and profiling information in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Rendering", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/InAppPurchases/gem.json b/Gems/InAppPurchases/gem.json index 27f22b0ba4..96d0e7fa0a 100644 --- a/Gems/InAppPurchases/gem.json +++ b/Gems/InAppPurchases/gem.json @@ -1,12 +1,12 @@ { "gem_name": "InAppPurchases", - "GemFormatVersion": 3, - "Uuid": "92fe57eae7d3402a90761973678c079a", - "Name": "InAppPurchases", - "DisplayName": "In-App Purchases", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Provides the in-app purchasing API for iOS and Android", - "Tags": ["InAppPurchases", "iOS", "Android"], - "IconPath": "preview.png" + "display_name": "In-App Purchases", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The In-App Purchases Gem provides functionality for in app purchases for iOS and Android.", + "canonical_tags": ["Gem"], + "user_tags": ["SDK", "Network"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/LandscapeCanvas/gem.json b/Gems/LandscapeCanvas/gem.json index 3c1f74b689..338845ebb1 100644 --- a/Gems/LandscapeCanvas/gem.json +++ b/Gems/LandscapeCanvas/gem.json @@ -1,61 +1,12 @@ { "gem_name": "LandscapeCanvas", - "GemFormatVersion": 4, - "Uuid": "19c2b2d5018940108baf252934b8e6bf", - "Name": "LandscapeCanvas", - "DisplayName": "LandscapeCanvas", - "Version": "0.1.0", - "Summary": "A node-based Editor for authoring Dynamic Vegetation.", - "Tags": ["Vegetation"], - "IconPath": "landscapeCanvasIcon.svg", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "f394e7cf54424bba89615381bba9511b", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "Vegetation" - }, - { - "Uuid": "875b6fcbdeea44deaae7984ad9bb6cdc", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "GraphCanvas" - }, - { - "Uuid" : "0844f64a3acf4f5abf3a535dc9b63bc9", - "VersionConstraints": [ - "~>0.1" - ], - "_comment" : "GraphModel" - }, - { - "Uuid": "8825563d9d964ec3be3bab681f3bd9f2", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "GradientSignal" - }, - { - "Uuid": "5de82d29d6094bfe97c1a4d35fcd5fbe", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "SurfaceData" - } - ] + "display_name": "Landscape Canvas", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Landscape Canvas Gem provides the Landscape Canvas editor, a node-based graph tool for authoring workflows to populate landscape with dynamic vegetation.", + "canonical_tags": ["Gem"], + "user_tags": ["Environment", "Design", "Tools"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/LmbrCentral/gem.json b/Gems/LmbrCentral/gem.json index da88c9129a..6f0530c35d 100644 --- a/Gems/LmbrCentral/gem.json +++ b/Gems/LmbrCentral/gem.json @@ -1,14 +1,13 @@ { "gem_name": "LmbrCentral", - "GemFormatVersion": 3, - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "Name": "LmbrCentral", - "DisplayName": "LmbrCentral", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Required LmbrCentral Engine Gem.", - "Tags": ["Required"], - "IconPath": "preview.png", - "EditorModule": true, - "IsRequired": true + "display_name": "O3DE Core (LmbrCentral)", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The O3DE Core (LmbrCentral) Gem provides required code and assets for running Open 3D Engine Editor.", + "canonical_tags": ["Gem"], + "user_tags": ["Core", "Framework", "Assets"], + "icon_path": "preview.png", + "requirements": "" } + diff --git a/Gems/LocalUser/gem.json b/Gems/LocalUser/gem.json index fdda8e3959..47c1601240 100644 --- a/Gems/LocalUser/gem.json +++ b/Gems/LocalUser/gem.json @@ -1,16 +1,12 @@ { "gem_name": "LocalUser", - "GemFormatVersion": 4, - "Uuid": "93ccb44a96b142f7942a3fb6b9ca36e1", - "Name": "LocalUser", - "DisplayName": "LocalUser", - "Version": "0.1.0", - "Summary": "Provides functionality for mapping local user ids to local player slots and managing local user profiles.", - "Tags": ["User", "Local User", "Local User Profile", "Primary User", "Local Multiplayer", "Local Co-op", "Split Screen"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Local User", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Local User Gem provides functionality for mapping local user ids to local player slots and managing local user profiles.", + "canonical_tags": ["Gem"], + "user_tags": ["Input", "Gameplay", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/LyShine/gem.json b/Gems/LyShine/gem.json index bcdd7f2eb3..c61ca0cce5 100644 --- a/Gems/LyShine/gem.json +++ b/Gems/LyShine/gem.json @@ -1,39 +1,12 @@ { "gem_name": "LyShine", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "5a149b6b3c964064bd4970f0e92f72e2", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "Texture Atlas" - } - ], - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "GemFormatVersion": 4, - "Uuid": "0fefab3f13364722b2eab3b96ce2bf20", - "Name": "LyShine", - "DisplayName": "LyShine", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "LyShine is the in-game UI system for Lumberyard", - "Tags": ["UI","Required"], - "IconPath": "preview.png", - "IsRequired": true + "display_name": "LyShine", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The LyShine Gem provides the runtime UI system and creation tools for Open 3D Engine projects.", + "canonical_tags": ["Gem"], + "user_tags": ["UI", "Tools", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/LyShineExamples/gem.json b/Gems/LyShineExamples/gem.json index 7868148044..e8c7110466 100644 --- a/Gems/LyShineExamples/gem.json +++ b/Gems/LyShineExamples/gem.json @@ -1,26 +1,12 @@ { "gem_name": "LyShineExamples", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "6bb61c9e547043f0afc5019d6d460b78", - "VersionConstraints": [ "~>0.1.0" ], - "_comment": "UiBasics" - } - ], - "GemFormatVersion": 3, - "Uuid": "c7935ecf5e8047fe8ca947b34b11cadb", - "Name": "LyShineExamples", - "DisplayName": "LyShineExamples", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Provides example code for using LyShine.", - "Tags": ["UI", "LyShine", "Example"], - "IconPath": "preview.png" + "display_name": "LyShine Examples", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The LyShine Examples Gem provides example code and assets for LyShine, the runtime UI system and editor for Open 3D Engine projects.", + "canonical_tags": ["Gem"], + "user_tags": ["UI", "Sample", "Assets"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Maestro/gem.json b/Gems/Maestro/gem.json index fc9cf2e02a..4f638b63f1 100644 --- a/Gems/Maestro/gem.json +++ b/Gems/Maestro/gem.json @@ -1,14 +1,13 @@ { "gem_name": "Maestro", - "GemFormatVersion": 3, - "Uuid": "3b9a978ed6f742a1acb99f74379a342c", - "Name": "Maestro", - "DisplayName": "Maestro", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Lumberyard Cinematics Module", - "Tags": ["Cinematics","Required"], - "IconPath": "preview.png", - "EditorModule": true, - "IsRequired": true + "display_name": "Maestro Cinematics", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Maestro Cinematics Gem provides Track View, Open 3D Engine's animated sequence and cinematics editor.", + "canonical_tags": ["Gem"], + "user_tags": ["Animation", "Tools", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } + diff --git a/Gems/MessagePopup/gem.json b/Gems/MessagePopup/gem.json index 137ee811f1..c75d28f50d 100644 --- a/Gems/MessagePopup/gem.json +++ b/Gems/MessagePopup/gem.json @@ -1,25 +1,12 @@ { "gem_name": "MessagePopup", - "GemFormatVersion": 4, - "Uuid": "89225422672547deaca9e7a22b883973", - "Name": "MessagePopup", - "DisplayName": "MessagePopup", - "Version": "0.1.0", - "Summary": "Show a message popup ", - "Tags": ["Untagged"], - "IconPath": "preview.png", - "Dependencies": [ - { - "Uuid": "6bb61c9e547043f0afc5019d6d460b78", - "VersionConstraints": [ - "~>0.1.0" - ], - "_comment": "UiBasics" - } - ], - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Message Popup", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Message Popup Gem provides an example implementation of popup messages using LyShine in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Sample"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Metastream/gem.json b/Gems/Metastream/gem.json index 16a4a090bb..911c6be665 100644 --- a/Gems/Metastream/gem.json +++ b/Gems/Metastream/gem.json @@ -1,12 +1,12 @@ { "gem_name": "Metastream", - "GemFormatVersion": 3, - "Uuid": "c02d7efe05134983b5699d9ee7594c3a", - "Name": "Metastream", - "DisplayName": "Metastream", - "Version": "1.0.0", - "LinkType": "Dynamic", - "Summary": "When the Metastream Gem is installed, it will set up a project to run an HTTP server that can service requests for the purpose of allowing broadcasters to customize game streams with overlays of statistics and event data from a game session creating a more engaging experience for the viewer.", - "Tags": ["Twitch", "Metastream", "Streaming", "Broadcasting", "Overlay"], - "IconPath": "preview.png" + "display_name": "Metastream", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Metastream Gem provides functionality for an HTTP server that allows broadcasters to customize game streams with overlays of statistics and event data from a game session.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Network", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Microphone/gem.json b/Gems/Microphone/gem.json index f90d8c1a18..31b3d46963 100644 --- a/Gems/Microphone/gem.json +++ b/Gems/Microphone/gem.json @@ -1,19 +1,12 @@ { "gem_name": "Microphone", - "GemFormatVersion": 3, - "Uuid": "e70dd59f02f14ea49e6b38434e86ebf1", - "Name": "Microphone", - "DisplayName": "Microphone", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Provides access to connected Microphone Devices and ability to read their input.", - "Tags": ["Audio", "Microphone"], - "IconPath": "preview.png", - "Dependencies": [ - { - "Uuid": "6f63f2b6d07f4b89b4b7c86ebee7feb8", - "VersionConstraints": [">=0.1.0"], - "_comment": "AudioSystem" - } - ] + "display_name": "Microphone", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Microphone Gem provides support for audio input through microphones.", + "canonical_tags": ["Gem"], + "user_tags": ["Audio", "Input"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Multiplayer/gem.json b/Gems/Multiplayer/gem.json index a21ac5d7d3..8abbddea5f 100644 --- a/Gems/Multiplayer/gem.json +++ b/Gems/Multiplayer/gem.json @@ -1,11 +1,12 @@ { "gem_name": "Multiplayer", - "GemFormatVersion": 3, - "Uuid": "9524EBD3E64D4D13A9764A18DB9A564F", - "Name": "Multiplayer", - "Version": "1.0.0", - "LinkType": "Dynamic", - "Tags": ["Multiplayer","Networking"], - "Summary": "The Multiplayer Gem provides high level advanced multiplayer gameplay functionality such as entity replication, local prediction, and server side backward reconciliation", - "IconPath": "preview.png" + "display_name": "Multiplayer", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Multiplayer Gem provides a public API for multiplayer functionality such as connecting and hosting.", + "canonical_tags": ["Gem"], + "user_tags": ["Multiplayer", "Network", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/MultiplayerCompression/gem.json b/Gems/MultiplayerCompression/gem.json index 77a86b04a2..aeea2282cc 100644 --- a/Gems/MultiplayerCompression/gem.json +++ b/Gems/MultiplayerCompression/gem.json @@ -1,10 +1,12 @@ { "gem_name": "MultiplayerCompression", "display_name": "Multiplayer Compression", - "summary": "The Multiplayer Compression gem provides an open source Compressor for use with AzNetworking's transport layer.", - "canonical_tags": ["Multiplayer", "Networking", "Utility"], - "user_tags": ["MultiplayerCompression"], - "icon_path": "preview.png", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", "type": "Code", - "provider": "Open 3D Foundation" + "summary": "The Multiplayer Compression Gem provides an open source Compressor for use with AzNetworking's transport layer.", + "canonical_tags": ["Gem"], + "user_tags": ["Multiplayer", "Network", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/NvCloth/gem.json b/Gems/NvCloth/gem.json index f71d71e592..95ea8168d6 100644 --- a/Gems/NvCloth/gem.json +++ b/Gems/NvCloth/gem.json @@ -1,8 +1,12 @@ { "gem_name": "NvCloth", - "display_name": "NVIDIA Cloth [PREVIEW]", - "summary": "Provides the functionality needed to add cloth simulation.", + "display_name": "NVIDIA Cloth (NvCloth)", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The NVIDIA Cloth Gem provides functionality to create fast, realistic cloth simulation with the NVIDIA Cloth library.", "canonical_tags": ["Gem"], - "user_tags": ["Physics"], - "icon_path": "preview.png" + "user_tags": ["Physics", "Simulation", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PBSreferenceMaterials/gem.json b/Gems/PBSreferenceMaterials/gem.json index 65fe12d5f8..b015d89888 100644 --- a/Gems/PBSreferenceMaterials/gem.json +++ b/Gems/PBSreferenceMaterials/gem.json @@ -1,12 +1,12 @@ { "gem_name": "PBSreferenceMaterials", - "GemFormatVersion": 3, - "Uuid": "07375b61b1a2424bb03088bbdf28b2c8", - "Name": "PBSreferenceMaterials", - "DisplayName": "PBSreferenceMaterials", - "Version": "0.1.0", - "LinkType": "NoCode", - "Summary": "A set of Physically Based Shading reference materials and texture assets", - "Tags": ["Asset"], - "IconPath": "preview.png" + "display_name": "PBS Reference Materials", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The PBS Reference Materials Gem provides physically based reference materials for Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Sample", "Assets"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PhysX/gem.json b/Gems/PhysX/gem.json index 126a4a218a..0b6b635c71 100644 --- a/Gems/PhysX/gem.json +++ b/Gems/PhysX/gem.json @@ -1,22 +1,12 @@ { "gem_name": "PhysX", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ], - "GemFormatVersion": 3, - "Uuid": "4e08125824434932a0fe3717259caa47", - "Name": "PhysX", - "DisplayName": "PhysX", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The PhysX Gem enables the NVIDIA PhysX SDK to provide physics simulation for Lumberyard. The PhysX system is not compatible with the legacy physics system. You cannot use components interchangeably between each system.", - "Tags": ["Physics"], - "IconPath": "preview.png", - "EditorModule": true + "display_name": "PhysX", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The PhysX Gem provides physics simulation with NVIDIA PhysX including static and dynamic rigid body simulation, force regions, ragdolls, and dynamic PhysX joints.", + "canonical_tags": ["Gem"], + "user_tags": ["Physics", "Simulation", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PhysXDebug/gem.json b/Gems/PhysXDebug/gem.json index 32e7dfead3..7dbfc1a096 100644 --- a/Gems/PhysXDebug/gem.json +++ b/Gems/PhysXDebug/gem.json @@ -1,29 +1,12 @@ { "gem_name": "PhysXDebug", - "Dependencies": [ - { - "Uuid": "4e08125824434932a0fe3717259caa47", - "VersionConstraints": [ - ">=0.1" - ], - "_comment": "PhysX Gem" - }, - { - "Uuid": "bab8807a1bc646b3909f3cc200ffeedf", - "VersionConstraints": [ - ">=0.1.0" - ], - "_comment": "ImGui Gem" - } - ], - "GemFormatVersion": 3, - "Uuid": "516145e2d9904b13813f1b54605e26a6", - "Name": "PhysXDebug", - "DisplayName": "PhysX Debug [PREVIEW]", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Debug features for the PhysX gem.", - "Tags": ["Physics", "Debug"], - "IconPath": "preview.png", - "EditorModule": true + "display_name": "PhysX Debug", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The PhysX Debug Gem provides debugging functionality and visualizations for NVIDIA PhysX in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Physics", "Simulation", "Debug"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PhysXSamples/gem.json b/Gems/PhysXSamples/gem.json index 1c917f1f50..b5239344f6 100644 --- a/Gems/PhysXSamples/gem.json +++ b/Gems/PhysXSamples/gem.json @@ -1,42 +1,12 @@ { "gem_name": "PhysXSamples", - "Dependencies": [ - { - "Uuid": "ed07631f95fb4be1bd10cd37298ec697", - "VersionConstraints": [ - ">=0.1" - ], - "_comment": "Uses mesh assets from primatives gem" - }, - { - "Uuid": "2c227161447b4d77a5b07c093e214fe3", - "VersionConstraints": [ - ">=0.1" - ], - "_comment": "Uses textures from DevTextures gem" - }, - { - "Uuid": "4e08125824434932a0fe3717259caa47", - "VersionConstraints": [ - ">=0.1" - ], - "_comment": "Requires PhysX" - }, - { - "Uuid": "66239f50bf754354b514c850c8b841fb", - "VersionConstraints": [ - ">=0.1" - ], - "_comment": "Uses debug draw Script Canvas nodes" - } - ], - "GemFormatVersion": 3, - "Uuid": "c4a4aadba44241ae9f0141e145def7f7", - "Name": "PhysXSamples", - "DisplayName": "PhysXSamples", - "Version": "0.1.0", - "LinkType": "NoCode", - "Summary": "Collection of samples that demostrate PhysX features.", - "Tags": ["Asset"], - "IconPath": "preview.png" + "display_name": "PhysX Samples", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The PhysX Samples Gem provides sample assets and scripts that demonstrate PhysX Gem features in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Physics", "Simulation", "Sample"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Prefab/PrefabBuilder/gem.json b/Gems/Prefab/PrefabBuilder/gem.json index 595c0c7d7f..1a815738ca 100644 --- a/Gems/Prefab/PrefabBuilder/gem.json +++ b/Gems/Prefab/PrefabBuilder/gem.json @@ -1,17 +1,12 @@ { "gem_name": "PrefabBuilder", - "GemFormatVersion": 4, - "Uuid": "88500802311C4793B03484BE2091B607", - "Name": "PrefabBuilder", - "DisplayName": "PrefabBuilder", - "Version": "0.1.0", - "Summary": "Asset Processor builder module for Prefabs", - "Tags": ["Prefabs"], - "IconPath": "preview.png", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] + "display_name": "Prefab Builder", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Prefab Builder Gem provides an Asset Processor module for prefabs, which are complex assets built by combining smaller entities.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Utility", "Core"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Presence/gem.json b/Gems/Presence/gem.json index ecf9a2663c..5df5fbdd6a 100644 --- a/Gems/Presence/gem.json +++ b/Gems/Presence/gem.json @@ -1,16 +1,12 @@ { "gem_name": "Presence", - "GemFormatVersion": 4, - "Uuid": "903ce283760647049efaef70d9368eeb", - "Name": "Presence", - "DisplayName": "Presence", - "Version": "0.1.0", - "Summary": "Platform agnostic interface for Presence services", - "Tags": [ "Presence", "Rich Presence" ], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Presence", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Presence Gem provides a target platform agnostic interface for Presence services.", + "canonical_tags": ["Gem"], + "user_tags": ["Network", "Gameplay", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PrimitiveAssets/gem.json b/Gems/PrimitiveAssets/gem.json index de7698c664..1c1fd54c16 100644 --- a/Gems/PrimitiveAssets/gem.json +++ b/Gems/PrimitiveAssets/gem.json @@ -1,12 +1,12 @@ { "gem_name": "PrimitiveAssets", - "GemFormatVersion": 3, - "Uuid": "ed07631f95fb4be1bd10cd37298ec697", - "Name": "PrimitiveAssets", - "DisplayName": "Primitive Assets", - "Version": "1.0.0", - "LinkType": "NoCode", - "Summary": "Provides simple primitive shape assets useful for quickly building a basic scene.", - "Tags": ["Getting Started", "Asset"], - "IconPath": "preview.png" + "display_name": "Primitive Assets", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The Primitive Assets Gem provides primitive shape mesh assets with physics enabled.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Sample", "Debug"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/PythonAssetBuilder/gem.json b/Gems/PythonAssetBuilder/gem.json index 39eccc4d2f..dcf3b59e23 100644 --- a/Gems/PythonAssetBuilder/gem.json +++ b/Gems/PythonAssetBuilder/gem.json @@ -1,17 +1,12 @@ { - "gem_name": "PythonAssetBuilder", - "GemFormatVersion": 4, - "Uuid": "0a5fda05323649009444bb7c3ee2b9c4", - "Name": "PythonAssetBuilder", - "DisplayName": "PythonAssetBuilder", - "Version": "0.1.0", - "Summary": "Runs asset builders written in Python scripts.", - "Tags": ["asset"], - "IconPath": "preview.png", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] + "gem_name": "PythonAssetBuilder", + "display_name": "Python Asset Builder", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Python Asset Builder Gem provides functionality to implement custom asset builders in Python for Asset Processor.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Assets", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/QtForPython/gem.json b/Gems/QtForPython/gem.json index 0c13e1d98d..dea5fc2e16 100644 --- a/Gems/QtForPython/gem.json +++ b/Gems/QtForPython/gem.json @@ -1,26 +1,12 @@ { "gem_name": "QtForPython", - "GemFormatVersion": 4, - "Uuid": "cd50c7a1e31f4c9495dcffdacc3bde92", - "Name": "QtForPython", - "DisplayName": "QtForPython", - "Version": "0.1.0", - "Summary": "Adds the ability to use the PySide2 Python libraries to manage Qt widgets.", - "Tags": ["Editor"], - "IconPath": "preview.png", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ], - "Dependencies": [ - { - "Uuid": "b658359393884c4381c2fe2952b1472a", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "EditorPythonBindings" - } - ] -} + "display_name": "Qt for Python", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Qt for Python Gem provides the PySide2 Python libraries to manage Qt widgets.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "UI", "Framework"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/RADTelemetry/gem.json b/Gems/RADTelemetry/gem.json index 511f4d7e5a..43515976da 100644 --- a/Gems/RADTelemetry/gem.json +++ b/Gems/RADTelemetry/gem.json @@ -1,12 +1,12 @@ { "gem_name": "RADTelemetry", - "GemFormatVersion": 3, - "Uuid": "bdaf32823406492686e35200afc555b3", - "Name": "RADTelemetry", - "DisplayName": "RAD Telemetry", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The RAD Telemetry Gem allows licensors of RAD Telemetry 3 to quickly integrate RAD Telemetry 3 with Lumberyard. For instructions on enabling RAD Telemetry Gem, visit https://docs.aws.amazon.com/lumberyard/latest/userguide/gems-system-gem-rad-telemetry.html", - "Tags": ["Profile", "Profiler", "Profiling"], - "IconPath": "preview.png" + "display_name": "RAD Telemetry", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The RAD Telemetry Gem provides support for RAD Telemetry, a performance profiling and visualization middleware, in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "SDK"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/SaveData/gem.json b/Gems/SaveData/gem.json index bb8e122a18..57de27624f 100644 --- a/Gems/SaveData/gem.json +++ b/Gems/SaveData/gem.json @@ -1,16 +1,12 @@ { "gem_name": "SaveData", - "GemFormatVersion": 4, - "Uuid": "d96ab03f53d14c9e83f9b4528c8576d7", - "Name": "SaveData", - "DisplayName": "SaveData", - "Version": "0.1.0", - "Summary": "Provides a simple, platform agnostic API for saving and loading persistent user data.", - "Tags": ["Save", "Load", "Save Data", "Save Game", "Persistent Data"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] -} + "display_name": "Save Data", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Save Data Gem provides a platform independent API to save and load persistent user data in Open 3D Engine projects.", + "canonical_tags": ["Gem"], + "user_tags": ["Utility", "Gameplay"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/SceneLoggingExample/gem.json b/Gems/SceneLoggingExample/gem.json index 822acde858..faa2860d13 100644 --- a/Gems/SceneLoggingExample/gem.json +++ b/Gems/SceneLoggingExample/gem.json @@ -1,12 +1,12 @@ { "gem_name": "SceneLoggingExample", - "GemFormatVersion": 3, - "Uuid": "35d8f6e49ae04c9382c61a42d4355c2f", - "Name": "SceneLoggingExample", - "DisplayName": "Scene Logging Example", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "This example Gem demonstrates the basics of extending the SceneAPI by adding additional logging to the pipeline. Please read ReadMe.txt for further details.", - "Tags": ["Scene", "FBX"], - "IconPath": "preview.png" -} + "display_name": "Scene Logging Example", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The Scene Logging Example Gem demonstrates the basics of extending the Open 3D Engine Scene API by adding additional logging to the pipeline.", + "canonical_tags": ["Gem"], + "user_tags": ["Debug", "Sample"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/SceneProcessing/gem.json b/Gems/SceneProcessing/gem.json index 0729ffa6ea..d9814f6a7d 100644 --- a/Gems/SceneProcessing/gem.json +++ b/Gems/SceneProcessing/gem.json @@ -1,20 +1,12 @@ { "gem_name": "SceneProcessing", - "GemFormatVersion": 3, - "Uuid": "7c2578f634df4345aca98d671e39b8ab", - "Name": "SceneProcessing", - "DisplayName": "Scene Processing (PREVIEW)", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Use this gem to fine tune the defaults for processing of scene files like Fbx.", - "Tags": ["Scene", "FBX", "Assets"], - "IconPath": "preview.png", - "EditorModule": true, - "IsRequired": false, - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] -} + "display_name": "Scene Processing", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Scene Processing Gem provides Scene Settings, a tool you can use to specify the default settings for processing asset files for actors, meshes, motions, and PhysX.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Tools", "Core"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/ScriptCanvas/gem.json b/Gems/ScriptCanvas/gem.json index df3be75ab9..680ce6ef1f 100644 --- a/Gems/ScriptCanvas/gem.json +++ b/Gems/ScriptCanvas/gem.json @@ -1,30 +1,12 @@ { - "gem_name": "ScriptCanvas", - "GemFormatVersion": 3, - "Uuid": "869a0d0ec11a45c299917d45c81555e6", - "Name": "ScriptCanvas", - "DisplayName": "Script Canvas", - "Version": "0.1.0", - "LinkType": "DynamicStatic", - "EditorModule": true, - "Summary": "The Script Canvas Gem contains Lumberyard's visual scripting environment that enables content creators with little to no engineering experience to build game logic.", - "Tags": ["Scripting", "Game"], - "IconPath": "preview.png", - "Dependencies" : [ - { - "Uuid": "875b6fcbdeea44deaae7984ad9bb6cdc", - "VersionConstraints": [ ">=0.1.0" ], - "_comment": "GraphCanvas" - }, - { - "Uuid": "32d8ba21703e4bbbb08487366e48dd69", - "VersionConstraints": [ ">=0.1.0" ], - "_comment": "ScriptEvents" - }, - { - "Uuid": "4c6f9df57ca2468f93c8d860ee6a1167", - "VersionConstraints": [ ">=0.1.0" ], - "_comment": "ExpressionEvaluation" - } - ] + "gem_name": "ScriptCanvas", + "display_name": "Script Canvas", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Script Canvas Gem provides Open 3D Engine's visual scripting environment, Script Canvas.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Tools", "Utiltiy"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/ScriptCanvasDeveloper/gem.json b/Gems/ScriptCanvasDeveloper/gem.json index 05e7391dcc..7cc2e7d03a 100644 --- a/Gems/ScriptCanvasDeveloper/gem.json +++ b/Gems/ScriptCanvasDeveloper/gem.json @@ -1,30 +1,12 @@ { "gem_name": "ScriptCanvasDeveloperGem", - "GemFormatVersion": 3, - "Uuid": "f905c05883b94fd6bddc91052c3c5a86", - "Name": "ScriptCanvasDeveloperGem", - "DisplayName": "Script Canvas Developer Tools", - "Version": "0.1.0", - "LinkType": "DynamicStatic", - "EditorModule": true, - "Summary": "The Script Canvas Developer Gem contains a suite of utility features that aids in the development and debugging of Script Canvas systems.", - "Tags": ["Scripting", "Editor"], - "IconPath": "preview.png", - "Dependencies" : [ - { - "Uuid" : "bab8807a1bc646b3909f3cc200ffeedf", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "ImGui" - }, - { - "Uuid" : "869a0d0ec11a45c299917d45c81555e6", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "ScriptCanvas" - }, - { - "Uuid" : "875b6fcbdeea44deaae7984ad9bb6cdc", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "GraphCanvas" - } - ] -} + "display_name": "Script Canvas Developer", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Script Canvas Developer Gem provides a suite of utility features for the development and debugging of Script Canvas systems.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Utility", "Debug"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/ScriptCanvasPhysics/gem.json b/Gems/ScriptCanvasPhysics/gem.json index 9435c1dd69..04cfb86980 100644 --- a/Gems/ScriptCanvasPhysics/gem.json +++ b/Gems/ScriptCanvasPhysics/gem.json @@ -1,32 +1,12 @@ { "gem_name": "ScriptCanvasPhysics", - "GemFormatVersion": 4, - "Uuid": "1c27519a4dda4ffaaeebf91514e5b1e8", - "Name": "ScriptCanvasPhysics", - "DisplayName": "Script Canvas - Physics", - "Version": "0.1.0", - "Summary": "Exposes legacy physics features to scripting through the Behavior Context to Lua and Script Canvas.", - "Tags": ["Scripting", "Physics"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - ">=0.1.0" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "869a0d0ec11a45c299917d45c81555e6", - "VersionConstraints": [ - ">=0.1.0" - ], - "_comment": "ScriptCanvas" - } - ] -} + "display_name": "Script Canvas Physics", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Script Canvas Physics Gem provides Script Canvas nodes for physics scene queries such as raycasts.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Physics", "Simulation"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/ScriptCanvasTesting/gem.json b/Gems/ScriptCanvasTesting/gem.json index 4010b87283..d82e841236 100644 --- a/Gems/ScriptCanvasTesting/gem.json +++ b/Gems/ScriptCanvasTesting/gem.json @@ -1,29 +1,12 @@ { - "gem_name": "ScriptCanvasTesting", - "GemFormatVersion": 4, - "Uuid": "387b1b2d39ce45fbbfbb6faa5f902cac", - "Name": "ScriptCanvasTesting", - "DisplayName": "Script Canvas Testing", - "Version": "0.1.0", - "Summary": "Provides a framework for testing for and with ScriptCanvas", - "Tags": ["Scripting", "Testing"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "EditorModule", - "Name": "Editor" - } - ], - "Dependencies" : [ - { - "Uuid": "875b6fcbdeea44deaae7984ad9bb6cdc", - "VersionConstraints": [ ">=0.1.0" ], - "_comment": "GraphCanvas" - }, - { - "Uuid": "869a0d0ec11a45c299917d45c81555e6", - "VersionConstraints": [ ">=0.1.0" ], - "_comment": "ScriptCanvas" - } - ] + "gem_name": "ScriptCanvasTesting", + "display_name": "Script Canvas Testing", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Script Canvas Testing Gem provides a framework for testing for and with Script Canvas.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Debug", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/ScriptEvents/gem.json b/Gems/ScriptEvents/gem.json index 789d66de20..fba99c6af9 100644 --- a/Gems/ScriptEvents/gem.json +++ b/Gems/ScriptEvents/gem.json @@ -1,21 +1,12 @@ { "gem_name": "ScriptEvents", - "GemFormatVersion": 4, - "Uuid": "32d8ba21703e4bbbb08487366e48dd69", - "Name": "ScriptEvents", - "DisplayName": "Script Events", - "Version": "0.1.0", - "Summary": "Provides a framework for creating event assets usable from any scripting solution.", - "Tags": [ "Script", "Events", "Lua", "Script", "Canvas", "EBus", "Behavior Context" ], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ] + "display_name": "Script Events", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Script Events Gem provides a framework for creating event assets usable from any scripting solution in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "Framework", "Gameplay"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/ScriptedEntityTweener/gem.json b/Gems/ScriptedEntityTweener/gem.json index 9cc816e744..c2e1975f76 100644 --- a/Gems/ScriptedEntityTweener/gem.json +++ b/Gems/ScriptedEntityTweener/gem.json @@ -1,12 +1,12 @@ { "gem_name": "ScriptedEntityTweener", - "GemFormatVersion": 3, - "Uuid": "0d1f5f05559c4a99aaefd30633a0158e", - "Name": "ScriptedEntityTweener", - "DisplayName": "Scripted Entity Tweener", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "Entity Animator can be used to transform entity properties in Lumberyard", - "Tags": ["UI"], - "IconPath": "preview.png" -} + "display_name": "Scripted Entity Tweener", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Scripted Entity Tweener Gem provides a script driven animation system for Open 3D Engine projects.", + "canonical_tags": ["Gem"], + "user_tags": ["Scripting", "UI", "Animation"], + "icon_path": "preview.png", + "requirements": "" + } diff --git a/Gems/SliceFavorites/gem.json b/Gems/SliceFavorites/gem.json index 759cc5dc3d..3ae37e2145 100644 --- a/Gems/SliceFavorites/gem.json +++ b/Gems/SliceFavorites/gem.json @@ -1,17 +1,11 @@ { "gem_name": "SliceFavorites", - "GemFormatVersion": 4, - "Uuid": "1bfc7270d4a1490daac8aa8b072c4489", - "Name": "SliceFavorites", - "DisplayName": "SliceFavorites", - "Version": "0.1.0", - "Summary": "Add the ability to favorite a slice to allow easy access and instantiation", - "Tags": ["Editor", "Slices"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "EditorModule", - "Name": "Editor" - } - ] + "display_name": "SliceFavorites", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "Add the ability to favorite a slice to allow easy access and instantiation", + "user_tags": ["Editor", "Slices"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/StartingPointCamera/gem.json b/Gems/StartingPointCamera/gem.json index e970ae417d..2c28f346a9 100644 --- a/Gems/StartingPointCamera/gem.json +++ b/Gems/StartingPointCamera/gem.json @@ -1,35 +1,12 @@ { "gem_name": "StartingPointCamera", - "Dependencies": [ - { - "Uuid": "54f2763fe191432fa681ce4a354eedf5", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "CameraFramework" - }, - { - "Uuid": "f910686b6725452fbfc4671f95f733c6", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "Camera" - }, - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ], - "GemFormatVersion": 3, - "Uuid": "834070b9537d44df83559e2045c3859f", - "Name": "StartingPointCamera", - "DisplayName": "Starting Point Camera [PREVIEW]", - "Version": "0.1.0", - "LinkType": "Dynamic", - "Summary": "The Starting Point Camera Gem includes the behaviors used with the Camera Framework Gem to define a camera rig.", - "Tags": ["Camera", "Starting Point"], - "IconPath": "preview.png" + "display_name": "Starting Point Camera", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Starting Point Camera Gem provides the behaviors used with the Camera Framework Gem to define a camera rig.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Gameplay", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/StartingPointInput/gem.json b/Gems/StartingPointInput/gem.json index 5faddabea7..2d5b6aee15 100644 --- a/Gems/StartingPointInput/gem.json +++ b/Gems/StartingPointInput/gem.json @@ -1,21 +1,12 @@ { "gem_name": "StartingPointInput", - "Dependencies": [ - { - "Uuid" : "869a0d0ec11a45c299917d45c81555e6", - "VersionConstraints" : [">=0.1.0"], - "_comment" : "ScriptCanvas" - } - ], - - "GemFormatVersion": 3, - "Uuid": "09f4bedeee614358bc36788e77f97e51", - "Name": "StartingPointInput", - "Version": "0.1.0", - "LinkType": "Dynamic", - "EditorModule": true, - "DisplayName": "Starting Point Input", - "Tags": ["Input","Starting Point"], - "Summary": "The Starting Point Input Gem builds on top of the AzFramework/Input system to map raw input into higher level gameplay events specified by the user.", - "IconPath": "preview.png" + "display_name": "Starting Point Input", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Starting Point Input Gem provides functionality to map low-level input events to high-level actions.", + "canonical_tags": ["Gem"], + "user_tags": ["Input", "Gameplay", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/StartingPointMovement/gem.json b/Gems/StartingPointMovement/gem.json index d34637b86c..cb4e8d0e6a 100644 --- a/Gems/StartingPointMovement/gem.json +++ b/Gems/StartingPointMovement/gem.json @@ -1,21 +1,12 @@ { "gem_name": "StartingPointMovement", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ], - "GemFormatVersion": 3, - "Uuid": "73d8779dc28a4123b7c9ed76217464af", - "Name": "StartingPointMovement", - "Version": "0.1.0", - "LinkType": "Dynamic", - "DisplayName": "Starting Point Movement [PREVIEW]", - "Summary": "The Starting Point Movement Gem includes a series of Lua scripts that listens for input events that then triggers a transform operation such as movement or rotation.", - "Tags": ["Movement", "Starting Point"], - "IconPath": "preview.png" + "display_name": "Starting Point Movement", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Starting Point Movement Gem provides a series of Lua scripts that listen and respond to input events and trigger transform operations such as translation and rotation.", + "canonical_tags": ["Gem"], + "user_tags": ["Input", "Gameplay", "Scripting"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/SurfaceData/gem.json b/Gems/SurfaceData/gem.json index fd39052219..1fb521ef58 100644 --- a/Gems/SurfaceData/gem.json +++ b/Gems/SurfaceData/gem.json @@ -1,30 +1,12 @@ { "gem_name": "SurfaceData", - "GemFormatVersion": 4, - "Uuid": "5de82d29d6094bfe97c1a4d35fcd5fbe", - "Name": "SurfaceData", - "DisplayName": "Surface Data [PREVIEW]", - "Version": "0.1.0", - "Summary": "A Lumberyard Gem that allows you to attach user-defined tags to surfaces and volumes, and fetch data like positions, normals, and tags for those surfaces.", - "Tags": ["Surface", "Geometry", "Tags"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ], - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - } - ] + "display_name": "Surface Data", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Surface Data Gem provides functionality to emit signals or tags from surfaces such as meshes and terrain.", + "canonical_tags": ["Gem"], + "user_tags": ["Environment", "Utiltiy", "Design"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/TestAssetBuilder/gem.json b/Gems/TestAssetBuilder/gem.json index 057a746be3..4c75343ebb 100644 --- a/Gems/TestAssetBuilder/gem.json +++ b/Gems/TestAssetBuilder/gem.json @@ -1,17 +1,12 @@ { "gem_name": "TestAssetBuilder", - "GemFormatVersion": 4, - "Uuid": "f5c92f1560714010ba30467d93feecef", - "Name": "TestAssetBuilder", - "DisplayName": "Test Asset Builder", - "Version": "0.1.0", - "Summary": "This builder is used for feature testing the asset processor.", - "Tags": ["Assets", "Pipeline", "Feature Test", "Asset Builder", "Asset Processor"], - "IconPath": "preview.png", - "Modules": [ - { - "Name": "Editor", - "Type": "EditorModule" - } - ] + "display_name": "Test Asset Builder", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Test Asset Builder Gem is used to feature test Asset Processor.", + "canonical_tags": ["Gem"], + "user_tags": ["Assets", "Debug", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/TextureAtlas/gem.json b/Gems/TextureAtlas/gem.json index 5b5e0e74df..1991ad387e 100644 --- a/Gems/TextureAtlas/gem.json +++ b/Gems/TextureAtlas/gem.json @@ -1,17 +1,12 @@ { "gem_name": "TextureAtlas", - "GemFormatVersion": 4, - "Uuid": "5a149b6b3c964064bd4970f0e92f72e2", - "Name": "TextureAtlas", - "DisplayName": "Texture Atlas", - "Version": "0.1.0", - "Summary": "Includes the formatting for Texture Atlases", - "Tags": ["Required", "Asset Processor Builder", "Texture Atlas"], - "IconPath": "preview.png", - "IsRequired": true, - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Texture Atlas", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Texture Atlas Gem provides the formatting for texture atlases from 2D textures for LyShine.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Assets", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/TickBusOrderViewer/gem.json b/Gems/TickBusOrderViewer/gem.json index b9f70e1045..787fd24abb 100644 --- a/Gems/TickBusOrderViewer/gem.json +++ b/Gems/TickBusOrderViewer/gem.json @@ -1,16 +1,12 @@ { "gem_name": "TickBusOrderViewer", - "GemFormatVersion": 4, - "Uuid": "937fc4d2b2a94291bdeea06261c501b3", - "Name": "TickBusOrderViewer", - "DisplayName": "Tick Bus Order Console Variable", - "Version": "1.0.0", - "Summary": "Provides the console variable, print_tickbus_handlers, which displays the order of all tick events to the console. If you specify an entityId, it will only display the tick events for that entity.", - "Tags": ["Console Variable", "CVAR"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Tick Bus Order Viewer", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The Tick Bus Order Viewer Gem provides a console variable that displays the order of runtime tick events.", + "canonical_tags": ["Gem"], + "user_tags": ["Gameplay", "Simulation", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Twitch/gem.json b/Gems/Twitch/gem.json index 3755226862..b5e2f3a3b2 100644 --- a/Gems/Twitch/gem.json +++ b/Gems/Twitch/gem.json @@ -1,19 +1,12 @@ { "gem_name": "Twitch", - "GemFormatVersion": 3, - "Uuid": "b63e64141fab40b791211ba257632e84", - "Name": "Twitch", - "DisplayName": "Twitch", - "Version": "1.0.0", - "LinkType": "Dynamic", - "Summary": "Provides access to the Twitch API v5 SDK including social functions, channels, and other APIs.", - "Tags": ["Twitch","SDK","Social"], - "IconPath": "preview.png", - "Dependencies": [ - { - "Uuid": "28479e255bde466e91fc34eec808d9c7", - "VersionConstraints": [ "~>1.0" ], - "_comment": "HttpRequestor" - } - ] + "display_name": "Twitch", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Twitch Gem provides access to the Twitch API v5 SDK including social functions, channels, and other APIs.", + "canonical_tags": ["Gem"], + "user_tags": ["Network", "SDK", "Multiplayer"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/UiBasics/gem.json b/Gems/UiBasics/gem.json index de814796cb..9cd1548f57 100644 --- a/Gems/UiBasics/gem.json +++ b/Gems/UiBasics/gem.json @@ -1,12 +1,12 @@ { "gem_name": "UiBasics", - "GemFormatVersion": 3, - "LinkType": "NoCode", - "Name": "UiBasics", - "DisplayName": "UI Basics", - "Summary": "Provides basic UI prefabs: image, text, button, and text input, as well as the textures that those prefabs require.", - "Uuid": "6bb61c9e547043f0afc5019d6d460b78", - "Version": "0.1.0", - "IconPath": "preview.png", - "Tags": ["UI", "Prefab", "Button", "Image"] + "display_name": "UI Basics", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Asset", + "summary": "The UI Basics Gem provides a collection of basic UI prefabs such as image, text, and button, that can be used with LyShine, the Open 3D Engine runtime User Interface system and editor.", + "canonical_tags": ["Gem"], + "user_tags": ["UI", "Assets", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/Vegetation/gem.json b/Gems/Vegetation/gem.json index 5bc744a94d..1796123014 100644 --- a/Gems/Vegetation/gem.json +++ b/Gems/Vegetation/gem.json @@ -1,44 +1,12 @@ { "gem_name": "Vegetation", - "Dependencies": [ - { - "Uuid": "ff06785f7145416b9d46fde39098cb0c", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "LmbrCentral" - }, - { - "Uuid": "8825563d9d964ec3be3bab681f3bd9f2", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "GradientSignal" - }, - { - "Uuid": "5de82d29d6094bfe97c1a4d35fcd5fbe", - "VersionConstraints": [ - "~>0.1" - ], - "_comment": "SurfaceData" - } - ], - "GemFormatVersion": 4, - "Uuid": "f394e7cf54424bba89615381bba9511b", - "Name": "Vegetation", - "DisplayName": "Vegetation [PREVIEW]", - "Version": "0.1.0", - "Summary": "A Lumberyard Gem for authoring Dynamic Procedural Vegetation (A real-time planting engine).
NOTE: The Landscape Canvas gem is an optional node-based Editor that provides the recommended workflows for authoring/editing Dynamic Vegetation content.", - "Tags": ["Vegetation"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ] + "display_name": "Vegetation", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Vegetation Gem provides tools to place natural-looking vegetation in Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Environment", "Tools", "Design"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/VideoPlaybackFramework/gem.json b/Gems/VideoPlaybackFramework/gem.json index 3050863571..05598a8e5e 100644 --- a/Gems/VideoPlaybackFramework/gem.json +++ b/Gems/VideoPlaybackFramework/gem.json @@ -1,16 +1,12 @@ { "gem_name": "VideoPlaybackFramework", - "GemFormatVersion": 4, - "Uuid": "560d69cbaafd40bea8a09bccfe7f77e6", - "Name": "VideoPlaybackFramework", - "DisplayName": "Video Playback Framework", - "Version": "0.1.0", - "Summary": "The Video Playback Framework Gem provides the interface to play back video during gameplay. This gem is automatically enabled when selecting any of the Video Playback Gems.", - "Tags": ["Video"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "display_name": "Video Playback Framework", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Video Playback Framework Gem provides the interface to play back video.", + "canonical_tags": ["Gem"], + "user_tags": ["Rendering", "Framework"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/VirtualGamepad/gem.json b/Gems/VirtualGamepad/gem.json index 39e0e4e2f8..610f203f7c 100644 --- a/Gems/VirtualGamepad/gem.json +++ b/Gems/VirtualGamepad/gem.json @@ -1,16 +1,12 @@ { - "gem_name": "VirtualGampad", - "GemFormatVersion": 4, - "Uuid": "8aa9a66015804d6d9c809ce306e7d913", - "Name": "VirtualGamepad", - "DisplayName": "VirtualGamepad", - "Version": "0.1.0", - "Summary": "Example of a virtual gamepad that can be used by mobile devices with touch screens in place of a physical gamepad.", - "Tags": ["Input", "Mobile"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - } - ] + "gem_name": "VirtualGamepad", + "display_name": "Virtual Gamepad", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "The Virtual Gamepad Gem provides controls that emulate a gamepad on touch screen devices.", + "canonical_tags": ["Gem"], + "user_tags": ["Input", "Gameplay"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Gems/WhiteBox/gem.json b/Gems/WhiteBox/gem.json index de05a0d52b..a46434dd65 100644 --- a/Gems/WhiteBox/gem.json +++ b/Gems/WhiteBox/gem.json @@ -1,21 +1,12 @@ { "gem_name": "WhiteBox", - "GemFormatVersion": 4, - "Uuid": "c5833dbda2e045d3a5f16b7414280c27", - "Name": "WhiteBox", - "DisplayName": "White Box", - "Version": "0.1.0", - "Summary": "A tool for quickly prototyping levels in the editor.", - "Tags": ["Editor"], - "IconPath": "preview.png", - "Modules": [ - { - "Type": "GameModule" - }, - { - "Name": "Editor", - "Type": "EditorModule", - "Extends": "GameModule" - } - ] + "display_name": "White Box", + "license": "Apache-2.0 Or MIT", + "origin": "Open 3D Engine - o3de.org", + "type": "Tool", + "summary": "The White Box Gem provides White Box rapid design components for Open 3D Engine.", + "canonical_tags": ["Gem"], + "user_tags": ["Design", "Tools", "Utility"], + "icon_path": "preview.png", + "requirements": "" } diff --git a/Templates/AssetGem/Template/gem.json b/Templates/AssetGem/Template/gem.json index 5b8fb3fde0..2a688857f2 100644 --- a/Templates/AssetGem/Template/gem.json +++ b/Templates/AssetGem/Template/gem.json @@ -1,14 +1,17 @@ { "gem_name": "${Name}", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Asset", "summary": "A short description of ${Name}.", "canonical_tags": [ "Gem" ], "user_tags": [ + "Assets", "${Name}" ], - "icon_path": "preview.png" + "icon_path": "preview.png", + "requirements": "" } diff --git a/Templates/DefaultGem/Template/gem.json b/Templates/DefaultGem/Template/gem.json index 5b8fb3fde0..353ad6bf8d 100644 --- a/Templates/DefaultGem/Template/gem.json +++ b/Templates/DefaultGem/Template/gem.json @@ -1,8 +1,9 @@ { "gem_name": "${Name}", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Code", "summary": "A short description of ${Name}.", "canonical_tags": [ "Gem" @@ -10,5 +11,6 @@ "user_tags": [ "${Name}" ], - "icon_path": "preview.png" + "icon_path": "preview.png", + "requirements": "" } diff --git a/Templates/DefaultProject/Template/Code/gem.json b/Templates/DefaultProject/Template/Code/gem.json index 5b8fb3fde0..353ad6bf8d 100644 --- a/Templates/DefaultProject/Template/Code/gem.json +++ b/Templates/DefaultProject/Template/Code/gem.json @@ -1,8 +1,9 @@ { "gem_name": "${Name}", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Code", "summary": "A short description of ${Name}.", "canonical_tags": [ "Gem" @@ -10,5 +11,6 @@ "user_tags": [ "${Name}" ], - "icon_path": "preview.png" + "icon_path": "preview.png", + "requirements": "" } diff --git a/Templates/MinimalProject/Template/Code/gem.json b/Templates/MinimalProject/Template/Code/gem.json index 5b8fb3fde0..353ad6bf8d 100644 --- a/Templates/MinimalProject/Template/Code/gem.json +++ b/Templates/MinimalProject/Template/Code/gem.json @@ -1,8 +1,9 @@ { "gem_name": "${Name}", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Code", "summary": "A short description of ${Name}.", "canonical_tags": [ "Gem" @@ -10,5 +11,6 @@ "user_tags": [ "${Name}" ], - "icon_path": "preview.png" + "icon_path": "preview.png", + "requirements": "" } From 7aaf2659268f490cb1f9f86422436b418bc27275 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 7 Jul 2021 11:48:54 -0700 Subject: [PATCH 077/156] The Great ScriptCanvas Purge, Part IX Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../ScriptCanvasActions/GraphActions.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp index 97aa1667df..777dcdd1b6 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/EditorAutomation/EditorAutomationActions/ScriptCanvasActions/GraphActions.cpp @@ -127,19 +127,6 @@ namespace ScriptCanvasDeveloper { return AZ::Failure("Active graph is not the newly created function."); } - else - { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - ScriptCanvasEditor::GeneralRequestBus::BroadcastResult(scriptCanvasId, &ScriptCanvasEditor::GeneralRequests::GetScriptCanvasId, activeGraphCanvasId); - - bool isFunctionGraph = false; - ScriptCanvasEditor::EditorGraphRequestBus::EventResult(isFunctionGraph, scriptCanvasId, &ScriptCanvasEditor::EditorGraphRequests::IsFunctionGraph); - - if (!isFunctionGraph) - { - return AZ::Failure("Created a new Graph, but graph is not of type Function."); - } - } } return CompoundAction::GenerateReport(); From da529edfb571d0f394874b76e94f5149d4aae5d0 Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 20:54:57 -0700 Subject: [PATCH 078/156] Fix ImGui not rendering correctly at resolutions greater than 1080p Signed-off-by: nvsickle --- Gems/ImGui/Code/Source/ImGuiManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ImGui/Code/Source/ImGuiManager.h b/Gems/ImGui/Code/Source/ImGuiManager.h index acd8d7cea4..0df1b25b40 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.h +++ b/Gems/ImGui/Code/Source/ImGuiManager.h @@ -82,7 +82,7 @@ namespace ImGui DisplayState m_editorWindowState = DisplayState::Hidden; // ImGui Resolution Settings - ImGuiResolutionMode m_resolutionMode = ImGuiResolutionMode::MatchToMaxRenderResolution; + ImGuiResolutionMode m_resolutionMode = ImGuiResolutionMode::MatchRenderResolution; ImVec2 m_renderResolution = ImVec2(1920.0f, 1080.0f); ImVec2 m_lastRenderResolution; AzFramework::WindowSize m_windowSize = AzFramework::WindowSize(1920, 1080); From 6b76eceb1f665aee7a7649369229b8f7a80ff6b8 Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 20:56:40 -0700 Subject: [PATCH 079/156] Add GetDpiScaleFactor to native window API -This includes implementations of the API for the Editor and Windows, all other platforms will have a 1.0 scale for now Signed-off-by: nvsickle --- Code/Editor/RenderViewport.h | 1 + .../AzFramework/Application/Application.cpp | 2 ++ .../AzFramework/Windowing/NativeWindow.cpp | 11 +++++++ .../AzFramework/Windowing/NativeWindow.h | 2 ++ .../AzFramework/Windowing/WindowBus.h | 8 +++++ .../Windowing/NativeWindow_Windows.cpp | 32 ++++++++++++++++++- .../Include/Atom/RPI.Public/ViewportContext.h | 11 ++++++- .../Source/RPI.Public/ViewportContext.cpp | 15 +++++++++ .../Viewport/RenderViewportWidget.h | 1 + .../Source/Viewport/RenderViewportWidget.cpp | 5 +++ 10 files changed, 86 insertions(+), 2 deletions(-) diff --git a/Code/Editor/RenderViewport.h b/Code/Editor/RenderViewport.h index 1764028dd6..2a67e1bbc6 100644 --- a/Code/Editor/RenderViewport.h +++ b/Code/Editor/RenderViewport.h @@ -219,6 +219,7 @@ public: void SetFullScreenState(bool fullScreenState) override; bool CanToggleFullScreenState() const override; void ToggleFullScreenState() override; + float GetDpiScaleFactor() const override { return 1.0f; }; void ConnectViewportInteractionRequestBus(); void DisconnectViewportInteractionRequestBus(); diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index 07f4865863..81c5a86cda 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -731,10 +731,12 @@ namespace AzFramework bool Application::IsPrefabSystemEnabled() const { bool value = true; + /* if (auto* registry = AZ::SettingsRegistry::Get()) { registry->Get(value, ApplicationInternal::s_prefabSystemKey); } + */ return value; } diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp index b92d8dc3bc..3e7d67888f 100644 --- a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp +++ b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.cpp @@ -116,6 +116,11 @@ namespace AzFramework SetFullScreenState(!GetFullScreenState()); } + float NativeWindow::GetDpiScaleFactor() const + { + return m_pimpl->GetDpiScaleFactor(); + } + /*static*/ bool NativeWindow::GetFullScreenStateOfDefaultWindow() { NativeWindowHandle defaultWindowHandle = nullptr; @@ -228,4 +233,10 @@ namespace AzFramework return false; } + float NativeWindow::Implementation::GetDpiScaleFactor() const + { + // For platforms that aren't DPI-aware, we simply return a 1.0 ratio for no scaling + return 1.0f; + } + } // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h index 0b53b5b31c..2d5a897146 100644 --- a/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h +++ b/Code/Framework/AzFramework/AzFramework/Windowing/NativeWindow.h @@ -128,6 +128,7 @@ namespace AzFramework void SetFullScreenState(bool fullScreenState) override; bool CanToggleFullScreenState() const override; void ToggleFullScreenState() override; + float GetDpiScaleFactor() const override; //! Get the full screen state of the default window. //! \return True if the default window is currently in full screen, false otherwise. @@ -169,6 +170,7 @@ namespace AzFramework virtual bool GetFullScreenState() const; virtual void SetFullScreenState(bool fullScreenState); virtual bool CanToggleFullScreenState() const; + virtual float GetDpiScaleFactor() const; protected: uint32_t m_width = 0; diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h index 959d7cc07b..8627e06ec8 100644 --- a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h +++ b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h @@ -68,6 +68,11 @@ namespace AzFramework //! Toggle the full screen state of the window. virtual void ToggleFullScreenState() = 0; + + //! Returns a scalar multiplier representing how dots-per-inch this window has, compared + //! to a "standard" value of 96, the default for Windows in a DPI unaware setting. This can + //! be used to scale user interface elements to ensure legibility on high density displays. + virtual float GetDpiScaleFactor() const = 0; }; using WindowRequestBus = AZ::EBus; @@ -87,6 +92,9 @@ namespace AzFramework //! This is called once when the window is Activated and also called if the user resizes the window. virtual void OnWindowResized(uint32_t width, uint32_t height) { AZ_UNUSED(width); AZ_UNUSED(height); }; + //! This is called if the window's underyling DPI scaling factor changes. + virtual void OnDpiScaleFactorChanged(float dpiScaleFactor) { AZ_UNUSED(dpiScaleFactor); } + //! This is called when the window is deactivated from code or if the user closes the window. virtual void OnWindowClosed() {}; }; diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp index 44a3757aea..6f9bf2cf1e 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp @@ -17,7 +17,7 @@ namespace AzFramework { public: AZ_CLASS_ALLOCATOR(NativeWindowImpl_Win32, AZ::SystemAllocator, 0); - NativeWindowImpl_Win32() = default; + NativeWindowImpl_Win32(); ~NativeWindowImpl_Win32() override; // NativeWindow::Implementation overrides... @@ -33,6 +33,7 @@ namespace AzFramework bool GetFullScreenState() const override; void SetFullScreenState(bool fullScreenState) override; bool CanToggleFullScreenState() const override { return true; } + float GetDpiScaleFactor() const override; private: static DWORD ConvertToWin32WindowStyleMask(const WindowStyleMasks& styleMasks); @@ -49,6 +50,9 @@ namespace AzFramework RECT m_windowRectToRestoreOnFullScreenExit; //!< The position and size of the window to restore when exiting full screen. UINT m_windowStyleToRestoreOnFullScreenExit; //!< The style(s) of the window to restore when exiting full screen. bool m_isInBorderlessWindowFullScreenState = false; //!< Was a borderless window used to enter full screen state? + + using GetDpiForWindowType = UINT(HWND hwnd); + GetDpiForWindowType* m_getDpiFunction = nullptr; }; const char* NativeWindowImpl_Win32::s_defaultClassName = "O3DEWin32Class"; @@ -58,6 +62,16 @@ namespace AzFramework return aznew NativeWindowImpl_Win32(); } + NativeWindowImpl_Win32::NativeWindowImpl_Win32() + { + // Attempt to load GetDpiForWindow from user32 at runtime, available on Windows 10+ versions >= 1607 + auto user32module = LoadLibraryA("user32.dll"); + if (user32module) + { + m_getDpiFunction = reinterpret_cast(GetProcAddress(user32module, "GetDpiForWindow")); + } + } + NativeWindowImpl_Win32::~NativeWindowImpl_Win32() { DestroyWindow(m_win32Handle); @@ -237,6 +251,11 @@ namespace AzFramework // Send all other WM_SYSKEYDOWN messages to the default WndProc. break; } + case WM_DPICHANGED: + { + const float newScaleFactor = nativeWindowImpl->GetDpiScaleFactor(); + WindowNotificationBus::Event(nativeWindowImpl->GetWindowHandle(), &WindowNotificationBus::Events::OnDpiScaleFactorChanged, newScaleFactor); + } default: return DefWindowProc(hWnd, message, wParam, lParam); break; @@ -330,6 +349,17 @@ namespace AzFramework } } + float NativeWindowImpl_Win32::GetDpiScaleFactor() const + { + constexpr UINT defaultDotsPerInch = 96; + UINT dotsPerInch = defaultDotsPerInch; + if (m_getDpiFunction) + { + dotsPerInch = m_getDpiFunction(m_win32Handle); + } + return aznumeric_cast(dotsPerInch) / aznumeric_cast(defaultDotsPerInch); + } + void NativeWindowImpl_Win32::EnterBorderlessWindowFullScreen() { if (m_isInBorderlessWindowFullScreenState) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h index 982ef498a0..17e6714132 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h @@ -65,8 +65,14 @@ namespace AZ ConstViewPtr GetDefaultView() const; //! Gets the current size of the viewport. + //! This value is cached and updated on-demand, so may be performantly queried. AzFramework::WindowSize GetViewportSize() const; + //! Gets the screen DPI scaling factor. + //! This value is cached and updated on-demand, so may be performantly queried. + //! \see AzFramework::WindowRequests::GetDpiScaleFactor + float GetDpiScalingFactor() const; + // SceneNotificationBus interface //! Ensures our default view remains set when our scene's render pipelines are modified. void OnRenderPipelineAdded(RenderPipelinePtr pipeline) override; @@ -76,8 +82,10 @@ namespace AZ void OnBeginPrepareRender() override; //WindowNotificationBus interface - //! Used to fire a notification when our window resizes + //! Used to fire a notification when our window resizes. void OnWindowResized(uint32_t width, uint32_t height) override; + //! Used to fire a notification when our window DPI changes. + void OnDpiScaleFactorChanged(float dpiScaleFactor) override; using SizeChangedEvent = AZ::Event; //! Notifies consumers when the viewport size has changed. @@ -130,6 +138,7 @@ namespace AZ WindowContextSharedPtr m_windowContext; ViewPtr m_defaultView; AzFramework::WindowSize m_viewportSize; + float m_viewportDpiScaleFactor = 1.0f; SizeChangedEvent m_sizeChangedEvent; MatrixChangedEvent m_viewMatrixChangedEvent; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp index 23d5805c12..ae2a72ae89 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp @@ -10,6 +10,7 @@ #include #include #include +#include "..\..\Include\Atom\RPI.Public\ViewportContext.h" namespace AZ { @@ -28,6 +29,10 @@ namespace AZ m_viewportSize, nativeWindow, &AzFramework::WindowRequestBus::Events::GetClientAreaSize); + AzFramework::WindowRequestBus::EventResult( + m_viewportDpiScaleFactor, + nativeWindow, + &AzFramework::WindowRequestBus::Events::GetDpiScaleFactor); AzFramework::WindowNotificationBus::Handler::BusConnect(nativeWindow); AzFramework::ViewportRequestBus::Handler::BusConnect(id); @@ -148,6 +153,11 @@ namespace AZ return m_viewportSize; } + float ViewportContext::GetDpiScalingFactor() const + { + return m_viewportDpiScaleFactor; + } + void ViewportContext::ConnectSizeChangedHandler(SizeChangedEvent::Handler& handler) { handler.Connect(m_sizeChangedEvent); @@ -289,5 +299,10 @@ namespace AZ m_sizeChangedEvent.Signal(m_viewportSize); } } + + void ViewportContext::OnDpiScaleFactorChanged(float dpiScaleFactor) + { + m_viewportDpiScaleFactor = dpiScaleFactor; + } } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h index c649031280..10dcc6c5c9 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h @@ -113,6 +113,7 @@ namespace AtomToolsFramework void SetFullScreenState(bool fullScreenState) override; bool CanToggleFullScreenState() const override; void ToggleFullScreenState() override; + float GetDpiScaleFactor() const override; protected: // AzFramework::InputChannelEventListener ... diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index 529652e1a9..b12996442a 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -540,4 +540,9 @@ namespace AtomToolsFramework { // The RenderViewportWidget does not currently support full screen. } + + float RenderViewportWidget::GetDpiScaleFactor() const + { + return aznumeric_cast(devicePixelRatioF()); + } } //namespace AtomToolsFramework From b328cdf11d5f4a705edafea88b10ecddc66f26ab Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 20:57:23 -0700 Subject: [PATCH 080/156] Make the launcher's lack of DPI awareness on Windows explicit This will enable per-screen DPI awareness to be turned on later Signed-off-by: nvsickle --- Code/LauncherUnified/launcher_generator.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index 85976e1cb9..628b5fffac 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -122,6 +122,8 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC FOLDER ${project_name} ) + # After ensuring that we correctly support DPI scaling, this should be switched to "PerMonitor" + set_property(TARGET ${project_name}.GameLauncher APPEND PROPERTY VS_DPI_AWARE "OFF") if(LY_DEFAULT_PROJECT_PATH) set_property(TARGET ${project_name}.GameLauncher APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"") endif() From 9e4d6a1d85ae86cd7b11831ae83db5f209080c9c Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 20:58:00 -0700 Subject: [PATCH 081/156] Scale the viewport debug info overlay by the DPI scale factor Signed-off-by: nvsickle --- .../Code/Source/AtomViewportDisplayInfoSystemComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 5b14fbebb9..2a618518f0 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -157,7 +157,7 @@ namespace AZ::Render auto viewportSize = viewportContext->GetViewportSize(); m_drawParams.m_position = AZ::Vector3(viewportSize.m_width, 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding); m_drawParams.m_color = AZ::Colors::White; - m_drawParams.m_scale = AZ::Vector2(0.7f); + m_drawParams.m_scale = AZ::Vector2(0.7f * viewportContext->GetDpiScalingFactor()); m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right; m_drawParams.m_monospace = false; m_drawParams.m_depthTest = false; From 0c97888d0f54d142eb7c49134b703029f6ff37bf Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 21:00:42 -0700 Subject: [PATCH 082/156] Revert accidental change Signed-off-by: nvsickle --- .../AzFramework/AzFramework/Application/Application.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index 81c5a86cda..07f4865863 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -731,12 +731,10 @@ namespace AzFramework bool Application::IsPrefabSystemEnabled() const { bool value = true; - /* if (auto* registry = AZ::SettingsRegistry::Get()) { registry->Get(value, ApplicationInternal::s_prefabSystemKey); } - */ return value; } From dd20a598b25bb62132c126dabe9a14a056f8b685 Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 21 Jun 2021 22:15:39 -0700 Subject: [PATCH 083/156] Add DPI scaling to IMGUI Signed-off-by: nvsickle --- .../Code/Include/Atom/RPI.Public/ViewportContext.h | 6 ++++++ .../Include/Atom/RPI.Public/ViewportContextBus.h | 4 +++- .../Atom/RPI.Public/ViewportContextManager.h | 1 + .../RPI/Code/Source/RPI.Public/ViewportContext.cpp | 6 ++++++ .../Source/RPI.Public/ViewportContextManager.cpp | 12 ++++++++++++ .../Code/Source/ImguiAtomSystemComponent.cpp | 12 +++++++++++- .../Code/Source/ImguiAtomSystemComponent.h | 1 + Gems/ImGui/Code/Include/ImGuiBus.h | 2 ++ Gems/ImGui/Code/Source/ImGuiManager.cpp | 14 ++++++++++++++ Gems/ImGui/Code/Source/ImGuiManager.h | 2 ++ 10 files changed, 58 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h index 17e6714132..3840b2b75c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h @@ -92,6 +92,11 @@ namespace AZ //! Alternatively, connect to ViewportContextNotificationsBus and listen to ViewportContextNotifications::OnViewportSizeChanged. void ConnectSizeChangedHandler(SizeChangedEvent::Handler& handler); + using ScalarChangedEvent = AZ::Event; + //! Notifies consumers when the viewport DPI scaling ratio has changed. + //! Alternatively, connect to ViewportContextNotificationsBus and listen to ViewportContextNotifications::OnViewportDpiScalingChanged. + void ConnectDpiScalingFactorChangedHandler(ScalarChangedEvent::Handler& handler); + using MatrixChangedEvent = AZ::Event; //! Notifies consumers when the view matrix has changed. void ConnectViewMatrixChangedHandler(MatrixChangedEvent::Handler& handler); @@ -141,6 +146,7 @@ namespace AZ float m_viewportDpiScaleFactor = 1.0f; SizeChangedEvent m_sizeChangedEvent; + ScalarChangedEvent m_dpiScalingFactorChangedEvent; MatrixChangedEvent m_viewMatrixChangedEvent; MatrixChangedEvent::Handler m_onViewMatrixChangedHandler; MatrixChangedEvent m_projectionMatrixChangedEvent; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextBus.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextBus.h index da0c850f3d..152c8cf2c1 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextBus.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextBus.h @@ -105,8 +105,10 @@ namespace AZ class ViewportContextNotifications { public: - //! Called when the underlying native window size changes for a given viewport context name. + //! Called when the underlying native window size changes for a given viewport context. virtual void OnViewportSizeChanged(AzFramework::WindowSize size){AZ_UNUSED(size);} + //! Called when the window DPI scaling changes for a given viewport context. + virtual void OnViewportDpiScalingChanged(float dpiScale){AZ_UNUSED(dpiScale);} //! Called when the active view for a given viewport context name changes. virtual void OnViewportDefaultViewChanged(AZ::RPI::ViewPtr view){AZ_UNUSED(view);} //! Called when the viewport is to be rendered. diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextManager.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextManager.h index 008565d178..e50525cff0 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextManager.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContextManager.h @@ -51,6 +51,7 @@ namespace AZ { AZStd::weak_ptr context; ViewportContext::SizeChangedEvent::Handler sizeChangedHandler; + ViewportContext::ScalarChangedEvent::Handler dpiScalingChangedHandler; }; // ViewportContextManager is a singleton owned solely by RPISystem, which is tagged as a friend diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp index ae2a72ae89..a37d9f3c00 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp @@ -163,6 +163,11 @@ namespace AZ handler.Connect(m_sizeChangedEvent); } + void ViewportContext::ConnectDpiScalingFactorChangedHandler(ScalarChangedEvent::Handler& handler) + { + handler.Connect(m_dpiScalingFactorChangedEvent); + } + void ViewportContext::ConnectViewMatrixChangedHandler(MatrixChangedEvent::Handler& handler) { handler.Connect(m_viewMatrixChangedEvent); @@ -303,6 +308,7 @@ namespace AZ void ViewportContext::OnDpiScaleFactorChanged(float dpiScaleFactor) { m_viewportDpiScaleFactor = dpiScaleFactor; + m_dpiScalingFactorChangedEvent.Signal(dpiScaleFactor); } } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp index 552304557f..ebf45f36f7 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp @@ -62,9 +62,20 @@ namespace AZ } ViewportContextIdNotificationBus::Event(viewportId, &ViewportContextIdNotificationBus::Events::OnViewportSizeChanged, size); }; + auto onDpiScalingChanged = [this, viewportId](float dpiScalingFactor) + { + // Ensure we emit OnViewportDpiScalingChanged with the correct name. + auto viewportContext = this->GetViewportContextById(viewportId); + if (viewportContext) + { + ViewportContextNotificationBus::Event(viewportContext->GetName(), &ViewportContextNotificationBus::Events::OnViewportDpiScalingChanged, dpiScalingFactor); + } + ViewportContextIdNotificationBus::Event(viewportId, &ViewportContextIdNotificationBus::Events::OnViewportDpiScalingChanged, dpiScalingFactor); + }; viewportContext->m_name = contextName; viewportData.sizeChangedHandler = ViewportContext::SizeChangedEvent::Handler(onSizeChanged); viewportContext->ConnectSizeChangedHandler(viewportData.sizeChangedHandler); + viewportContext->ConnectDpiScalingFactorChangedHandler(viewportData.dpiScalingChangedHandler); ViewPtrStack& associatedViews = GetOrCreateViewStackForContext(contextName); viewportContext->SetDefaultView(associatedViews.back()); onSizeChanged(viewportContext->GetViewportSize()); @@ -176,6 +187,7 @@ namespace AZ UpdateViewForContext(newContextName); // Ensure anyone listening on per-name viewport size updates gets notified. ViewportContextNotificationBus::Event(newContextName, &ViewportContextNotificationBus::Events::OnViewportSizeChanged, viewportContext->GetViewportSize()); + ViewportContextNotificationBus::Event(newContextName, &ViewportContextNotificationBus::Events::OnViewportDpiScalingChanged, viewportContext->GetDpiScalingFactor()); } void ViewportContextManager::EnumerateViewportContexts(AZStd::function visitorFunction) diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp index fd41ff45a5..d2c4748670 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp @@ -105,10 +105,20 @@ namespace AZ // Let our ImguiAtomSystemComponent know once we successfully connect and update the viewport size. if (!m_initialized) { + auto atomViewportRequests = AZ::Interface::Get(); + auto defaultViewportContext = atomViewportRequests->GetDefaultViewportContext(); + OnViewportDpiScalingChanged(defaultViewportContext->GetDpiScalingFactor()); m_initialized = true; } }); -#endif +#endif //define(IMGUI_ENABLED) + } + + void ImguiAtomSystemComponent::OnViewportDpiScalingChanged(float dpiScale) + { +#if defined(IMGUI_ENABLED) + ImGui::ImGuiManagerBus::Broadcast(&ImGui::ImGuiManagerBus::Events::SetDpiScalingFactor, dpiScale); +#endif //define(IMGUI_ENABLED) } } } diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h index e487c9a39a..a0ff1a5dd9 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.h @@ -51,6 +51,7 @@ namespace AZ // ViewportContextNotificationBus overrides... void OnRenderTick() override; void OnViewportSizeChanged(AzFramework::WindowSize size) override; + void OnViewportDpiScalingChanged(float dpiScale) override; DebugConsole m_debugConsole; bool m_initialized = false; diff --git a/Gems/ImGui/Code/Include/ImGuiBus.h b/Gems/ImGui/Code/Include/ImGuiBus.h index cee9f3882d..ea7fe1631e 100644 --- a/Gems/ImGui/Code/Include/ImGuiBus.h +++ b/Gems/ImGui/Code/Include/ImGuiBus.h @@ -86,6 +86,8 @@ namespace ImGui virtual void SetImGuiRenderResolution(const ImVec2& res) = 0; virtual void OverrideRenderWindowSize(uint32_t width, uint32_t height) = 0; virtual void RestoreRenderWindowSizeToDefault() = 0; + virtual void SetDpiScalingFactor(float dpiScalingFactor) = 0; + virtual float GetDpiScalingFactor() const = 0; virtual void Render() = 0; }; diff --git a/Gems/ImGui/Code/Source/ImGuiManager.cpp b/Gems/ImGui/Code/Source/ImGuiManager.cpp index 7e936bb1f9..42c8d3929c 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.cpp +++ b/Gems/ImGui/Code/Source/ImGuiManager.cpp @@ -277,6 +277,20 @@ void ImGui::ImGuiManager::RestoreRenderWindowSizeToDefault() InitWindowSize(); } +void ImGui::ImGuiManager::SetDpiScalingFactor(float dpiScalingFactor) +{ + ImGuiIO& io = ImGui::GetIO(); + // Set the global font scale to size our UI to the scaling factor + // Note: Currently we use the default, 13px fixed-size IMGUI font, so this can get somewhat blurry + io.FontGlobalScale = dpiScalingFactor; +} + +float ImGui::ImGuiManager::GetDpiScalingFactor() const +{ + ImGuiIO& io = ImGui::GetIO(); + return io.FontGlobalScale; +} + void ImGuiManager::Render() { if (m_clientMenuBarState == DisplayState::Hidden && m_editorWindowState == DisplayState::Hidden) diff --git a/Gems/ImGui/Code/Source/ImGuiManager.h b/Gems/ImGui/Code/Source/ImGuiManager.h index 0df1b25b40..1509f27c57 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.h +++ b/Gems/ImGui/Code/Source/ImGuiManager.h @@ -57,6 +57,8 @@ namespace ImGui void SetImGuiRenderResolution(const ImVec2& res) override { m_renderResolution = res; } void OverrideRenderWindowSize(uint32_t width, uint32_t height) override; void RestoreRenderWindowSizeToDefault() override; + void SetDpiScalingFactor(float dpiScalingFactor) override; + float GetDpiScalingFactor() const override; void Render() override; // -- ImGuiManagerBus Interface ------------------------------------------------------------------- From 21dbe8b48fab1bc212363adff4edcd8c0668818c Mon Sep 17 00:00:00 2001 From: nvsickle Date: Tue, 22 Jun 2021 10:35:47 -0700 Subject: [PATCH 084/156] Address review feedback Signed-off-by: nvsickle --- .../AzFramework/AzFramework/Windowing/WindowBus.h | 2 +- .../AzFramework/Windowing/NativeWindow_Windows.cpp | 4 ++-- .../RPI/Code/Include/Atom/RPI.Public/ViewportContext.h | 10 +++++----- .../RPI/Code/Source/RPI.Public/ViewportContext.cpp | 1 - .../Code/Source/RPI.Public/ViewportContextManager.cpp | 4 ++-- .../Source/AtomViewportDisplayInfoSystemComponent.cpp | 2 +- .../Source/AtomViewportDisplayInfoSystemComponent.h | 2 ++ .../ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp | 5 +++-- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h index 8627e06ec8..f21993b80a 100644 --- a/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h +++ b/Code/Framework/AzFramework/AzFramework/Windowing/WindowBus.h @@ -69,7 +69,7 @@ namespace AzFramework //! Toggle the full screen state of the window. virtual void ToggleFullScreenState() = 0; - //! Returns a scalar multiplier representing how dots-per-inch this window has, compared + //! Returns a scalar multiplier representing how many dots-per-inch this window has, compared //! to a "standard" value of 96, the default for Windows in a DPI unaware setting. This can //! be used to scale user interface elements to ensure legibility on high density displays. virtual float GetDpiScaleFactor() const = 0; diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp index 6f9bf2cf1e..8d3a3e53f0 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp @@ -65,8 +65,7 @@ namespace AzFramework NativeWindowImpl_Win32::NativeWindowImpl_Win32() { // Attempt to load GetDpiForWindow from user32 at runtime, available on Windows 10+ versions >= 1607 - auto user32module = LoadLibraryA("user32.dll"); - if (user32module) + if (auto user32module = LoadLibraryA("user32.dll")) { m_getDpiFunction = reinterpret_cast(GetProcAddress(user32module, "GetDpiForWindow")); } @@ -255,6 +254,7 @@ namespace AzFramework { const float newScaleFactor = nativeWindowImpl->GetDpiScaleFactor(); WindowNotificationBus::Event(nativeWindowImpl->GetWindowHandle(), &WindowNotificationBus::Events::OnDpiScaleFactorChanged, newScaleFactor); + break; } default: return DefWindowProc(hWnd, message, wParam, lParam); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h index 3840b2b75c..92e50be75e 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h @@ -65,15 +65,15 @@ namespace AZ ConstViewPtr GetDefaultView() const; //! Gets the current size of the viewport. - //! This value is cached and updated on-demand, so may be performantly queried. + //! This value is cached and updated on-demand, so may be efficiently queried. AzFramework::WindowSize GetViewportSize() const; //! Gets the screen DPI scaling factor. - //! This value is cached and updated on-demand, so may be performantly queried. + //! This value is cached and updated on-demand, so may be efficiently queried. //! \see AzFramework::WindowRequests::GetDpiScaleFactor float GetDpiScalingFactor() const; - // SceneNotificationBus interface + // SceneNotificationBus interface overrides... //! Ensures our default view remains set when our scene's render pipelines are modified. void OnRenderPipelineAdded(RenderPipelinePtr pipeline) override; //! Ensures our default view remains set when our scene's render pipelines are modified. @@ -81,7 +81,7 @@ namespace AZ //! OnBeginPrepareRender is forwarded to our RenderTick notification to allow subscribers to do rendering. void OnBeginPrepareRender() override; - //WindowNotificationBus interface + // WindowNotificationBus interface overrides... //! Used to fire a notification when our window resizes. void OnWindowResized(uint32_t width, uint32_t height) override; //! Used to fire a notification when our window DPI changes. @@ -119,7 +119,7 @@ namespace AZ //! Notifies consumers when this ViewportContext is about to be destroyed. void ConnectAboutToBeDestroyedHandler(ViewportIdEvent::Handler& handler); - // ViewportRequestBus interface + // ViewportRequestBus interface overrides... //! Gets the current camera's view matrix. const AZ::Matrix4x4& GetCameraViewMatrix() const override; //! Sets the current camera's view matrix. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp index a37d9f3c00..eacdbe0293 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp @@ -10,7 +10,6 @@ #include #include #include -#include "..\..\Include\Atom\RPI.Public\ViewportContext.h" namespace AZ { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp index ebf45f36f7..2d9e1c586a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp @@ -55,7 +55,7 @@ namespace AZ auto onSizeChanged = [this, viewportId](AzFramework::WindowSize size) { // Ensure we emit OnViewportSizeChanged with the correct name. - auto viewportContext = this->GetViewportContextById(viewportId); + auto viewportContext = GetViewportContextById(viewportId); if (viewportContext) { ViewportContextNotificationBus::Event(viewportContext->GetName(), &ViewportContextNotificationBus::Events::OnViewportSizeChanged, size); @@ -65,7 +65,7 @@ namespace AZ auto onDpiScalingChanged = [this, viewportId](float dpiScalingFactor) { // Ensure we emit OnViewportDpiScalingChanged with the correct name. - auto viewportContext = this->GetViewportContextById(viewportId); + auto viewportContext = GetViewportContextById(viewportId); if (viewportContext) { ViewportContextNotificationBus::Event(viewportContext->GetName(), &ViewportContextNotificationBus::Events::OnViewportDpiScalingChanged, dpiScalingFactor); diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 2a618518f0..9fba4b9c09 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -157,7 +157,7 @@ namespace AZ::Render auto viewportSize = viewportContext->GetViewportSize(); m_drawParams.m_position = AZ::Vector3(viewportSize.m_width, 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding); m_drawParams.m_color = AZ::Colors::White; - m_drawParams.m_scale = AZ::Vector2(0.7f * viewportContext->GetDpiScalingFactor()); + m_drawParams.m_scale = AZ::Vector2(BaseFontSize * viewportContext->GetDpiScalingFactor()); m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right; m_drawParams.m_monospace = false; m_drawParams.m_depthTest = false; diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.h b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.h index 13f42dd638..cec6cd958c 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.h +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.h @@ -60,6 +60,8 @@ namespace AZ void DrawPassInfo(); void DrawFramerate(); + static constexpr float BaseFontSize = 0.7f; + AZStd::string m_rendererDescription; AzFramework::TextDrawParameters m_drawParams; AzFramework::FontDrawInterface* m_fontDrawInterface = nullptr; diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp index d2c4748670..843f30fced 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp @@ -50,7 +50,8 @@ namespace AZ { ImGui::OtherActiveImGuiRequestBus::Handler::BusConnect(); - auto atomViewportRequests = AZ::Interface::Get(); + auto atomViewportRequests = AZ::RPI::ViewportContextRequests::Get(); + AZ_Assert(atomViewportRequests, "AtomViewportContextRequests interface not found!"); const AZ::Name contextName = atomViewportRequests->GetDefaultViewportContextName(); AZ::RPI::ViewportContextNotificationBus::Handler::BusConnect(contextName); @@ -105,7 +106,7 @@ namespace AZ // Let our ImguiAtomSystemComponent know once we successfully connect and update the viewport size. if (!m_initialized) { - auto atomViewportRequests = AZ::Interface::Get(); + auto atomViewportRequests = AZ::RPI::ViewportContextRequests::Get(); auto defaultViewportContext = atomViewportRequests->GetDefaultViewportContext(); OnViewportDpiScalingChanged(defaultViewportContext->GetDpiScalingFactor()); m_initialized = true; From 2fefa809376d57539c511761707cff41f8d2a570 Mon Sep 17 00:00:00 2001 From: nvsickle Date: Tue, 22 Jun 2021 11:41:25 -0700 Subject: [PATCH 085/156] Use AZ::DynamicModuleHandle Signed-off-by: nvsickle --- .../Windows/AzFramework/Windowing/NativeWindow_Windows.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp index 8d3a3e53f0..470594853c 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp @@ -8,6 +8,7 @@ #include #include +#include #include namespace AzFramework @@ -65,9 +66,9 @@ namespace AzFramework NativeWindowImpl_Win32::NativeWindowImpl_Win32() { // Attempt to load GetDpiForWindow from user32 at runtime, available on Windows 10+ versions >= 1607 - if (auto user32module = LoadLibraryA("user32.dll")) + if (auto user32module = AZ::DynamicModuleHandle::Create("user32"); user32module->Load(false)) { - m_getDpiFunction = reinterpret_cast(GetProcAddress(user32module, "GetDpiForWindow")); + m_getDpiFunction = user32module->GetFunction("GetDpiForWindow"); } } From 0b3dab1cf845c6f1ffb2a0f93650d4f072a145ea Mon Sep 17 00:00:00 2001 From: nvsickle Date: Mon, 28 Jun 2021 10:56:14 -0700 Subject: [PATCH 086/156] Use DPI scaling for viewport info padding Signed-off-by: nvsickle --- .../Code/Source/AtomViewportDisplayInfoSystemComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 9fba4b9c09..af9fd7fdd8 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -155,7 +155,7 @@ namespace AZ::Render m_drawParams.m_drawViewportId = viewportContext->GetId(); auto viewportSize = viewportContext->GetViewportSize(); - m_drawParams.m_position = AZ::Vector3(viewportSize.m_width, 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding); + m_drawParams.m_position = AZ::Vector3(viewportSize.m_width, 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding) * viewportContext->GetDpiScalingFactor(); m_drawParams.m_color = AZ::Colors::White; m_drawParams.m_scale = AZ::Vector2(BaseFontSize * viewportContext->GetDpiScalingFactor()); m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right; From 3ee15f1912f02e04205b6fd19c7f2b5b020a781d Mon Sep 17 00:00:00 2001 From: nvsickle Date: Wed, 7 Jul 2021 10:21:21 -0700 Subject: [PATCH 087/156] Try to get some actual log output out of this Signed-off-by: nvsickle --- Tools/LyTestTools/ly_test_tools/log/log_monitor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py index a2556fa41d..90e0a2280c 100755 --- a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py +++ b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py @@ -133,12 +133,12 @@ class LogMonitor(object): except AssertionError: # Raised by waiter when timeout is reached. logger.warning(f"Timeout of '{timeout}' seconds was reached, log lines may not have been found") # exception will be raised below by _validate_results with failure analysis - - logger.info("Python log output:\n" + self.py_log) - logger.info( - "Finished log monitoring for '{}' seconds, validating results.\n" - "expected_lines_not_found: {}\n unexpected_lines_found: {}".format( - timeout, self.expected_lines_not_found, self.unexpected_lines_found)) + finally: + logger.info("Python log output:\n" + self.py_log) + logger.info( + "Finished log monitoring for '{}' seconds, validating results.\n" + "expected_lines_not_found: {}\n unexpected_lines_found: {}".format( + timeout, self.expected_lines_not_found, self.unexpected_lines_found)) return self._validate_results(self.expected_lines_not_found, self.unexpected_lines_found, expected_lines, unexpected_lines) From 3549e5b946035aac91df705150191a28954af44a Mon Sep 17 00:00:00 2001 From: nvsickle Date: Wed, 7 Jul 2021 10:47:44 -0700 Subject: [PATCH 088/156] More fussing with logs Signed-off-by: nvsickle --- Tools/LyTestTools/ly_test_tools/log/log_monitor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py index 90e0a2280c..f4266aaace 100755 --- a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py +++ b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py @@ -265,12 +265,21 @@ class LogMonitor(object): self.unexpected_lines_found = unexpected_lines_found self.expected_lines_not_found = expected_lines_not_found + exception_info = None + # To avoid race conditions, we will check *before reading* # If in the mean time the file is closed, we will make sure we read everything by issuing an extra call # by returning the previous alive state process_runing = self.launcher.is_alive() for line in log: line = line[:-1] # remove /n - process_line(line) + try: + process_line(line) + except LogMonitorException as e: + if exception_info is not None: + exception_info = e.args + + if exception_info is not None: + raise LogMonitorException(*exception_info) return not process_runing # Will loop until the process ends From dee591921efd5eb424a116d2cbad7f4b2676d2fa Mon Sep 17 00:00:00 2001 From: nvsickle Date: Wed, 7 Jul 2021 11:47:37 -0700 Subject: [PATCH 089/156] Fix exception bubble-up Signed-off-by: nvsickle --- Tools/LyTestTools/ly_test_tools/log/log_monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py index f4266aaace..54d71b62c0 100755 --- a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py +++ b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py @@ -276,7 +276,7 @@ class LogMonitor(object): try: process_line(line) except LogMonitorException as e: - if exception_info is not None: + if exception_info is None: exception_info = e.args if exception_info is not None: From ca4156e1c005b69d49b83dac1565412e822444a2 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 7 Jul 2021 14:02:46 -0500 Subject: [PATCH 090/156] Fixed template.json file name replacements. Signed-off-by: Chris Galvan --- Templates/DefaultProject/template.json | 8 ++++---- Templates/MinimalProject/template.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index 5eaf66e3af..37409a11b4 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -271,8 +271,8 @@ "isOptional": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png", + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", + "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", "isTemplated": false, "isOptional": false }, @@ -295,8 +295,8 @@ "isOptional": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png", + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", + "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", "isTemplated": false, "isOptional": false }, diff --git a/Templates/MinimalProject/template.json b/Templates/MinimalProject/template.json index a244904578..9d9ef730c1 100644 --- a/Templates/MinimalProject/template.json +++ b/Templates/MinimalProject/template.json @@ -269,8 +269,8 @@ "isOptional": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png", + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", + "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", "isTemplated": false, "isOptional": false }, @@ -293,8 +293,8 @@ "isOptional": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png", + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", + "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", "isTemplated": false, "isOptional": false }, From 14cab097c772cfd6008386ef4b08074a6f632c56 Mon Sep 17 00:00:00 2001 From: nvsickle Date: Wed, 7 Jul 2021 13:19:51 -0700 Subject: [PATCH 091/156] Fix DPI change callback not being wired up correctly. Signed-off-by: nvsickle --- Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp index 2d9e1c586a..606b5e5b8c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContextManager.cpp @@ -74,6 +74,7 @@ namespace AZ }; viewportContext->m_name = contextName; viewportData.sizeChangedHandler = ViewportContext::SizeChangedEvent::Handler(onSizeChanged); + viewportData.dpiScalingChangedHandler = ViewportContext::ScalarChangedEvent::Handler(onDpiScalingChanged); viewportContext->ConnectSizeChangedHandler(viewportData.sizeChangedHandler); viewportContext->ConnectDpiScalingFactorChangedHandler(viewportData.dpiScalingChangedHandler); ViewPtrStack& associatedViews = GetOrCreateViewStackForContext(contextName); From 4c12e9c5abbbba52f99ea49c431e7390c2d08776 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 7 Jul 2021 15:37:49 -0500 Subject: [PATCH 092/156] Refactoring the LTC quad and polygon lights (#1881) * Refactoring the LTC quad and polygon lights to clip the light to the normal hemisphere before applying the LTC matrix. This prevents specular light leaking from behind the surface. Diffuse and specular contribution are now calculated at the same time to avoid clipping the polygon twice. Added a cheaper diffuse integration function that's accurate enough for diffuse. Also added a commented out alternate specular integration for platforms with poor acos() accuracy. Signed-off-by: Ken Pruiksma * PR review feedback - typo and some saturate() protection Signed-off-by: Ken Pruiksma * Making branch more explicit from review feedback. Signed-off-by: Ken Pruiksma --- .../Atom/Features/PBR/Lights/Ltc.azsli | 249 ++++++++++++++---- .../Features/PBR/Lights/PolygonLight.azsli | 17 +- .../Atom/Features/PBR/Lights/QuadLight.azsli | 14 +- 3 files changed, 207 insertions(+), 73 deletions(-) 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 292f8a8a22..8042758db8 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 @@ -80,14 +80,48 @@ float3x3 BuildViewAlignedOrthonormalBasis(in float3 normal, in float3 dirToView) // xy plane in positive z space. float IntegrateEdge(float3 v1, float3 v2) { + // This alternate version may work better for platforms where acos() precision is low. + /* + float x = dot(v1, v2); + float y = abs(x); + + float a = 5.42031 + (3.12829 + 0.0902326 * y) * y; + float b = 3.45068 + (4.18814 + y) * y; + float theta_sinTheta = a / b; + + if (x < 0.0) + { + theta_sinTheta = PI * rsqrt(saturate(1.0 - x * x)) - theta_sinTheta; + } + + float3 u = cross(v1, v2); + return theta_sinTheta * u.z; + */ + float cosTheta = dot(v1, v2); - cosTheta = clamp(cosTheta, -0.9999, 0.9999); + float theta = acos(cosTheta); // calculate 1.0 / sin(theta) - float invSinTheta = rsqrt(1.0 - cosTheta * cosTheta); + float invSinTheta = rsqrt(saturate(1.0 - cosTheta * cosTheta)); - float theta = acos(cosTheta); - return cross(v1, v2).z * theta * invSinTheta; + return cross(v1, v2).z * ((theta > 0.001) ? theta * invSinTheta : 1.0); +} + +// Cheaper version of above which is good enough for diffuse +float IntegrateEdgeDiffuse(float3 v1, float3 v2) +{ + float cosTheta = dot(v1, v2); + float theta_sinTheta = 0.0; + if (cosTheta > 0.0) + { + float absCosTheta = abs(cosTheta); + theta_sinTheta = 1.5708 + (-0.879406 + 0.308609 * absCosTheta) * absCosTheta; + } + else + { + theta_sinTheta = PI * rsqrt(1.0 - cosTheta * cosTheta) - theta_sinTheta; + } + return theta_sinTheta * cross(v1, v2).z; } // Returns the unnormalized z plane intersection point between pointAboveHorizon and pointBelowHorizon. @@ -189,42 +223,90 @@ void ClipQuadToHorizon(inout float3 p[5], out int vertexCount) } } -// Takes 4 points (p) from a quad plus a 5th dummy point, rotates them into the space of the normal, then transforms -// the points by the LTC matrix provided. The points are then clipped to the normal's hemisphere. The number of points -// after the clip is returned in vertexCount. It's possible for the resulting clipped quad to be a triangle (when 3 -// points are below the horizon), or a pentagon (when one point is below the horizon), or be a regular 4 point quad. -void LtcClipAndNormalizeQuad(in float3 normal, in float3 dirToView, float3x3 ltcMat, inout float3 p[5], out int vertexCount) +// Applies the LTC matrix to the clipped points of a quad. +void ApplyLtcMatrixToQuad(in float3x3 ltcMat, inout float3 p[5], in int vertexCount) { - // Rotate ltc matrix - ltcMat = mul(ltcMat, BuildViewAlignedOrthonormalBasis(normal, dirToView)); - // Transform points into ltc space - p[0] = mul(ltcMat, p[0].xyz); - p[1] = mul(ltcMat, p[1].xyz); - p[2] = mul(ltcMat, p[2].xyz); - p[3] = mul(ltcMat, p[3].xyz); + p[0] = mul(ltcMat, p[0]); + p[1] = mul(ltcMat, p[1]); + p[2] = mul(ltcMat, p[2]); - ClipQuadToHorizon(p, vertexCount); - - // visibility check - if (vertexCount == 0) + if (vertexCount > 3) { - return; + p[3] = mul(ltcMat, p[3]); } + if (vertexCount > 4) + { + p[4] = mul(ltcMat, p[4]); + } +} - // project onto sphere +// Projects the clipped points of a quad onto the sphere. +void NormalizeQuadPoints(inout float3 p[5], in int vertexCount) +{ + // project quad points onto a sphere. p[0] = normalize(p[0]); p[1] = normalize(p[1]); p[2] = normalize(p[2]); - p[3] = normalize(p[3]); - p[4] = normalize(p[4]); + + if (vertexCount > 3) + { + p[3] = normalize(p[3]); + } + if (vertexCount > 4) + { + p[4] = normalize(p[4]); + } +} + +// Transforms the 4 points of a quad into the hemisphere of the normal +void TransformQuadToOrthonormalBasis(in float3 normal, in float3 dirToView, inout float3 p[4]) +{ + float3x3 orthoNormalBasis = BuildViewAlignedOrthonormalBasis(normal, dirToView); + + // Transform points into orthonormal space + p[0] = mul(orthoNormalBasis, p[0]); + p[1] = mul(orthoNormalBasis, p[1]); + p[2] = mul(orthoNormalBasis, p[2]); + p[3] = mul(orthoNormalBasis, p[3]); } -float IntegrateQuad(in float3 v[5], in float vertexCount, in bool doubleSided) +// Integrates the edges of a quad for lambertian diffuse contribution. +float IntegrateQuadDiffuse(in float3 v[5], in float vertexCount, in bool doubleSided) { - // Integrate float sum = 0.0; + NormalizeQuadPoints(v, vertexCount); + + // There must be at least 3 points so don't check for the first 2 edges. + sum += IntegrateEdgeDiffuse(v[0], v[1]); + sum += IntegrateEdgeDiffuse(v[1], v[2]); + + if (vertexCount > 3) + { + sum += IntegrateEdgeDiffuse(v[2], v[3]); + if (vertexCount == 5) + { + sum += IntegrateEdgeDiffuse(v[3], v[4]); + } + } + + // Close the polygon + sum += IntegrateEdgeDiffuse(v[vertexCount - 1], v[0]); + + // Note: negated due to winding order + sum = doubleSided ? abs(sum) : max(0.0, -sum); + + return sum; +} + +// Integrates the edges of a quad for specular contribution. +float IntegrateQuadSpecular(in float3 v[5], in float vertexCount, in bool doubleSided) +{ + float sum = 0.0; + + NormalizeQuadPoints(v, vertexCount); + // There must be at least 3 points so don't check for the first 2 edges. sum += IntegrateEdge(v[0], v[1]); sum += IntegrateEdge(v[1], v[2]); @@ -247,26 +329,62 @@ float IntegrateQuad(in float3 v[5], in float vertexCount, in bool doubleSided) return sum; } -float LtcQuadEvaluate(in float3 normal, in float3 dirToView, in float3x3 ltcMat, in float3 p[4], in bool doubleSided) +// Evaluate linear transform cosine lighting for a 4 point quad. +// normal - The surface normal +// dirToView - Normalized direction from the surface to the view +// ltcMat - The LTC matrix for specular, or identity for diffuse. +// p[4] - The 4 light positions relative to the surface position. +// doubleSided - If the quad emits light from both sides +// diffuse - The output diffuse response for the quad light +// specular - The output specular response for the quad light +void LtcQuadEvaluate( + in float3 normal, + in float3 dirToView, + in float3x3 ltcMat, + in float3 p[4], + in bool doubleSided, + out float diffuse, + out float specular) { + // Transform the points of the light into the space of the normal's hemisphere. + TransformQuadToOrthonormalBasis(normal, dirToView, p); + // Initialize quad with dummy point at end in case one corner is clipped (resulting in 5 sided polygon) float3 v[5] = {p[0], p[1], p[2], p[3], float3(0.0, 0.0, 0.0)}; + // Clip the light polygon to the normal hemisphere. This is done before the LTC matrix is applied to prevent + // parts of the light below the horizon from impacting the surface. The number of points remaining after + // the clip is returned in vertexCount. It's possible for the vertexCount of the resulting clipped quad to be + // 0 - all points clipped (no work to do, so return) + // 3 - 3 points clipped, leaving only a triangular corner of the quad + // 4 - 2 or 0 points clipped, leaving a quad + // 5 - 1 point clipped leaving a pentagon. + int vertexCount = 0; - LtcClipAndNormalizeQuad(normal, dirToView, ltcMat, v, vertexCount); + ClipQuadToHorizon(v, vertexCount); - if (vertexCount > 0) + if (vertexCount == 0) { - return IntegrateQuad(v, vertexCount, doubleSided); + // Entire light is below the horizon. + return; } - return 0.0; + + // IntegrateQuadDiffuse is a cheap approximation compared to specular. + diffuse = IntegrateQuadDiffuse(v, vertexCount, doubleSided); + + ApplyLtcMatrixToQuad(ltcMat, v, vertexCount); + + // IntegrateQuadSpecular uses more accurate integration to handle smooth surfaces correctly. + specular = IntegrateQuadSpecular(v, vertexCount, doubleSided); } // Checks an edge against the horizon and integrates it. -// p0 - first point -// p1 - second point -// prevClipPoint - the clip point saved from the last time an edge went from above to below the horizon -// sum - the sum total of all integrations to contribute to. +// p0 - First point +// p1 - Second point +// prevClipPoint - The clip point saved from the last time an edge went from above to below the horizon +// ltcMat - The ltc lookup matrix for specular +// diffuse - The current sum total of diffuse contribution to apply additional contribution to +// specular - The current sum total of specular contribution to apply additional contribution to // // Explanation: // When evaluating edges of a polygon there are four possible states to deal with @@ -283,28 +401,34 @@ float LtcQuadEvaluate(in float3 normal, in float3 dirToView, in float3x3 ltcMat, // 4. Both points are below the horizon // - Do nothing. -void EvaluatePolyEdge(in float3 p0, in float3 p1, inout float3 prevClipPoint, inout float sum) +void EvaluatePolyEdge(in float3 p0, in float3 p1, inout float3 prevClipPoint, in float3x3 ltcMat, inout float diffuse, inout float specular) { if (p0.z > 0.0) { if (p1.z > 0.0) { // Both above horizon - sum += IntegrateEdge(normalize(p0), normalize(p1)); + diffuse += IntegrateEdgeDiffuse(normalize(p0), normalize(p1)); + specular += IntegrateEdge(normalize(mul(ltcMat, p0)), normalize(mul(ltcMat, p1))); } else { // Going from above to below horizon - prevClipPoint = normalize(ClipEdge(p0, p1)); - sum += IntegrateEdge(normalize(p0), prevClipPoint); + prevClipPoint = ClipEdge(p0, p1); + diffuse += IntegrateEdgeDiffuse(normalize(p0), normalize(prevClipPoint)); + specular += IntegrateEdge(normalize(mul(ltcMat, p0)), normalize(mul(ltcMat, prevClipPoint))); } } else if (p1.z > 0.0) { // Going from below to above horizon - float3 clipPoint = normalize(ClipEdge(p1, p0)); - sum += IntegrateEdge(prevClipPoint, clipPoint); - sum += IntegrateEdge(clipPoint, normalize(p1)); + float3 clipPoint = ClipEdge(p1, p0); + diffuse += IntegrateEdgeDiffuse(normalize(prevClipPoint), normalize(clipPoint)); + diffuse += IntegrateEdgeDiffuse(normalize(clipPoint), normalize(p1)); + + clipPoint = mul(ltcMat, clipPoint); + specular += IntegrateEdge(normalize(mul(ltcMat, prevClipPoint)), normalize(clipPoint)); + specular += IntegrateEdge(normalize(clipPoint), normalize(mul(ltcMat, p1))); } } @@ -316,26 +440,38 @@ void EvaluatePolyEdge(in float3 p0, in float3 p1, inout float3 prevClipPoint, in // positions - The buffer where the polygon positions are // startIdx - The index of the first polygon position // endIdx - The index of the point directly after the last polygon position -// +// diffuse - The output diffuse response for the polygon light +// specular - The output specular response for the polygon light // The most complicated aspect of this function is clipping the polygon against the horizon of the surface point. See // EvaluatePolyEdge() above for details on the general concept. However, this function must deal with the case of the // first point being below the horizon. In that case, it needs to search in reverse from the end for the first point // above the horizon, and save the intersection point between the above and below points so it can be used in // EvaluatePolyEdge() later. During this search it also adjusts the end point index as necessary to avoid processing // those points that are below the horizon. -float LtcPolygonEvaluate(in float3 pos, in float3 normal, in float3 dirToView, in float3x3 ltcMat, in StructuredBuffer positions, in uint startIdx, in uint endIdx) +void LtcPolygonEvaluate( + in float3 pos, + in float3 normal, + in float3 dirToView, + in float3x3 ltcMat, + in StructuredBuffer positions, + in uint startIdx, + in uint endIdx, + out float diffuse, + out float specular +) { if (endIdx - startIdx < 3) { - return 0.0; // Must have at least 3 points to form a polygon. + return; // Must have at least 3 points to form a polygon. } // Rotate ltc matrix - ltcMat = mul(ltcMat, BuildViewAlignedOrthonormalBasis(normal, dirToView)); + float3x3 orthonormalMat = BuildViewAlignedOrthonormalBasis(normal, dirToView); // Prepare initial values - float sum = 0.0; // sum of edge integation - float3 p0 = mul(ltcMat, positions[startIdx].xyz - pos); // First point in polygon + float3 p0 = mul(orthonormalMat, positions[startIdx].xyz - pos); // First point in polygon + diffuse = 0.0; + specular = 0.0; float3 prevClipPoint = float3(0.0, 0.0, 0.0); // Used to hold previous clip point when polygon dips below horizon. float3 closePoint = p0; @@ -349,10 +485,10 @@ float LtcPolygonEvaluate(in float3 pos, in float3 normal, in float3 dirToView, i // searching backwards, updating the endIdx along the way to avoid reprocessing those points later for ( ; endIdx > startIdx + 1; --endIdx) { - float3 prevPoint = mul(ltcMat, positions[endIdx - 1].xyz - pos); - if (prevPoint.z > 0) + float3 prevPoint = mul(orthonormalMat, positions[endIdx - 1].xyz - pos); + if (prevPoint.z > 0.0) { - prevClipPoint = normalize(ClipEdge(prevPoint, p0)); + prevClipPoint = ClipEdge(prevPoint, p0); closePoint = prevClipPoint; break; } @@ -362,7 +498,7 @@ float LtcPolygonEvaluate(in float3 pos, in float3 normal, in float3 dirToView, i // Check if all points below horizon if (endIdx == startIdx + 1) { - return 0.0; + return; } p0 = firstPoint; // Restore the original p0 @@ -371,13 +507,14 @@ float LtcPolygonEvaluate(in float3 pos, in float3 normal, in float3 dirToView, i // Evaluate all the points for (uint curIdx = startIdx + 1; curIdx < endIdx; ++curIdx) { - float3 p1 = mul(ltcMat, positions[curIdx].xyz - pos); // Current point in polygon - EvaluatePolyEdge(p0, p1, prevClipPoint, sum); + float3 p1 = mul(orthonormalMat, positions[curIdx].xyz - pos); // Current point in polygon + EvaluatePolyEdge(p0, p1, prevClipPoint, ltcMat, diffuse, specular); p0 = p1; } - EvaluatePolyEdge(p0, closePoint, prevClipPoint, sum); + EvaluatePolyEdge(p0, closePoint, prevClipPoint, ltcMat, diffuse, specular); // Note: negated due to winding order - return -sum; + diffuse = -diffuse; + specular = -specular; } 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 bbd3c1c9e3..d7313556a2 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 @@ -50,26 +50,25 @@ void ApplyPoylgonLight(ViewSrg::PolygonLight light, Surface surface, inout Light float radiusAttenuation = 1.0 - (falloff * falloff); radiusAttenuation = radiusAttenuation * radiusAttenuation; - // Diffuse - static const float3x3 identityMatrix = float3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); - float diffuse = LtcPolygonEvaluate(surface.position, surface.normal, lightingData.dirToCamera, identityMatrix, ViewSrg::m_polygonLightPoints, startIndex, endIndex); - diffuse = doubleSided ? abs(diffuse) : max(0.0, diffuse); - - // Specular float2 ltcCoords = LtcCoords(dot(surface.normal, lightingData.dirToCamera), surface.roughnessLinear); float3x3 ltcMat = LtcMatrix(SceneSrg::m_ltcMatrix, ltcCoords); - float3 specular = LtcPolygonEvaluate(surface.position, surface.normal, lightingData.dirToCamera, ltcMat, ViewSrg::m_polygonLightPoints, startIndex, endIndex); + + float diffuse = 0.0; + float specular = 0.0; + + LtcPolygonEvaluate(surface.position, surface.normal, lightingData.dirToCamera, ltcMat, ViewSrg::m_polygonLightPoints, startIndex, endIndex, diffuse, specular); + diffuse = doubleSided ? abs(diffuse) : max(0.0, diffuse); specular = doubleSided ? abs(specular) : max(0.0, specular); // Apply BRDF scale terms (BRDF magnitude and Schlick Fresnel) float2 schlick = SceneSrg::m_ltcAmplification.Sample(PassSrg::LinearSampler, ltcCoords).xy; - specular *= schlick.x + (1.0 - surface.specularF0) * schlick.y; + float3 specularRGB = specular * (schlick.x + (1.0 - surface.specularF0) * schlick.y); // Scale by inverse surface area of hemisphere (1/2pi), attenuation, and light intensity float3 intensity = 0.5 * INV_PI * radiusAttenuation * abs(light.m_rgbIntensityNits); lightingData.diffuseLighting += surface.albedo * diffuse * intensity; - lightingData.specularLighting += surface.specularF0 * specular * intensity; + lightingData.specularLighting += surface.specularF0 * specularRGB * intensity; } void ApplyPolygonLights(Surface surface, inout LightingData lightingData) 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 91981e4f4d..29ee97fd6f 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 @@ -111,24 +111,22 @@ void ApplyQuadLight(ViewSrg::QuadLight light, Surface surface, inout LightingDat { float3 p[4] = {p0, p1, p2, p3}; - // Diffuse - float3x3 identityMatrix = float3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); - float diffuse = LtcQuadEvaluate(surface.normal, lightingData.dirToCamera, identityMatrix, p, doubleSided); - - // Specular float2 ltcCoords = LtcCoords(dot(surface.normal, lightingData.dirToCamera), surface.roughnessLinear); float3x3 ltcMat = LtcMatrix(SceneSrg::m_ltcMatrix, ltcCoords); - float3 specular = LtcQuadEvaluate(surface.normal, lightingData.dirToCamera, ltcMat, p, doubleSided); + + float diffuse = 0.0; + float specular = 0.0; + LtcQuadEvaluate(surface.normal, lightingData.dirToCamera, ltcMat, p, doubleSided, diffuse, specular); // Apply BRDF scale terms (BRDF magnitude and Schlick Fresnel) float2 schlick = SceneSrg::m_ltcAmplification.Sample(PassSrg::LinearSampler, ltcCoords).xy; - specular *= schlick.x + (1.0 - surface.specularF0) * schlick.y; + float3 specularRGB = specular * (schlick.x + (1.0 - surface.specularF0) * schlick.y); // Scale by inverse surface area of hemisphere (1/2pi), attenuation, and light intensity float3 intensity = 0.5 * INV_PI * radiusAttenuation * light.m_rgbIntensityNits; lightingData.diffuseLighting += surface.albedo * diffuse * intensity; - lightingData.specularLighting += surface.specularF0 * specular * intensity; + lightingData.specularLighting += surface.specularF0 * specularRGB * intensity; } else { From 2dce2eee2d3c7ad3a070a774656e90cfe87f3994 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 7 Jul 2021 13:42:22 -0700 Subject: [PATCH 093/156] The Great ScriptCanvas Purge, Part X Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/RuntimeAssetSystemComponent.cpp | 2 +- .../Libraries/String/.vs/ProjectSettings.json | 3 --- .../String/.vs/String/v16/Browse.VC.db | Bin 294912 -> 0 bytes .../Libraries/String/.vs/VSWorkspaceState.json | 6 ------ .../Libraries/String/.vs/slnx.sqlite | Bin 90112 -> 0 bytes 5 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite diff --git a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp index 38995f8dca..0b12d38870 100644 --- a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp @@ -2,7 +2,7 @@ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT - *s + * */ #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json deleted file mode 100644 index 0cf5ea5033..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/ProjectSettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "CurrentProjectSetting": "No Configurations" -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/String/v16/Browse.VC.db deleted file mode 100644 index 0bd6c3064248f7d9a078ec2376c1505aa698394f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294912 zcmeFa2S8L;+CF~owA=5c2%{o8fCwWURIDL1l_;oyF(z)v2qR2{fy@k+Bqm~dZ<}W7 zruW`^*_6#@lT9{#({?w#_rA&hJ@2{GLGb@`^L=0Tka(W=p8B5Wo^sE7&pp$&VyQ3W zb*<|U^m#(ADlUbySh(F?E{@{___rATh5sr+u!S!G`51X5QQ%5vxa<&WF}@*jDvTeE zZ?snRX63KyHYKEt7hB}_g%5@8!W72@`z7`XwgW6L+ZI}mu~Zn}jg%?#{~u&vPp89K z;pBrpf0uWYZ&SxQU#~aV(d+fB>+pN}ym&djzO}Koz0uXw($Kh;&DS&IuJ7Dm#! zTQVKa0w>>x`3@dn<{Qb*F^AO`tjPNt^(Q59Li4@ocrYSL#x7fdLYoh zzqd2g5%8`Hc69dp*ZI0Td|hxE?C;&+?ZRdi8)w`IO(8bUNcoUP5*yD|7%8wgu0Z#Y zm?k)zLC+%86B==By4VXOG&V3jvH8aaCZ$YNsW2usX6+893eFnP#28kSNCjfj1=Dt@ zLL^C2*^v`d>J5t`-*sYq4KAXntJ`?`v809&RzoJCnYj7fB$4d)S4oRN5!W8=hRUWgfb zG>5Y~i$63m!!UWiE;G44Qnt~Uv6)AG-A9a91ZP$jf2@Fw#>~$IHLj_co?{t$&8RRa z#1Fnbo?uU6%ZlFV9gpZR%!RX!>L1(UOy3ck9HBIR6ouKKzrPp8{0?8x>koQCU#~yp zTjzs8m<+eYE>O6mufJ;$W=xnl{F`H^n_`!DQ)lmBm$zfU6B?#kRND@pe+-e<1wgrt z{ekski{3vF^7Z?J!%*4l36UqmQL-5bM;mLokpv@_YzA~d>11B;2E6`GZ?b~1Z0tC$ zyF_)6o;<=76>bX^rl9RDJDeriJlrDaeej$SZVs`7eNY*pyT?T)T_x;MNakMm-qHwp zlQtEODvy>oHo(}tv6By#34${_o8MLuJ8TETxr%XpFzh>)P8g1x)C-5}2+5Ba#jaqF zC*Xw#kA!ybE)yNj`s|TzOr+R~up|vlatO}0B7SI5_~vx>L$`rvj=qld;1$FX8M+ZX zf6=F%gm7U5Y7?R*WkUzOxT0J*v=+yd<=$qq3(le<{;(Qz42(;VP=+J!ek26a+miSk z7dv;tb7?}FG2NaRb>oMy*t~IsjMF`q(zu}#nND~l94fTpRIsgpHbfeSmK?OjRonE0 z>W)b51B?O20AqkLz!+c*Fa{U{ zJHhb;B24R``zPFT|h@ACZJYf3jn#0?d**3d)AkBt#w+h?g^c}KBDIaZy*R}+=^MHvrEfUE!M28s84x$MKzahSo1T2o^@WR zQU@3U{Gq_0S2jN51mh6Sc*Z!zIK;Tsc-*+ecx$JKW|0{Ki~+^~V}LQh7+?%A1{ed3 z0mcAhfHA-r*dYUHRyQAGkpSC+p5O(B3oXT(&&RIY4H_rbJYg5D89XsO*f1>4B4Aal zS-fcruz)%#v3ZgA|8`>{2dn-~#$scl@$3#2W`T?W#sFi0F~AsL3@`>51B?O20AqkL zz!>B~o8gmzE)RS!+%?^5Yfeu$K(T}9T|Ua6f3UZg{F9AWVf~-S8F|L-#;ITd==+V`Mphlh0AqkLz!+c*Fa{U{ zi~+^~V}LQh7+?&Hje)7wW`2~_bh(2>8qHQUX+*n#H73%C1_AP}f9hz8 zllT8MHi0vqH?D;J|LsP;{-u7OeyYA!uhQ+>Q`#xoa?Ma*R4-RIsr9O^ysq4!Y*X5l zEcpxhkMikqw>)3grB|h^rA^X8DMNfqyhYq5t`PHt&xHqtQ-uA5D#7A-(Q%dIP)Do7 zW&hNEkNpUHyM3zdE8By%<8AxdW1 zW?$a`oToBs+yx{qJ@jg{xK;CQTv2o1x=uLMhHh>G$qFQHvXRjw197`GHGi+QwBrrFdd4lUlyCFqYq$vg0`vwNQU86;ISK2sd zbFdRWM;k3_Q3Y+HsL5!N-Q^_TUe8+Zs4SM15lRN(K-2CHPp{7t94+snQldy`GgQyJ zZnVf{B_#KO{y~3Nhu05he2$i&w3swDGePed;upon4~|M>`E+taY5u--aJt#38Wp>3 zTy`YIX!@5GMl0-FH-_xX3!(}Q1U%h+p3#aZoffTfug^bfmCN#@DtQBe{=jGjlueB$ zz=kneg7Um*9mX~;R^*btYu*O>8R%$*l;seu`aGS1{tjqPqu;o47tx9)faqgjs(1>y z)m`3RZ?`8jDzEOzq?36!z?Y<>>0X?TZHS&fwRyDIC6jF26c`UZz5V1U*wLaFXOYbN zJOg+J+-R{2Cfc}k5_`0WvnJTMiss0Px*eWC_aONqc(imSbfZNtb`tG3z$d@t zoZ?YqXOh_K2K}An%*N4Tmu8TjLdUi)Z|A6EVbwS?1Jn5Apt9fqOhuy=Qk6~;MWT;w z5G_d~Bt;U9Rz_(msmNLnoT`aa*J$x)rI35q?e%*DKJqx>4~7CBm|RCoS7X??`eryu zkQ`A7A4-P>IQtFgfVp|p4D`4R{Qdq8GEc*DAJk7?qaJ6YKvnRAh|n|5D6-C)WQZ*x1It{x6P;Kl=I~%qVa}cV_)Ry~LIs zO)=^tO-zNywEi!QQD|)I|ALq*k7fNoEk>m=t^f055{zm6KQ*QfV;dLquwg#C>ani>r(h==)B1lhZ9`*R|7VxlrjYS)jO+hNnE6=O|5=5$beLsE zU;j_6wpBFqk#+o-*Z&hx`$)RcI?Q;~eyr<%C&nJ@QYRC8%GlTc88`#)C-=e=6R)onQZ_>~5=X=EE!D{~zmrBR+$jU;pd#ZS!I^*s1lu zh7S@E^~bvYSFurrlZ|#S6ufm~UjNH@>&CwRm*^AYnAZOyePZ0X^}m3_;?Au99a!Tr zumA0CTShZaYCIa1HXK36wEnjuEn{2%TiozeC5>tQPu~CY#-kkk&;A$#i~+^~V}LQh z7+?%A1{ed30mcAhfHA-r_+QPyY~C(aHH&N3)T~+AQom;Ys%5Q9+LqVWH||zdIlFxJ z?CSa%v*%RIsGMCpyJAlDoEhL%Rb5wGKBJPn|L2XLIQXCaF$Nd|i~+^~V}LQh7+?%A z1{ed30mcAhfHCkJWWZ{bB)a~8pEKV74OWm5 z1OIIdWLm4FVfF{m_5Z6J{0sp5V+=3`7z2y}#sFi0F~AsL3@`>51B?O20At|)AOm^U zW@)tj|MdI+4>;q4|AQ4|Dl-Nc1B?O20AqkLz!+c*Fa{U{i~+^~V}LP`z`!^@MG~b9 zPK^AK?Evii{{))YC1Zdwz!+c*Fa{U{i~+^~V}LQh7+?%A27Y4=|KD-OcM)$UFa{U{i~+^~V}LQh7+?%A z1{ed30mcAhfHCkJVL-5E;BkO-|Npm~@$GM51B?O20AqkLz!+c*Fa~~$43PK# zZ2kXRytAxMi~+^~V}LQh7+?%A1{ed30mcAhfHA-rh%&&||4}ZO#28=fTk#^$y) zZS}29%iHT~TlTDNTT{Obyqj9;m#zei3t8G!*IL`!)CdXMTbo)Ity$ULw6v)mJWA`A zFOR#Zo7p(0uA!=ORzp?ejJlZ(b1G*x&aRzNRaZS{c4c|pjG=5^kx*fnH5>8D3{5snmWlEP zYTvY!->-FfSYxfV5yN~5YcT{BgzFA|$IRB`bk2Rr_8&M7rZKi+Wi){L%Q zsUmH#&5iAgmo>DNE>5@{RauuB!>5YMEeQ}I9s*+P>Q^^JSVzZ1&HlKCo zyopEG)zp8qP=84tzblojU)IuI+th-iQ>;9ynl3Tsc8jQH<7QoavBp``^v#kbt3EFH zkEppgqU7RHRV)=u6&IC>%>t^p`kJ?%{_dICHH$MYJZR?h!*`{M@%<&zFvI<6EbX({ zVJh5MA~riv;pNQ_Y^ka^vSyEr_8(t)v31ugyr{9Iv9+l_(&3}mqw+h^ZmL_AB{th> z6L@oe#@@EQYL+-YI&8`2gLb95bYx#_!l=sS+Dzq0U$;>%-(R!r__CIog;k4--n+-S zE0qgRnsAq6#8H);WHptXnJqS3QOP=O@x8BqxqHp3M<2~S@xt0&siZklnj?GZ=pAU1 zB}P39s<$xX!yiuCa(m6P^QV9JtiEzrs%K7&i^Dh?d*uDUVO+r(KN;T`pBWz*ZyB!} zFB#7oPa2OJ4;XhDw;0z!F#BT+Fa{U{i~+^~V}LQh7+?%A1{ed30mcAh;8$S4ZsmEy zAg-D?k;>t2{C5gDANL)c6uERlGyPdc;8*!~x;#w?Lt0dw2Up|3T_tmoG z_l%|T3Hp5fbmKDRQvD0<6>X!^px&eMzd{9B5sU%G0AqkLz!+c*Fa{U{|9uSXZ5yiQ zcjeo#$VL`pAKTEJU7B@t2a3L*ZK!^i<{keQe6hC6m5*-sP}kUo=Iv7DW4381zq1W3 z*rl0AHZH(BVtHTNP|YsQJ*qlnFYR*HBg!up*V={_?NZg_n+&Kgcx*$B|A8W+TN@mE z*@miiX$j`G1p6*;lQG)~Y^!ZUGk2-h;T-|iU7mCJCB6l6u9kM?z!)ZEF@67^!WsJ+ zhZ&QNcZ?L{UgJ;3mqxAevT=oRs!?JbU@ZUdn~GSC83T*~#sFi0F~AsL3@`>51B?O2 z0At{{&46Z|!bh!!x;2N7G4!Qdi}-j$%VLd0i7}@c);vCHMp~?-So8Ua-G>;hQmq9s z5s00M51B?O20AqkL@V}mcR3k;gGj_;1JNRd$>WN-@s+Q=brK*WuYO0dxrKHM&v+`GUn-WsSi!Ji|!iU0kVTxmd{Sx~G+W}Uaq;mI_G3{{A}|Fut?w zUg6|}K7W^YlW$YUI$y6h*wO3ttn2W5`n-5KzP`1ww!P8S)Y8znmn%7vYgvm6BNj%| zxmz+F&H^Xjhxra3VCEai(rIS7vZZOo%5ctc(W04>L~eJ6!@0o8bC_T7fL>q7+u<1u z_2adfdj%?yxo!V(g45~bkEjZH*7njWU`U2pXnSql(nhMWtI*}^a;^1s`}`qS%d&P? z%gUuoU0}Wg8z3A3)b1KsZ)OhBz>wHn+q&Adq;YkzE9C3*21A~{fyC6st^rRV=q2H< zfY;L-$+p<#>FOHJyUVw3-EjV-;;xW)Q&h8JSA^lj08c0s@U0yTd4n#fi?`bwh$$E~ z3UqW2LM`GljIHXra8+Ytw>B?1Je_me{5h<%0!h4V`5|0?qI6mtN~4oVKs?VASPWfZHFpE zk|dQK32|?;rU=gbeEzT|>=dz?$I7X3T_iRHdP*d>#3rB6iei&R@0=^9DbbvQg}yE~ z(Yc{yc6m2-_6~M=I|e+VVX8&7?eO`>5NTZil-t-J zSU zU7|WjPaffUAlw!zOhMaQb~sD2dALQ;``|ev+#F&D`=ByHcaMuqx=PrikW8rVy`>TI zCT%JlRUR#GY=E(OV<#Uf69i{=HovVRcGwPva~0$IVAyvooiH3XsTU5{5t5%9ie14T zPrwUL6AA6!T_!r5_1Pocm`Je|VM!XAc$UYv3cVN8K-+JrExx^Q>hNpg-qEBi&v2> zU^V#zE|tHM)5mKMh;72_Lcil>>m80utgV)}wNCXdwOct!nP3F?E7c<9UT(S4vEya0 z{DI~4>g?!423bdS^mzuNk9A?6Qj?>&MPhtZ(&56Frz*pMAOA|Ge{NpU}|=e5g!!Dkd!p)!LtHcro}C-+y~_f&PHfg z**LDjiX)mD^D8S>+^eu3H18AMovirhfU{RKSglP17d~Yh=p0n507l{@Eg99xrr?^ z8bn4M8a-|@z_E||ySpaCV|Gro2gD@Cwj5hh&JId4BPWz&`nr$sO~OIwxNK|=(L$oq zl(@za^@p~wwSIf=%`*f`X9s zj*eMx4oy+TVhfs(Fg!(L;beuEJ07PZYk1S*8dWZCo+3GoI6Iq6B`z&vpUD!72`7mu zgm{fugs*R)*VpNTR-Lf)DF$<|tzjS0hK9Es86^>jhk8uSla zek9sJXU{OXcsGrx`3S4IVpq4;F}cw&6!A zT)ju=2<9j984Zd)hGClcXCyGChI1??4<7CP98|2V-4*a^!xwY$oc=@8ebS6 z8}Awaf?oi5*?7))+IYfv1bzeHZsWEculZRhV}LQh7+?%A1{ed30mcAhfHA-rU<@z@ z7z6(a25eS|H;AJXM51B?O20AqkLu+t2XU+nvj{r;bEHfQ{3d51B?O20At`k!GOaikrh9Jt|Mp~ zf~q1Y3W6*nND_i5A_xM4!+~J8BiL*RRx5(VVzWt-WCz`C#s{PZi@*l(jq#cBfxc3o zpnb00q4jFT>iz1W>h5Z~^1QN5nJRxSKO~K;0%UbZN2@WrY_gCsguhm*UZKEwt_4YpZuA8?_pmgzzG)8 zGJlhQU@+9?>xPmx^uy=r#o?^A_ItOq4Fr+VnRoTZ7LIaLJ$ju^zUW+0Ni*+G%)AaWkIOXNV#=^q;g%n6d!;?SpG(yx8Q%+e)){uZ1d%QXt&tbn>_=yd$)zU=FT1T_XpsET{!j- z4o#U)LyOI@4RA_gf57zIZMSJIeu*#ZtxsC@tWHbGJIZ zeQ-_%p_lw~O?UA#+>70F;U5WZD#rBI1&O_FKGYRjLj7Pc)Zgbj(AyfHm)Y+$w>Bfo zUFq(GXfum2D}F*^R`bHN`9k4jX<9*6nk$X)RXQD$iCKxAW3FvZrCDlP+W0i`k7!)# zHj7D&KgTvZ(wS1ErRgc-Q?N4?()dZ8X|}C8+?jNHv!SQ!*qPu+(qTJOwJp9gsV(6d zV$n2AVoe(4XW8fsG3p>Mm%?nZE>M(D%bt?h%4gbgEhZH(h>sHq4;52sC2^Q@)FZjLK-sJ`N%;?r9G*c zse^D;oI|7MBu1}*==J^nkjLkT*eMw)(CQ;N$9Rcmg%w-#GxU6KyvX@Cs$9dgnuNoW+J9fo*buJ3U)9#)_?VT+Dr^=0|0=LKL2#O0!Iw zA9IqkOr9T$Qk?iSoRK)Bx}2$YGHawevz-&+AE9%BK_e$M;VF|xY{9wJxs~vbwBX%z zOrG3=Cp$-Oz`1p~nYp>SWV%?d(c%z(0k&_Q14xL?9T3FKT zItdCRW706QYuV)b$ur>}3Eo4Yl_j&Q1$(^tESm+DwQ=@QX4llo+?mjGOD2=)wOXcm zB~7mrkvKbfE{ROAso4eDnb}#{gt2K7t%Qd2a!i+>FkZHsgKS=wJ8P~;<0W}-aDOkiLG0oBJ4BA{TSh^oyIV1Z_0Yubo<8>8Zq_ocyEkBWUv8nfCw2EU zl6$O1WurX}o4tJ=PjgJ_?Wu7&!eV&gPypQ8p;_SWejqqCb@2T^KTcdm-v57Xd}_Q8 zU;n>mya+o0{tVy#-*4P$+-zJ6djS4moMW60zYKVcahS2i*k~MJtT((yhq2mdGn$P> zMy)Z=m}!(5ZX*wVGtg3!ztlh0-_`%2|6PAxe_H>O{;+AEXcJ{kl)@)PJY1(pTt9^hUi#pQBglC3=CLqi5+Ex}n35C2IfH zz6I;VhuYiP8`{g--?YDIk7*BTcWbw5*K1d57i;HfXKJTt$7x4shiaR(pw_2#Yx`-d zwN`D3)}Sqbr}HwcP|MLK!j!LScJ*iVTlG`*UG)w1MfGX*F|c^tu3oQRu3n&?sh*@B z1@@1PYQNg8cBre=W$GfeMy*!M)B<&i>QoI?P<~OqRX$bTRo+luRGwBIQ|?!8SFTqs zS1wS_gtHTmQVvx%D*Z~g(xI$UmMM#r8l_q(Qwo$Ric>KZLHfUA|tvT)sd)Q$9&PNT0s*$RtGO0kCA~_{P z62xD`Z^ci=cf~iv7saQ=$He=^+r{g}%f$=CGsTm{qr^kSjbgvpEp~{jprNoo#sFi0 zF~AsL3?wrkSS=QQDnAY}k55O;<yt#cOYi)cEoYK4Kba!BBt>cL@@0lrtlo1!To}$b3Y?$+`kc3?k7Zr z`w>y*en6DC?-51rJ4Au|7SX|dgJ|czMznEXAzHaF5iQ&oh&=Z>BFBA3ko$%E6!B;7 z6U2XWA0z(6eT4WU_aWjB+y{u?bMGU5$GwO6E%z?sH{3gjUvqCGe#O0o_$Bu*#4osi zB7V;O1MxHNO~g;RHxNJJUPt_xdkyg;?p4GOxxXWRz`cU_KKC->d)!Ni?{Y69zQetM z_%`=E;#=Hvi2vgLhWJnJS;T*E&mg|Z{T1;I?rFr=xu+0cOq?jgiyxCasc$~}PiG75wGUXLA;9Fj(8<^ zHsTfBS%{Z&XChw4oq>2McRJ!F-0u-D=1xPrh&vVW58Nq;7jh>fUcjA%cs_R`;(6Q& zi05+0Bc8(@hq#?P7V&KE7{s%s6mAId zWNxd&YT>z)4n;We5QG!9ARK=%!f^*79D5+bF`E&N-h^<}Mua0bARIA>aCiveupq*= z0K(7#2wMlp_U%LaiF=5jxLf*&dvGst4_Z&$1NSHHW*>1k^$>SsH*q(tBkrJ=xS=lM z20MuxSWDakJj5N?kGTCE#P#n>+`iutw|5P3*Y88z{r4uWZ#8jy_9AZgD&nr&lepfM z#O-P)Zf6^D*R~SZvx2z$EhlcrGUD#rLfqdq6L-y0;_kDAxO?wG+|^CQ-D@#%S1ls$ zo(qY)vXQv$4a9A$CvIyUaaYt5clqwbT~PZ~9;K$MgsFyY*Z3>-8)3i}myLGxbySbb&tLe>_S+k zH|h2I0=-(V(2MkZeG0s{PuDeF(0T1g?Q88*?S1WE+H2a2+B4dpwMVr3wL7(&wQIG@ zwLfU*Xs2r@X~$@XXi8^t6S6!U=8R|J?h?So4QnORCfb= zK)LExbJZ+$oT{k~un2soe6D<;{7ZQi_DwtmHh~9}JC&Q1tCdTX^OQ5dDsZ$iq#URO zm0rcG>QWaUT%0J0p%b$R4;7$2u`C0kT@*m}U<=enI zaE1H_dAod?e7t;wdd zB$qTnN|O|5DD00hz!+c*Fa{U{zYzu;R^DRp<0zz4NTZNSA%%iLL8qWmP$?(`bY7+) zQ4lEz6dV-n6l?@E-b%qjfv3PBaKBLanZmy*{6yhL3O`Wzp2Bw&zNPRDg|8`mMd3>d zUr_j*!eZ~=w$ zDV#^)Tngt<*iPYW3TII`lfoGkPN(pD3a3#xmBJ|$PNr}Yg%c^9K;d`_$5A+z!Z8$% zrf?L6BMFGy5fl!ma2SPc6ox2lB`YNHP;?JLcMG})qk9m#2co+f-A(9jM0W#mg+X*f z=myaZpnCwiXb%w39w4ASKtOwdfc5|Z?EwPX0|c}O2xt!w&>kS5JwQNvfPnS@0qp?- z+5-f%2MA~n5YQeVpgll9dw_uU00Hd*0@?!vv}U_LqdmZm_5eHD1MFxIu%kV|j`jdM+5_xp53r*>z>f9+ zJK6(mXb-TVJ-~+c02|r^Y-kU#p*_Hc_5d5&18isyu%SJ`hV}p(+5@a;53r&=z>4+& zE7}9BXb-TWJ-~|g01Mg!ENBm~pgq8X_5cgo11x9{u%JD_g7yFl+5;?T53ry;z=HMw zODZ|JFNHX}?EF7?|9?$%{eL06=|96b#n=fouFnyzbfbP{h^hJ8DzC~ZJ zuh!f2W?k1s?KACJ?NRL(?F{X3&8J(mpR{kZ545+m*R_|lC$$H(yR_@HE3}KWbG4JT zW5Ir~LF?Dng4JMmZH`u{P1Po8HuWp5NE@fA>QCw`>a$=gI2G&xbHN7ikb0MTk$RJQ zmAYL$R^6uVuO6rd)U|4>x`$e)R;tt0iE5hi1y~3Esl1{*tK6kLp*#e(fm4-Z;R}ma zC0BkHECc&1dn*BDt+IzQSD6l$fl6hfBFkUMAIPsLX^KVuLH?)wgnXBL5m*6^g>N!$ zlCOgAGP>k7U;${5XUI$C`SLV*yqqG7u=ambx0oR6U(&&Z)?rU>Hfo^Un(9I16I^9sfeQjxbnA$Zo@Lhy*Wh2TkZ3&GRo7J?_uEd+ltw-7vOZXtNY z+(PiExrN|Q<`#lS%`F6vnOg`RHMbBvVs0V$qq&9PVeS@WDGb!%&h}= znp+3%Hn$GkZEhX7)7(06r@3|D4s+|k?dH~j+qlayx69DI6x~bErCSDWG`9@gU~U=M zZf+U4&fGF^t+{1jySZiHN^{G=mFAX#E6ptf+s!Qlmz!G#E;6?aTw-n+xWwEtaFMxX z;39L&z;<)Xz=h_Pfpg3)1Lv7r2F^3L44h+b892w>GO*p;GH|xJW#BCC7_8ON=pKbG z-7Ijtxmn;ebF;wl=4OGD&CLQQo0|oWH#Z9$e<;4nKj9FB^yu=NnNx+9D0Y91q{Ad#Jqe;MzCIKIs1olUh!2W0w*dI*-J~RpR ztR`yjMVwW{*^@XciPKJ;HsZ7rX9aQ463~j4fL62w?2VRyz0ne|H(CN((Gt*#mVi}g z320qJRBc^I-1bJ4(Gt*#mVgy?B;#7*>`t5-;-D2^DOv#*p%q{cv;r(bE5Ks30xUu+ zz(TYFG@=!tVJ1mBgE&>hsU!|s0BX0REdX=S0x%mb0M&&g zX#sJj5htHGQ;CyDoLu7M5XVKFDa65be=)B63vk^(9oPK@xb82+b$LP&U}#wjFH~t%q6HSoW0Pmd=4);vs3V z`n|%7pV}*}c@EC4nNmMu>k{yGij0 ze-|FK9U@+#-(v4IR_mJjx^k~$ygkG63V)d~NxjGZiscslaqS7UM>)v8&32+qw;p3% zYgwaQp&j9PO1jsmQy&vff%o@0);En}?H|gi_7A{%P$2!;=+vF+d&*<-bK;qfT)WHi zHh-gdhw+wvrn=B^sb#j}Hg3|r>NrQxVz+!N)Z2a*4C}f4u||t-QU9jgG#Kle<;6IxXbOs~~qvsx?3ED-rJI zTHBCyjNfQSztD{NPMf=_(%K!D=cr$va5rXK7sMxt`Hqac!EV(o-1TYJg81*Fx$B7b zv7cpe*N(FmS;$8~G2c#c*O1&t`WlM6nlMAZZ{n`ftl5zdNx3UyIJ+Xs+2u)`T~=gW z9j`tf)KIpkHxPsq66*W?8@vHHya2vUw!yg$qkgr^T|(|4BsD*337Ujfr5u$hD| z8w`Q($n$3sX?7<`nZ6yau@DUu2I0vR!^ZD4%(l*!FhF~M!n9hU<=N$VT z+@=a^cU*>}jy4-7Sr^2oh#71)DAp{#6MCI@Q)rOLt=@ILa8N=h)mp%JdV=0IuRjQ1 zrEl;CiO&Ez#U$XTwG5ED1^WjBonGp3fNsqJ2Ev2zK)SVv?+P~;8l^umjh|43ji@iF z$X=4)Mi|a%+Vv!YIoMI3{S$NZ(JJ70*h7jBhI*V|y}hZd&fDYJ;Oh@W zVl3CJQ=qwb`+^}jie(w88|~m7=1Db+8e1A$o9a6ju577qZ(7!ZN7uBFUf%2VcZYhK zNz=t&p@@nojm$Jioj$PJEb3Xw4= z>0G7VqAibp^$+JJEg%g({6X)0G9b?*t)2|fk<*Lj67M;~j?=Trox)Qss-uJStjHie zGqK7u=2;IK;~1TEZco)t573o68lWpkt;&-sTSioleH1JutR*}NmXM4`dJrs*&TvIB zqvrG|LGB1ag^2_ejPbrtqkRm=O!eK1gIGF+7nFKVjJBG@hiRSvsS1 zWk%@ANTh4reCw7mwkK2hm<2}qPB*Bu9W|&_GV_q0o)WFSkyLv?Morq z(Z zX_a?Z|EgZBHmS03vaqk?2gfb?o3Qu&PI(VmcU)*(q;FBqQZnV|q#q=Qc$r%2cvbyS z?vnNru7mIFPZ5q3_AqAYKRV8E_=PXvw+Hst>y+1|J2ao@Ff{FZb-U269xcBoJ|OI_ z-KDtX*I~E7(ZWO8eqyQSu>W8@2j3tp*8iZFD}PqjDZ9zJ(k0SbX}b7?xWDj|W1FK` zJ{R^79A!+=kJQ)df^v~^p!^-|pAX4<%Qop%X@j(z__}zAqsyTiC+q8#!{N>P1M<<* zJK`7Osp`wH_di|OE(9F+>0juR9qo?sDlbkHQ-n7iS7|NAL&n*#AL1U^Z4grX)P0l_ z6&2peUnZX_eFksM&lPe7-S`g9RCoh&(Pk5ody@c{)1JT zq5d1r4|qp;PPsu@EYFgQr6;9_r0b+3r4}huyiMFs+*4dC&K6#99Pik}vAbiIdX3Pd zZV-x%LySyiKEA{;Et62?2;aXhZ>u1uF) zj?dJ5`4H)3$Fp$4Lyck6pVA-E&(aHEPsGF8c=apTi!ehTFKrj=#HqrQj!lkS?I7(& z?F{`zWsTY@u>JqT8*i8|W8nW71H>B9=h?iLA4eqe5W%Mti5wEdrxA&qoyMnPD69hb z6e9Uy-sKJSgM+4cJtAolNhK1d1*5cP;bn4-xk^M@2WNcoBE}}U3Pi$OVafzONUrus zJR6ZZ;kk*o5-9*{d)SRi{9t7dhl+tjmZ>~PB(jp{enAPA@Z8TtBCB`q-;vOtPy&k& z_al)=F5C}9B8znHdm@oXQ0_a7NAmkN;`a^u!E&7YIuiO7k@hDRtS^Z~*5BM0MDhhU zc(~7rgk^k2B(lWjJ|z;-nfnC&NEsg!3DbT=Buw#PB;E&+c<&R*3x-4PJtBDy>2ia9$MmMkN00 z5$QD|k#!*VDv^5O;7{)F=toL;B@+5_#P6ku^kPJMfk;@|^XNycj?WQ^v<&WVL?RYK z?pgGMvn;u1h=h0JuS6oJUU5&Oo$x7gO_}NV?lmBCYo}DuLgvM8X_yiNw2^NaXZ5?xu*}jS@xiC%Lk&yF=6eP7h5B-RS=Mo7uJO}-HyZqeth@WYv#t_nO&P0i%J0lY3 zbRuEReorL4>!%S3+lgsuCfBIl$taN=P9hSPd?JxBhZBf|IUG-xwL{`jD=xVr zEprPI2;B#x4`_1`5lA5ihU07|0%;_h!af_r!UiIciN zVO^jm9JCt>5P1O+;OuKJwMCID(#WU@Dja(@5y(tljXscU77<7zn;DKXg9xONRfT;j z!veMZkSmgP84A$MONl@lMhOu}BQFleDGCQoCjuFN+(aM+7NQT-u7C*Sj!Yv0$tNF! zAoA3(kVgd4^>T?o+IbEUNMsigNS&q-fjo>%CITrdn+SxHN$3N;G>ZsCd1^~RZ%|=8 z5lB)e`asf5A`mq*!g0nCf$)+Z_DKs1Xuu$mQ_u&>F^E9Q(NO@BG$IgvRU#0QlyDqs zj38H}g^A&a0{Vb14kD23?cq2!A`o4yVIPZN&5%fPT>m>x`Y<{rWcf9r(ikNaZ?ZyK=H}Fnrm+yV9ey!!G_= zN-liUufx9m&*WF(Oa3e5^I>1WvGP{?-fU7y1*yO7jKS3a$|^5>FHl z6weY57k%Ph;#@IJcvE;%xDM<9`wFwf7O_Dr7pIAnL{a!z_zJ8#F9;6_cYvK>J6Ldz z6aqqz&@SvD>@E}wX@cnZ+3}U*1Nbe6+Z@+8E^?d&4Tb$N1{ed3f&T~tl8yXELf&|= zNuZP~gG~aZoJ_Dupya9qn*>Tz(!eHx(&RKaO3nsb+S1@CIfA)xlpICXL^!*I2OAAZlff22;=tx?uti{OT?Si3SmMGG z*dok$V2i*|MFv|$So$dv`Xlvoz(I2n>HCQET}1j8B`BBshWc4$uti{gAbk}H{gV3e zGT0)*8hlQrpJeW{i1cYh`XnNKOeHAeBPx9-b00>e4+;&*R2={?lz(NykkD*Z_YGXy4m zRN(HU(ql4rN5t>;aMIhT*B{fs5`hUGPJ;vPDDO9${N7~ZjV9heW8Mefq*Lk6Ozt`= z-7SL^0`mdsnn>u?5$P%_-BAfv2#j}o8g~ViZcBqB?`X-FnI&Cn;w2_tOk>_Ca~DzR zhD`1cRN7w2T}Y+tWbOhgU7N|B9|=8=N>|EYg}{8LSZ)52O<#p(mJiA!1J)p{!l8MARiL;*&;w^=egq!rXI(p9Ylp=(hhWhB7E9rgxpOOHd5F?BONXe z3N|rO2D2JR#IrE z&_Si5Pe)4{QMv3h4Ax#0J-q-5**`}i6-Yi}}mus_BC zV}LQh7+?%A1{ed30mcAhfHA-r_`kzI4Y8kW;l8yLw!wR0*n~iT0k$~zpc%E*QXD;gJ8*OqU|b;H8c!sl?`SQfZeHnp^OG}rD0 zKR$2ao!rIXmFvn??Ra%Ay&BSOcAnpswJ#JH{&c7~{$m{|yS%ERuD)SmeaXy*+8HG? z8f(i-YO5;BODY!D&Z(F+vvFo!t1VWeF`E`0~EA>cVO*JA8R}+VraF+NAL1U1{k#=~`C!^2W58g)_B@;mhmNa;N8N z6T+95r*%*5*2ae~FG*WlwpMqBwY=C;nLaCB%M1r!Jb@^k5x%@ItvSD08yCJjFKu!8 zVm&>a_*_d>T6LP177jjlLRv+dmKwf1TwXn8wU!dT+$y){wyTB!U)IClmfR&Xm#DgV zwJE)^uu;{_tHJb&{0dbyuYz)6QK71sSAKQUx2S*q2% znxE#bbgLHgYF=8JD^2Cis}hoqy#LQPwCMi-f5BONFB;Fl>F|#j_ruBcHyhU)mm3!v zXB(%2Rp4-Ai?PAzH+l>Yp3Jw@Xf$>+s*Q5PZR8qR#yH4|{V@g@1B?O20AqkLz!+c* zFa{U{i~+^~W8i-`17xc_pPP>`VJdE%|27Zdn_Ps?a}YjtA$&Xq;l9ZTcV{EqH3{Ly zEQISOB3wQJ;gazP7dt6rB3zh(aNanCbJHoLAsn8Hur-D3*xzChcau)sL5;XUmAHQR znI)dzUncIp5^-0H#NAUMZkvO+&A9)+2KWEZ$Nm5FaQ}Y^uK)EnIrDt~w~g0f7XUel z|32e(;|AkO<09A%@O$HUSot4p1da9ZJ9hgRt;QZkoiW#_G^WFo!twtEuY=?N30@Az{}a4qe0U2!`~U#) zxEOu_fZ&B06wezM-kP6IJoc|ArYT*2TfcbF#KfpXV{~vz;s03fvr~K--g%!vc zU<@z@7z2y}#sFi0F~AsL3@`>51B?O2z^}*vdH>I`_5ZKPI4g=Vz!+c*Fa{U{i~+^~ zV}LQh7+?%A1{edsJ_Bt1|Lb$kN@NT$1{ed30mcAhfHA-rU<@z@7z2y}#=x)509*h6 z+KjXE7z2y}#sFi0F~AsL3@`>51B?O20AqkL@ar?c*8jgg=d47=0AqkLz!+c*Fa{U{ zi~+^~V}LQh7+?(i+6-ux>$!2srUSIe??SIf$!OI`KLTH4xMYnxiyT?6YoqOm(5?(){A=GxZPt|g7D zi(MgKpEnrt^bI6tQS9=2`n;}?cT+T5chww+b5Rb@`TSkpO~C_teIaj$XE4-{*RjP^ zM2lR|QSES6!OZ3eOz6CNYZiQ_LOU@Qd2L{DOnsE|w^@)l3t%vla+Q{G7A#THQ!b1_#r zi4#c^97>rXIF}UhL)A#+-~re|I)c7#zb7;p@CNC%ud8D{L?EpvCTzA@`;{$CD^@nT zD8Hj*LAXxH##M+OzOG_YhI@0B;H(9W(!;klA$nM&1n=s^yPOanPBx4J;qu)>9hHK! zsEFS-i1$1phlI;narZtU5bi(v?6?=LTR#%ruGYqdjjfF>^^I+qQLxb0OIL(lb&KSSsbTdb256LmdRsyMSa#~j*^@~xZm?|Ep zo_ok$E;u_X_@QOthLoJw*y=SSv1yGhqv6#r99Gx7GQqhI=(=bJx+YaSS&gbOXquGG z2zn;Pb8nkfDmW`D_`{vpJ(7!0_Nk2PB+22>Pm;<>9QR`99q2L1nIyNS*zOZ)v)G4< zUBmFd^Cb?KNlcfGFVj6Vy+m+&viYITaHqq;q0ciA*JRPtZ$n}OEQV0CDI^DB9?27nd&nphoXvUs(7bRfgE76ovm-d* z@dx8u2$?lv0*g!?6DRVRD9PywBQX&Y+7(Xan+gPHJt*W1--wv_aT&(=PfxrZF=26O z63UNj)^3iospRSH@Hu!>V)BR)-Ep@jCSa7ilQ1B~B#c*Z!~ub*KGummgY|x$J)4?NFN77Q{izCl!-hJMhlE%JL+99d<#laAinIlqTNF)^XS@%J_$xM zk4n>qX+5+OJM7xSHlAeNc17DkZO{oX;oJx13eHAgGdtWPBlk1>^hahN(s`o+`H6f+ zgTl{GW*Wk1G|&}()CoV?Z^;qJLT_lwFopN_Z}bK_{=fFV1ip@=zJK<5Z};80CF}6& zuqFA>Wy|-mk}OM(FWGVqCk9Kl6kCZc8A*0767R|eoDf|4X z3Y4~lK)Fk~Nw}f#|Ndrn-?dMU_)}Uw?T)mwyEDJvZ+`Qg-<-Q|mS%^1#+Q-ObcNLO zm~xYE@nVl|z^DbuN<3MNcr(*To?zy7ig*C5Y`o0X5U~> zhQoC61@@V6h%P?OJ`vXF;^XYYVU;c(VE1Z@B1yXkG#RIr&6&Z{BjmdPb5E!fWQR^1PBBO1PBBO1PBBO1PBBO1PBBO1PBBO1PJ_5B7mvC#J-{P z(-&wVKw_T`@zcjOetJOFXbC_ef2FJ{l3@n(|3Av243r8G2oMMm2oMMm2oMMm2oMMm z2oMMm2oMMmm=^&)$A41H|M`mm68nUh|9@D_|L^7V{{cS#Z|3uV_xb<3=>7j6CI2J& zZ^_RkKc4(R@?G;L5<~f(yt{1;bv^*^bssnT>mO`{WqD$bXI8J@P?A=+mEb*=SB-PSgNn~s(rm9SrDs?6!8Qkg&!6vhi ztXVw5OiLQMtPX;;<$flmKxHz!1BuwISjevDsc{c)ub7n}Vu-(Ik)4_=WvocDDy0rn zt*rFuv}KmMRAwRjBI{9BC~~TjHIf!=gvsZy&m_BO8C*nf<;7Tv&6#Y7>A*y1J(PuQ zBnQ+cPDrW)H)g59LOM3i#E)lmB;L$)5Tw|1Mpz}2E~egW6|o{j${)fZv!U|suL8Hh z$}FRyXs7`(MEyLoLAJm8Xe0jyM?D*4@k`Ji9F_VCX02luOAUcgQJK{%LH-5S0HRc4 zXpr=2QlSY;9k|~<-;wHNs_aO%)x<6`W|^jL4aHS8l>lorLO?JWFrm`N!&YcZ& z3kU&S3+X|QjSCrRP(~@27J!rMWScI43j^S$>83@uB-Kut7mHdDuR;eKB}cAu2x)K* ze#@F#m>Oa|s*RMDQb|sc2C9To?qRYC-HR^60xV7poxuqUV76&MP278`k^)rbE+yzm zj*WvYaV-ES!n*C04GW;$%RP*lpetoD+);?m_K^jEGX*q|Hj^c80TziEVM9nAu7zrZ z$x;?>ArHhdMG!rcDOn~pkq_5o@e@2r?lF0sxlLzXKu4ERC=!z`1_w+poF|_wAjB;| z69OrSQLcC-F1Zk{IYqe6=4X$@3*~&?jTdS10LvEP2(>b@MHrNI6Ty9onic%R3H>F@ z;&(i|u8x#_D3;;k6yymWT#yBjgHMDw!9j+})D}rqNCz|`imGu0p%zb7HgV=ab5358 zI!}iz7*;}baGaiB!Aivq$h^>cPLQIUB5#aa0M9oMpvZd>!7V_ShKPvt=9#i>H;Wc; zDN_{4vx$}#iV>-B6v1u9y&rSWLT|c}Z1>vaNkKV+P_ozvrHots0t|nSEI{KHK-Gqr z;O^5cPJ&Bbks`LvMnFzY2IN?-WE*A$L1@SkiuMl9A`cpy3}!BqIJ7q8B(&j3IE9vh z@rZfHP~jYP(pu*L310- zlF3pdCL()rP#~igmlR2%4PZ@7hXsrv1aHu>CH z?m6p3dbs2~)PxT_c+!$JWKp2#euR!t%cqz{VObWyY|E9IX#+Tk+QQC53|Rp3XOIN| z8sfzT4zCTsRa$_!&a?q^FC5n~@6zPxd2N7{vSCBqSv(PR(i~g_p z;%3q0H=bwn3xBE>B_4j#70cHx~ z?F@ak0Z5_~FnN;jeN6z*B27^84FJU4p-?ytZZ3KkCeNYQ1i%2YngC)_MJIqO-5UlV zH^`KUWZcf(;+f(GFa!=50LU$nz;;~+1K>gYcAFP!+b*SR03?;mqS+QfhfV;FbnQ#R z>*ZpS$v1ev|NoEV*OFgM{!8-Hcnjb|$w!j!Nxm)lw}=j0fIxsifIxsifIxsifIxsi zfIxsifIxsifIxu2A07ev#eOnHej-VJJVAaePJT2-ek4l15g}hU$Peq}hp-W#Bxxb? zRgHW+{(vtls$xhoEh8k8FJsAHCZA4zH~Ed^moWSP$K=P7A58vz^6i-WzdrdIL+PC4*(Ehyx z`+Ihq+js2hA2wUATeqh5(C!_5`}Yp--G0ElX20j61qu;AP zTW=5lD*Vy#E5rN4i$gyQT@GCg9SkM3$F&iyL48_%hk69x9sG>)7s`y%ujukuo*A8qt&YaZV>1ZZXmJ*0BUr!-=duii z8dN6t+}<}eJ>I^1boMy+uAZGZG1GQD(hwQF{pi%dR>3@+&%D=V-ab8ga{QL5>6_by z#@kO%9?iOJJ8rZYqqpBUy>p8YbVI(NJzP+>>g`-1$~p;~otT;&7@r)Uo;cceT<_8; zOKUen7~JxF=yq$niZoY|sp*rWv$Nx4C6!&3O*ja?u1%a#sm*8Hr44kcjP0159iN^Y zJ+Y{=zLJg!+_!BMiN#wf$uxdOe5ZC*#5g)NIWubxpO~86F=j4ps_UrRx`ETH&DBIt z&c*vGZ6K^OX6&8ZF?s6r?C``fq;zI#V$77}qPmTB<#i2pQuOV+yy@>5oVJG8-w zF$BAqZLDdo*|<)SwHJw0(&-E$9b>p}|Bj&peLZ`w=@~w}XYaOtq*2paQ&dx5LkO-| zOU#B;kq^Xxwq4;##4F-vNkv7)DWuo7MkH00PrY61_e|9&HR?-BD@zIHmED5gC%s?W zR;&o4F4h{7#U;g)DCW-9ATMOp+q7JxPBlhTdKS~pbLCmS zXM1hOW9xV&+|(&VZq66k;}@AWf7HUp2<3KV2e?sOJ`=Rmt&v;{Y+cj6W>Y&SmwXnu zRozf77c#&2n)uG@HO*_t{7$rq#FpHGPpUi(%TiO?*~(tn%53sw2%FimQlz%LHphyM zvdu_sdi>Oh(WB!h$0uhAUOLQWrnI_suyq3tir%q;^DCS4YuhH|6_(I(Z4eW$Y?RRi=1lY7z9l%Ct^h>s6+NwmX?9N$|?l4Dv#i zX|0-DnPPjq9%5iAXHk5O{2EpC5YO1iN7~R^+&H~_iAZ~KzLj^Y4YCUb8u3z{aOi9j z#LM%ES1S#&Xv24p&mNx|LvK{FsDwA)je=!mKFg{!i`!Lzr?|S9!`C2q8uNL&z(bwg z#4MVGw&O+RMW=DMqF#{K=aYAWyl-l9c64GA)Ty!*>fP*eQ&9Ud+yUxzhLfd9%5dvq zL0p|Lx*f!#EjpekPEdoptWJ>D=99L8bUSZd+K$Id;y2=QZ7pcwe4XJ+dBv4G!y3-$ z?+jPS&GU7JTdGB3RV(wV>vDNn#F*htLvDj)N=$-4I?AAq`-`_bdlbf&5IrgSI z$E8(5fp`@ukkvW1$}JH?K+{;$QnRsA(D{1D79>=-cU+e49amNmvmyEVyJmT*BGM4u zV`T-EKwG&;%SXOcUXrfSCFmYYD!Cc2EEDv;8ofkr@@jMuy2qlDB3`3QL0+gvH_5p* zI@uUamM5vhI8?$}lsoh7r%_&b_b4)&-9N_r;=F$>7SetFV*{7|JN1vzbx~4yQ;`tq z>mTd=BK`g2@>B&M4VUFNsb)oyM!iN!MQz0*90cd)q#*X0@Z!38Ex2KALl+LR;4KNx z?ziB&iunz=p|_#Dp`n4gi<{#jdC|R67wdMfwbc>r_wHV|*Rki<-9et{U1K6KU+-Fj z#HdXw(7U$R_0@Ibpy;cjBD2)H%Dl$AW7%qCR%O~V^sYs9>_ODrm37p;u8jy;zV3Aq z2Tr4LNxFkAs%@?%c}58yb8ZU6Xd=MUsjr_ z?@PV<-l2lJP<;n+cHK%gr>ncdIh3>c)xBilwcX8SPIceLtNV~Fr2DFSF-gzXsQsBn z!)|TgC<%$a+Fs<7=&$T#f$P|xvE+M`Cz4AN|D3px=!riSe{KARcw_9_u~)|0qu-6b zE_!WLi@Yy#cced3Y<$spgE46|=>McYsE_ES;SY!J4(|wSp^t{{33X~;(JpD%Yccix z>YZx4@-^kf%C(9izem1Zwxpj+?~%qOg?$PMF37dtUO|Iq|HO*jqqDmUly=u`U?^1D z>~4L&@*cUhl6VwH$}ezsL0@>0r-w6HQ=oW1FZ2DkaIF+ynX?!01pa?Yee)S1(^u;3 z`F@%Ha^HTMBWqNz=M51&-WC~U?0I2!o~A*wJM%_ z*o}jT*3Ci=Ty=h%#?FT)$}wu=%KqScD&Nip(;qF7dN zXHhhaojhh@_B3$d_<=(>WFp@693gK>t~>zZki40x)6+-CuPCnRz_tVHaS-W-Qv#NH z-pZ!6V`a=HScYdur)OubotQl?awcmBv}>ylG#r>g#GWbi-WV_~&(%aKI~%?;GB$o< z;^YLfc12aL-+AZGDI7A9Uo|P@`Eqs_z%79HiYVRO&+hJLHu(w>@4CrVCm;CRA&ojJ^zT;`IM9E*{}2wD zh__7$X-nD#Q0W?W8>D5!o&yot<+A>5{p)cM(bnT!id3CDMPOyOit5Fc%9Q|&`?Vbn z{Vn~Z#-3wB4WBjL5>%kp!2nsR#8)Wl>CJDF0a*4NOvr1K`kZ5$J7 zEy-W`m<`WFZk(7L8=9h~1PuXJFAmR|(#n>tEvs=*T<=kl^s4;YIzvhCn7L;3#KhS4 zEFoU4ZPD7RT9&s=%$ynBazrRV%~_5qPKPH8+43DV?A{t?lg~|g<7kFoAnUeg&jJ6; z_~`V}V2-}yh-st?o`o|``Ase0=t;AEKqfQ8xW#Ar37%^lheP|@F}FK5fr1&GPG7hSh?@>f z?V7q}97CJ2@fGHQsjE+&@@|GtAEB}oPv^E6D-&JGl@%+eA!+v>k=AfBZ@T>K(EbWV zOhFI3&twMr_w?`I(RXA&s$|y=S?xeED)Ru(i9nIHM}JC6daX6}moh zVtn%0>~R|Io?g{uN{7q|a}0+<;cIpY#)^E#LtsQ(HGXTFZ?}2Syc&m0!Tmc0-;&N8 ztc@{H%B~OX$4JtHujl&1 zJNE3_v8Uhki<1r0Sk`2&FlRu$dxwzcgZ1EoVXb3tsx#`A*AcA!gY)F_y3n=HkjoWS zgH@YxP%d{32(7B~b9pW0(zTc?=dsGDZK_&UH9K|s)b8!`^xHAOVUvx(i!l8+}}nLL#2Nc=eQ zy2MEQ2k|$?kH^=>L$SY)JukLDRu}zV^ip(xG#PnKd3-joSTM~h3!YszV^)ZujVX`6p>nSChA{vm7m zXrH%y)b6YnEWY(4_773^Xl7Aizqf?c<*Win!BvGvqq!Yva@bo%8g;tdWd$X_xn&=W zE__)b^H3#wU17UeS8zJHVg(i!KERX6?xhyGoV3~L5JLSc3zz*u{VNOYPCLif|9q7_ z5@GMpd&0VG?V7b)oHowkf5ZxM_MUkjvaXE})vRqf}>!qduJrK*2RaTXcVZW-svpiOv*uDrF%!jHx}h@=d@olK0Sl+7czQg zd>Sh&cpw?= zcuRr3)nISQuSMN!y0oTET3dW*r{JWnm^j&HB&Zs``5U~&NkEaA-tdqtNwJt^+4 z>ZXI{CGF1Q`PBS7gS{zF%@qyn8n!rf^QrkJgZ=G1YBt1I)io^Rk9<}+wL(pQNAb6$ zW~QSkZm4dcgF1>yr$#91ZzBH2V1M=dHxb9m*c-~&tH@XARg3|rS|qqUw|_>P^hQcB zuZcjJV~LW+$J9e#RW??34GzALw8dE@Bvt21!qVhlbJb6b5nrx^?y`Zh9vo9A#wLfI zDlS0Ump|=fe+9&7l{RZ_OLRE5k;uKLXX(`{Jg4*C)F_La#bv9?NcncBQmEy7kA^*D zus7rt{nBGy$F@2ZLJ$5b4WE#@Ll*W1gS~d1qCXaA&#yezbc{^&q*E@^6s1V>0QeKHS?_RZgi<1)S`d*%5 zmkjpGc}jeDe57jklHH=flOjoffxpIJum1fDe8(WWd+;vu+yYOC^!x?>XO!MN1>QBd zeQ+HPQQ&bdqCkPan)1AW0w0X;tQzbX6a^j=2>J{BRgjid;M=?>19=5rybiBcbrw^B zw>eQRO!s%fujEZ9t>0G_*A~-33-p~%M5N9i&F0kDR~YQ&>5e{SunXQBRvnHZcz7Z? zJTEuc%eBvG2e|@@NXBYqL--7otCpvpkMC)^h%Z=5`syE*$Xnn6xuoqD} zh2NrBk$#J!^SQ)sNdAHOy*hiL;-w_sq*zprYCqd?he*-)CIx$;&hAN9*AgTBG6i*? zVd-fW|84X?jbDX-q5Vwx32p=TzZZdXXLU_7UT{~K$$F1t&M{`%)=)iDnZqPzvJ_*s zDzi(a2ocUk2oAd4Yw(#s!W$E zbtWSj-0BR$CbN*NSvBwSn9z2_W6!fFH>blvaKd|kul3Ob!#ZDs;LB6qai8)U~RGs z_BNIEFm~>2m|H*y=vqh*a%^14NP{v;xg^h|6P(KLZE?+g&$B^|NQfsHOtnbR#gxez zaES=+5KeO89P%hyN||&iZft?B&CHaAAhH0QTqoOf0bCdWH%&J!x+ST0%Dhz%VFAoG4XBBG zPgPQY%G{*{J;||guqCbq07Y20ow8v8lzX{{F%xv9EQUJ@(b+z-0C1*&2GVA-#4W%g z5hH8}sl&BUjWAit!Y$;1Sf&V~XEG(rq$cv=nk;^TC&@h~k2AOFtPAMqG73dvvc=$l z>4o#;lLdsh1!zJb1u@DMkHjSx!ZoJ|*V+8+k$9n;&%5y=O&(y`A{?PsMz#opvTh={ zPf@die>kDPWLf-;BfM-WOD8=;hOt6zZO z&yfXa+ybcD5EI;ey2VLw$tzOC*4YTismXvG%av@ytRM&tIYQCi!CB-%W0S$mWfF(h zhMa^p90{k;GEm;Ad*Q)I08Ur{i4hQ+6bMvC;A4$NgIO|JYQ#ijFAfT1)Z&sNDYOBsiRrL_5rm-5o<|$N0qp^y!HP6Sqb=Q* zRQ-Z$0agkR=$R?cjVKZHx!{Ekw#eyz))GPpBwHq9jW#+1o-wuzVazVK;HR2++B}cc zSE{xRjL~-?80|eysxDFR-L^V{_*AKGU2xcHLjK%Ym0N&L3KZRs&=G3+6tgHS%L15fxiT|t04Gsf z*m;N{3qbx1vH(Csytu&OwE?(F3lP_tHh}Jh<2vSDnjAf^4UkecY=}FHCxT9zgNq=v zD?=iR+5nUCWs59Q(jezKB?>ZOy@#&IVKe~|E+r4~B=Q^XrCCik8#$q%*KG)ajB{rd zZUM3<5S*69^T1i$ESmhr^K5?MPt~HtgkoM~6DPF<2kC8PnoC@BM;73^>|TI!jb_W@ zQ4QRexz96qII;63p2R|%&}B2mv4iE+BjirHkDQy zN*+v64Cd+G6z&CjP%n8K0Ah^#WEZg$96n0h98DGwQS+ zA${l?DvZ&|VltTM3XWP}{8MuaGLTRtMh9#JC%R4d0(Z%pfw@37v&AVuXH!KXXL8^3 zY<>YDdCqe0P2LIc8(hNm*!)E4TApkXLOwSDsE2Gi=W9ca(3f%ur1kRmJ@MU_wy6Ai&j>nFEN|Kvl@L)W(vR5!r80yJjm72 zQ%r=pzD;MZ&f5(b__@k?y@T5vP@PAP_`uJt^HeEx)`2=dg2Ns9lQ@xSVzhBB8hsOY zu4G&xJDzjv8kFD!DYlJbX!7UP`5vlslzn&dSDIJnk<19sq8Rvr6y#_QOkhT`EEArM z1Ny^Jop&7pOOBI?OJcPxc&3{TaACm8c%zRAsD*C7l!(rqO>hf{g8&VMjUXhI$t1~y zcrz1%02@a-K%`1OPmo8YBZ-lmjhQf=GYdcxr4F4TJj(*OFq0HOX`1jQ>#|o8xRW8z zrfe|kwN0Gp$hdlMorkyj5Di)y)Y};nwZ%$z`%+8{{k<$ICg?6&kk6Ay>3qDvr~jS> zSR@I8O*(VPRk{_IbdoUcr;rpIA?#fX;Q8ti@hW>2r&Af06ox2_26mE((_Fe-Ia;m- zv>*n9d-O1T0SG>KGWRJ|WnULMFboy=(4X1J0S~iC3t4jGB^9$TINa*Cm?Mv`&Z-nc@AuiNd7$D|aeu5ZXYVg#+2G zL?MD_5IHg3N%08L!U8U_PMRCr@&_n@vi}mCNS1C&rwBU|CXp!HM$JZuZ0Rh4U^F{W z!`#O6n%aku@OgN`@qr)aptv)eNQ?$XYH)gS1}mQ~$(9LFOfD28hS%>yNgIJs>D<{E zw}2>^m<<|o7PxVO5S}!yOBv4m`KFXZz!0LkMY z1@9#$IK5r~ad6K#@~h!wB+BMjw!}w%j!1}ta@qhI`RP=gCjUp_fzXmf)=@${i}R2C zu6R1twTL8Ka28Q|xy=?gAwgL-4raG2FU%|WuAQOZb5by?x zp;FP0?-Od&ax1KHo#i|l6yc1qoD;Lbc(qP zK=h1(7JwQPXra*Z(E^Z8xw$-)vj9|2PXmAj+%g;~_EHOgW-kCylxo{(C{6n^Ba|*! z2pPn@Z<~F$umG_DWMKhFLK_g_7GOZEbb&y!?xSK?nQ*v_oJSM+GK3%pyd;PU4kY+@ zC$7*HtW?SI4GO$KPza6O=9%XwCgXeMv6K7I3EY3SiR1g_-H{M z0a=RBM=`_cd?+H?fEFxba+5#`$TspZV)7Gi!I0uhfR|ZmiZu}dmH>NT0Vx9(pcnDn z6Mpre)OZ_U*y>9Rz61y{78)LtnT#(1qS+t|kZj%tTrNg01@jz4(SuSt4+S$8Kx>e= zOEsyMWzlfL#t4aqe73|a)wKZKN=fP<=v3QLc^g0@!3#Dkbr|&m2Dbp-Qh=R1OJtG} z9wNjPC)c<6nQ+K;mV0ad*UbM(T6Qmhae!@87)7{>;YwHlg`o}LC$dwUU)j_w@Y?Ui z_~!qpdtl`MnO*?QSR7nvFTj(!=-~lbxcmdn|9Reddbzy-4}!-5f_ZWqwkgyU0PzB5 z1$u#qJjLdu*T<91@h4+Pqc4h{(Y~QxP<7>;a!9^LdRV?F|C9W<@+$e8ni=_q@k*n@ zm^B7tzlciu540|&5swfr$B!$!62FbTMth(7QFTy$sr-F)nSQHsTCUTct#8n7jsGn4 zC-M72uh3o-T9s&t{%dkpdQ|;w{H@W6@E1bw2!BAmOL>p>fc}vBmc-k&6Vlt{8Rb#+ z{mFxgc`~U;DPa zRSqjL<+YI$k!IuLk$;F(MgB4}62DHnLGKGc9o`*!BJ{yo4a zcp`SY_JI25YQ6F|@|1qHUJ?3kcrx*w*bB8csBcqODespZT?@ZD@o@YR?M(PBk(WgF zMs)p{-Ws;UU7_EE4^z4Lo%9x#%DlVE-iiB|_)QRdM+9&F(94B0?Cn^uQ_A=a`+H4^ z%k14fs-rA$kG6t8CSY%sr^=Of*|(_&dpNGtrhk>l-dC(N%Q^d<;WhPweDC6l{hgow zO)6e9NbCOrKfxoM^Zm8T=6UxTV{eQqRa}pWS@zeYq4y>X`zy}%V zT+hCGMY$g;oS8>kl;MTEO2%H7RO-{Zv>j)E!S#5pKa+o+1M4MD_8LFgpHYMqDXi5e z2}OEAlYJtM=g0jrKGv-4TfpnR?B!euyquR`!Vju9GJ|iVb4Bbvb;a11sNZDT&3@sZ zO=seMp8kD)l8a!CDb?Oa66}j~BlaG=jeQ}V_0L@~{TGEAkba5M>WLwX!DbfhYh}tx zRGkUFA)foA#oO4wWlZPpB4r6I=kS4pL;d)D-S)lg-xq2QFVN1goPz#VTHEJo570IJ z`k8&#pXYOFSe~v?Hp&Czvwc%1Pfbl?a=~X<>UpdXlsE!MQc` z1k>qhW&e2XI?8s|kI%0)o@Q&a3B)$H*}ufTh6*o7YTNOvo0VZ{ z0j~ug=upN%xA32R4=-14NHaXcue$dyRrVF8&H2&xzItWABP;xy?4h`_80PN&=6WyX zZ2`ZE-V@o&R*T;|?~YV4@eAf%`31BSREhMDi?3Rs>>ZJpu-fbjHHd(i`|I6-1q#_7 zZDsqih4dr9a(_X-typQ5a(~>~hv<4y(7eU!#eI(P^i(SwJtXsYX0{e+5nH2gWtQLI zC_&%8%3Cs)CmJwphr5{!-rLY?6E(;isg~pnr#4XV`hxBBI%U6XF4 zyJMxfSzf(SxnqHCv}k#FEVPqy)#1x*d+f7p zN%jtXZG>9h+u$o}l+9A#Je$t0$n zN&L^)`n)!!31MX-%-!t(KOk(R_9`>lKHiW}>eKyf+wuAwsU~Ufb^wdXPP}ffF8&BB z6{6FIRGV!`H3^wT#Xh0cK7e`&d8p#05>I%!Px^A7NbbqCuXq9bie1URq8a;&5R^tiDD^DU z3qx(!^fCh|E&0}5EY;1**#%;`U;HpHd-$Ya=C~)Pu02!jq!pu@9FDBoNsGz%sZX-x z50YO>elq#KqM#N&xKC(dh?T3=#+!i;}E z{=WF#;jf0@8-G@OI6kPqF%*ig#}?34+Na`)xDxw$?0d1V#{N0>SnU1bo3s<^FT)pN ze;s>i%!y5f8)G-b24ZVtt+CozQA~>dF#4tFC!+6-J`{Q~bYG}QdocPc?Vjib?cbue zgw94!hD)Q@M|<@X(Peslbg}wmcraQVl_Eckd@1sY$a^CXMP90(*VjkRN2Vhqp&x|a zrTumI`pBNp>d1!3(nt|@EBJTgGseUEOZA<`8$+)%9t<5c?lm0awEjW;o!G;$O#Qww z9-1@`7=1>UQIBsL{8s88ydMq@c{aAZge>~LWpRora0RjO6f4m6L-2LR}ZAZor zpPoEDGd?Dj()?0%mr@B`i@sG#5oLA@DJ7OE*XD$@_uo2x6u;z6Y}@h!;?xdf*9@9quvbu#xN9Xj)|=j4fxS2Iq+$-;!BS@R=!X8J9i$}uUY2Y9BI{g&UEqw9C(DE^%}WLi7T$wzvA>R(!;XC8%V(bv71 zrt|Z~p1D$F=anLhs+G;gd}14v9R-riS%{`qD4U(V%@^`|U&sY&n6kNU%MZ9NKcFW+ zV0C^#bACW6z5l<7y^AF;C+|z{PDT=+PyA(KJh3kRUha&x5Dc*=N_v04A2{x|xBzApT=@XN!);U)O)-}~?tfW09_dqlfMGt@7u zZ&0Vz^~x`lNAO0$D*n~Kak)%-RGO2vvY#X2|3A0I5!=5@zWtsh8GDjNwCu*!+hMr1 zdSi754vO36i2dFr-=5F3kK#|l{RN(!xVt_Z)tjr!s++56*JsP2joxKR65Bp!ZAc{H zU9Vq9w4Byg2)Lz+U8s64d3@vNEzVR%gxKPf3WZ^#sNZrCIeoqmakOf->NpO*`SV_9 z(iM=u`!o9u7m(BcqC+XP7yj0&k*WhY_^5ifb5cn3?EuaGQ>cU;JD*`M^qQ(oRh>9! zezMLvA>`36&;SdLXA!#={hEWl9VOzGl5AA5d#Wm`7FAI>ZE zq1n$lI^J_K&;BZItthLg;rl|bb&k2ZV3S>4YWd&-Qm(z4Op56^CP zu)j45Ls^`=V>-&@r^KnUf%F{6D;lGuv!u3U2{w;9ae9q2PW*=C+mf37B+h<}{W@t= zUw6i&rL?8dR0aP6TbDBiMsKqpuCu4|kK?(U{Un;BiSon@o)xcgj`GxuR^N_;PsiC) z?la#$F@4seRncg)GD@?rr4CAsQY*rSfJRnoMeHf0)^oiPiyAR(k9@N;N-0Rv#!-P| z#zub>W8W>G?=if)DSdi}`wbfkJgi?vUp_Fl7<<-l*}LV~`0UYsXN0F_ELoY88uoPi zVT}DCl0B8A5tcWtq|XC1w_EMqIEbdlIV`kZ>D$`v2VCp?mmA!T+>CZ(Q+fN6_6fZE zu)}$_(52q@Es*cW*!QsKl{bkk{5g=i;*G^!IEZeY^DLnceGf!9uW-M|^>IteQ=`~e zSzcVjS=*gMoK^R4Uh~};`;NQIc>-U#q+eCgwAW@5I=*ixu}h5m?{eB)&0s z0-vnxa;^tYLF@Z=EYJFeJnLKT9288ozFj5%Bj)W+j;~Xe#7M0^=Q>X9-wvI9E7pJ? zJY@Ik{+WHGm4Bsjz`0gP@$LG}{@pJnJ>$=;0`P6WsqXA|t`U;_pP%`rU(z#;A@z0q zqp@wy)ews6;@<%48&NE9h!2JJ)b=dGL6&Mc2LywE1FWw{+1KXX0BiT!-Ca0nirnK2 za}fnL!1@}}oPPtX-MzcZcQ^12<*st}3pM=vseKhP^d0`S4$*{r8|W47T(h$Y-!CD$ zNoSuB=HE^0D^a{g^k47=vH|w|fjh|K+tc+pLn1-{ZdzaF3FfW8P}4#CNwyF44Rqt6 z=-tjdy(QL{qU?(ijowaa>|ffy z+1V`!{rh2kkrFPr9~Qo1Qq*7HPj6aAMc``mwpiFUK+ci%yt zYogmlf_@YIXP)4ECfeQC-Hk(-Xum+wZ=#>$C@#Q6yV--?<=rd0$wZr-Z9*q}EilhS z|0&8o8`1c5y>V6Zs?AQHp!D15XDQ`^HoB^HRne;YRb-=WPA~Bn_!Knz4By3^-V?)D zCpMR~RkY3Erp@UQ3Hpun(^2*b*GL;{8yDdaMrsKLzmfi9lznPmBW+!a5A&{V6-K(1 zizr~EpF*1R8)<8AYk6x!D;eoBXNyq7zY*T!QTEA*<_%gKmo8hn+1V_J{iuGD5-f=7 z(iKaKmewyNR6Ctb#9wGDyiX9SURv>n`0|p5MGfPaO|&^1MVfwKKOSWtF0@1A2EpJ5 z_OU4Y*u22juC49DA%I=aMHB$`V@Pv;U~7BveZ~ghBom2`CC(;R#-EHo7~dZI zY3#MJu~=#JgHb2CJ@V_wWM|2C92C1{PVC_B|K@|#kd*4@*;%}uEmz3kvALS*du%g#7=kDn4TcwfAq_jA_#c&a}81_E>F(>wL_kYD#TAY;X zybZyV+S2r=Kjvr`_Ckv^Qe854ktW{kefs07Iofv}-|@XRf00J2P5PEy(l7C3-qzu7 z=|nrkmp|rc+jR)@efdMGxstH#7k=>N4;o=Do1;zFk(p|rUe(D4?}s0Hu}<)|&xsA! z4c`{~(xQY^mAA!yOKNp$%bdI2x^IhpsVX5=&SL_pchcxfce^f9$JGNm1)sD$y{P{rr9rY{gJL_p#px1G~eD3=+vJ{C+ zp@LSyE-Yp*U(8-aK7X>f$DyyG!@kAmk+UC88eB-`RjGMEJGPiTZ}D@<;~z-g>)a{? z`b|ye0^PNpVV-x)zON=r3ePnyiu$r# zds}T?ZG9~*k`hKz{5RPD@Bhw#Ey!trK!8AiK!8AiK!8AiK!8AiK!8Ai!2dl2&Yey1 z{r{4*ksvwR#m@5f|Kr>2QN#$sO`L_h%ulM#iLtTXc{dJQ9wJ7iJ?cmdT*%}nc0W$o z4i%d|TIo1UJ9(sv4f=AN$+>ASKkQ050tPtY_wwr^^2L^(HV+`5Uzzl+CdjoL`Chwp z4Z;*{X^HKO;Wh9NKs3;1h!DS{iSGoR;>xyQFJcoU*o+Z-FyhbKSukbmkdEyKF0QgKs9NLTqufbO_?Ucj*X<4i5*CZIz*mMdw{x*_5jUu5|p_}3YnA?iU?rRex@i& Oh+568O6&kh(*7SD>(z$< diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json deleted file mode 100644 index 6b6114114f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ExpandedNodes": [ - "" - ], - "PreviewInSolutionExplorer": false -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/.vs/slnx.sqlite deleted file mode 100644 index 9b538ebad69051f86689708a3c34f11e6e486cb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90112 zcmeI5du$`edBAtI6e&_7hdP}^yMlA;v#%0+w-VovyBaNzqIC4>btHB6L1l&I?(oD| zqGXafTdfO3cZu8BfPpkckUtXi0km;}22I)^O;MmJP_#weM-ZS7ByReTi^46?21wha zhWkfn_PtB;DC-=>2YMx!a?7t4pcwY{AMTyHcRoyJ~sOa0osz1Y~n zMR}{(O9Q6@#M3%+AUw@XE*KDR>Mb=eorV*)LiPV=Bl`h zdn*?hpq!a=fJ#)b%IDXXmuXv9*Yde?A^eG_#ylZGU|$hBVr>UIo9?{!Ysyq|SC2)og)+aX=O{Egjm}|p)`%cQgv~6Z-!|44C#n^TzPI61JnrSH;&IMg&g)UT$2pTp{kq3FldL{-43E<~w3p6ZmSgic zrQX2?^I-O(yS24Zy1m=9(FG0T)g!w6zqgZD4)@6@sgG286}snD8oRjN5qI~iJRLkL z#T7D=lJSaKqTuy}=ELk=q*$U}EiG@026}|5m{050jn(3f4dc$E%NUs~=B1};4I}p$ zJw{d8F_0LkH*u>?9Ib2QzsrnxLg6rb?}}oFdSPnu_A9U52JML!3)B;=opcP#Q!T?# zSZ$6u%ti)|vU%i$jEnSj(ip`)T-{zX&L`4;vTI%+7!r{Z9r)Q+IF8t zOb%P8MP1cWD!mnU4^Y_5IY7By;KTQ>xzs^AZw}HHT24KO?GEBhwz!Bh>13{=>TFv1 zF=irt`@kIQlyQvCr|9PdQ-TK@;frm`rpjL}c25JB#dc?{*2b+nm`sbzkyo27@(YE< z+{SW+mkwHr$9D8#nmG9$=Ltop*`srco0M^<(`epSd|I1tt1&LSJ$1_|W~5B_)eQZd zHoQLM4qd#+-cl^5{XChY;jK1){s1@0tj&JO+3d!VINKz~e~IJ_A1$$-(DXEW7b|6I zx@kX#Y-Ma}u@;llVouG{Zi+hxq#qsDxk1)y<32wL-D9sZ=xy|M{|$fEKSeI!0|bBo z5C8%|00;m9AOHk_01)`$5;z)h4>S3rD%m{xD3&_;y=J{}`=F)lN|(t>vmxQ1rz_g? zn!weA#*S>0YM;N%Z&sD9!Sm&g*yr%TA$=xK!1AgBxJU;AV^5YA* zc5u5Qwr=B2dxNZXwRKzjIzHU2PPtsnJSx)DD^dsD{?G3nG&|9cKgSI-S3Y@>u8@^f z^~9#E?t!->+DD*29f6S+t0fXyxtnAWadZXiTohlQPEHtRQD&(U_E!g={)0 zl9Gs|m`=upSUs6Z)#|l+B%K!Ix|B|4qgf#%i==h6ge27DL{f;Rl5(sj)l>CURKRj3 zN|>jGcqEw=5-BMvWa~IWT9=ZfY%(5+M`Rwnn-ICxlup851IzNF)}C zNLewJ66&$ITuatsLRyYw)V>qbk*wBtwG>XoC83^9N||&mBFJ)*z^tbtLN-PEPLk_# zB$Xj8kHv_Pj8jn@BkIanNZ^<#h|xG{M=TbtMblYA9?uN97$Kf-VX=edwbsVIOut0Z z^O5L$EE0?Ik?iG2^m05g#k!c8P??;-?26j1Y;-O@m!#`|7y1f={tJBvy+OXf2M7QG zAOHk_01yBIKmZ5;0U!VbfB+EqKoB_V;sjQCZpHFoB^u|ru$OE_DUau>4~?B2(giJ# z%1n*2+%&80Wx0K%MQ*gspl_pJLa(DgM%(DSABaYR5f z00bUF0_V6qt38Widt^m>u*FT&@AJIL@FX|Sc0Fw3n&z&seI7L7&XTpi^TB|jAUET+ zJp@3{|EK)d81x_Lo9GYFFQQ$vfo4!3@Poh`f!_^$CU85j5=aIn{r~O%d;iz`pZD(& zVfX+6AOHk_01yBIKmZ5;0U!VbKEwphPq~?-*X!2Sc>1pj%zd=I*BtrQPyY73Yk!)Z zpL8>8jMu%5(AG{eW{zW95Oo^>-%*fMPE zNz)TW_}9MD%hj zRb2GBnI)2EowT_#sDeqao0&F*jp9QiYQ1V1mclQ2+)Rt-gH5%=7kwqlcu z%-_)S|Ea(g2E9Z60>HP>SI}>w&!Pi#8*QR&;0g+(X|faWcHqsxp9j7a_*~$Xz|RFL zA7VF$rUL;W00e*l5C8%|00;m9AOHkDj07IxlKPRhZM$RY0=LEv+~b%;+!Ge5?X%zY{;|x6qx5p95aeCIR#+sWI!7=VJEpl!f1-Qrc3z8x51b3a)_YnGQ z!ub8%IYVZ9jH;{WASH}G&MlGF-)F1AH%cC}S0%Q+v@CN|;XGGl@4u7ap~~yq2X3mo zxo0r^B)7sE3;#aayJ#LmXqyXi7tBkd|B#!T@REH1W&Mvn&7l87KS19jPXWA*-a`LO zb^`tmeS`cxfImZjg8m476@3}~4*CN64fJ`kJMifbqp?GqfdCKy0zd!=00AHX1b_e# z00KY&2)xe(T%4Dka&ZhhNdxlB{tP=ogEKT3r$LYghz0=~_-QakgHamzXyB#62n{?m zaMNIz1}++KG#KJI#;czHUtrMxqJKsIfWCx&4gE4|qAgTH^MMQKBM1flJ@Df00e*l5C8%|00?|g2t4XadV3%B|F~<7v7FlX zIgFkRx}LC#ZJ#~knz2TZ1L=vgu8WN0Xn*_6lxyA@No2<-U4kBMIq>(p9@AsVi9d2Z zZd{Q(fhS$p8RG=MkD~s7>zpaHJ*MbwJ@r5DT4Dwq`;WP%b&+kaQl5G6|Aec^=qLGo zRPZRRFpmC}R#?vdFSu41^B})Z87?K4<@A5tb-|L09{+n>6AV57r@#NtqQ7LwKllIv zAOHk_01yBIKmZ5;0U!VbfB+Bx0v~h&N%DffjhW-T$1s|ji_FEN(P(Tg7N_U`EP8_> z|KI}zfB+Bx0zd!=00AHX1b_e#00KY&2z=lPBwZUb-uJxzr|17D@I40oC;BJy`~F`; zzlDAU-9`K8XVEgcjAqdka*<^C00AHX1b_e#00KY&2mk>f00e*l5O~N41j)+_STE}y z;ppGMKZ-xL6(p}MpfSU0Oziu`AbDK@jX9&md?OJgZzP~G0WIeBCxhfw1T^NX7W1)p zgX9eaG-gPPx%F0%yk>yLOlUE&zYUT%4A2Iaw9Yx_s}p%wl!GRJ50k-7Yz|dL-&x2W4&Ya{GSOv zoKQe(AOHk_01yBIKmZ5;0U!VbfB+Bx0zlw+1nBuctpAV43Z#Gl5C8%|00;m9AOHk_ z01yBIKmZ6ltOQ{F|FHHP=nVvb01yBIKmZ5;0U!VbfB+Bx0zlyS1mOAq`|8M>9?pG(`_#}o zL#3goAJ*1^-aiTgt}ln45!j;}ji!uWEFbRH_I4IJ)R>V3(ZPWGg`GDCNU;2k#mPolz7eZ{|J;%jG>ur2bjjd!c^= zbfNs-&cSZ8Th8wbAI*tDL7{LGG}t%ax6aQ z%tLIiyY_1M-iA-{xRmKJ!vii(1JWlJ-UOIPKj?LqgdIuZK zgV~Gj*49Sp_HNTg7c`7lkLdFM-cDXQ+$W=?K2qsb=$=<;?BaGu+}*G8bnvJYSI9_8 z#w%)xg4Yw853_fXVu^aSw7e}E=n<-7KCN3fR*N?_j607mV`Q?Jm!76IjND`N7*%D* zKw_lc#H}`Qw62l=E;Hf@g~RNh&5;Jx*rYWtTmkP(jeU%xTD5>tYKxJ6m+vcBYN=>_4ZJwFFC7I>qROq1WB{ z61klzDmXJxTRyt#_Jp1zBj2Gp@>#r4tGYXFBBGY8_N}5 zI%p{#+tG(<;^cdrClsA#kIpG>QpTN5qj_8LX>Go(#<=YE)Geo&kuu#^GxT%X@cNKD zbnzm4OR=2x^JI>Ox7zsm1KcFDHv1)Kvl~a^Y?B!OC6Y6Iw8VNs)6?u-tdyzgru`VQ zm9eSCT1-xhIW&w?!Ry?bH7d^PyO?9 z@T_N25Jp~o=1v2@Kc8|7Kl3v)Jo&LcXEc+v!`kZ3 zwwYILpQ9_O^tvfiTwNur(5K0|vx@|kTr87iy(vu^)1#N3vg$(z9UVIva{NBMcgu4> zamk@~+b|5j?|#Z2M@gb;Ki#_fh#2TKvP|x6EPS!7Ok|H{Cp@9eFne^%F{@Y*J7V8e zkjaONP1%Q1dt%=*dfujKade(m43+kT zlZ}{W8HTFnEmpf>nZ|X3+w23by!FYlwRQS3$9C7(1=VKUZztt`D=G6fFnAt+f@zI* zv#AuGwQn3%#MW)x>2(+Cvs07bYj*I9$H_q#4zY2v>kzl?Iw;e_60T!17)W@__(ttP z-*_}_!$>~c&shwK-bM9v7b6epE#teY09i1^f`gP^!27rUTHog3-x8LhI20Pk&-m-M^ ze1AtGvpFZ(0yJ=I25Rc|qg{yD^r92ODsK!geFl#o;%H;+JlXf9v^}RM10Fd1DAF?> z%h2LHwCKB1gToIv{5a80#{*8m^mC05-{A-R{{N|OazKSZ00;m9AOHk_01yBIKmZ5; z0U!VbPMrX(|4$t`R0srs01yBIKmZ5;0U!VbfB+Bx0zlx@3Bcd~J9XqxArJrpKmZ5; z0U!VbfB+Bx0zd!=0D)5{0O$XwjvOik0zd!=00AHX1b_e#00KY&2mk>faOwp9A7gDo Ay8r+H From dae2ddaec239a2c06c0f20e4d7ccc5516686c040 Mon Sep 17 00:00:00 2001 From: alexmontAmazon <85521892+alexmontAmazon@users.noreply.github.com> Date: Wed, 7 Jul 2021 13:49:55 -0700 Subject: [PATCH 094/156] fix for [LYN-4828], message box style changes (#1911) * fix for [LYN-4828], message box style changes Signed-off-by: Alex Montgomery * now with missing .qss file! Friends don't let friends git add -u Signed-off-by: Alex Montgomery --- .../AzQtComponents/Components/Style.cpp | 4 ++++ .../Components/Widgets/BaseStyleSheet.qss | 1 + .../Components/Widgets/MessageBox.qss | 21 +++++++++++++++++++ .../AzQtComponents/Components/resources.qrc | 9 ++++---- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.qss diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp index 4146d1d537..15240c3975 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp @@ -1289,6 +1289,10 @@ namespace AzQtComponents } break; + case QStyle::SP_MessageBoxInformation: + return QIcon(QString::fromUtf8(":/stylesheet/img/UI20/Info.svg")); + break; + default: break; } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/BaseStyleSheet.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/BaseStyleSheet.qss index 894b2921d4..3499404572 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/BaseStyleSheet.qss +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/BaseStyleSheet.qss @@ -123,6 +123,7 @@ QPlainTextEdit:focus @import "LineEdit.qss"; @import "Menu.qss"; @import "MenuBar.qss"; +@import "MessageBox.qss"; @import "ProgressBar.qss"; @import "PushButton.qss"; @import "QDockWidget.qss"; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.qss new file mode 100644 index 0000000000..81aa7fd8d8 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.qss @@ -0,0 +1,21 @@ + +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + /* correct the padding around the two main labels to give space at the borders */ +QMessageBox QLabel#qt_msgbox_label +{ + padding-top: 20px; + padding-right: 20px; + padding-bottom: 20px; +} + +QMessageBox QLabel#qt_msgboxex_icon_label +{ + padding-left: 20px; + padding-top: 20px; +} diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc index 904be3897f..642fc72745 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc @@ -354,17 +354,17 @@ img/UI20/toolbar/Grid.svg img/UI20/toolbar/Lighting.svg img/UI20/toolbar/Load.svg - img/UI20/toolbar/Local.svg + img/UI20/toolbar/Local.svg img/UI20/toolbar/Locked.svg img/UI20/toolbar/Locked_Status.svg - img/UI20/toolbar/LUA.svg + img/UI20/toolbar/LUA.svg img/UI20/toolbar/Material.svg img/UI20/toolbar/Measure.svg img/UI20/toolbar/Move.svg img/UI20/toolbar/Object_follow_terrain.svg img/UI20/toolbar/Object_height.svg img/UI20/toolbar/Object_list.svg - img/UI20/toolbar/Parent.svg + img/UI20/toolbar/Parent.svg img/UI20/toolbar/particle.svg img/UI20/toolbar/Play.svg img/UI20/toolbar/Redo.svg @@ -383,7 +383,7 @@ img/UI20/toolbar/undo.svg img/UI20/toolbar/Unlocked.svg img/UI20/toolbar/Vertex_snapping.svg - img/UI20/toolbar/World.svg + img/UI20/toolbar/World.svg img/UI20/toolbar/X_axis.svg img/UI20/toolbar/Y_axis.svg img/UI20/toolbar/Z_axis.svg @@ -457,6 +457,7 @@ Widgets/ComboBoxConfig.ini Widgets/Menu.qss Widgets/MenuBar.qss + Widgets/MessageBox.qss Widgets/ProgressBarConfig.ini Widgets/ProgressBar.qss Widgets/PushButton.qss From 274669a1b43ec2ff79479db729161ae62518cded Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 7 Jul 2021 16:05:38 -0500 Subject: [PATCH 095/156] Fixed Vegetation Debugger to work with Atom rendering and AZ::Console. (#1924) The previous implementation used Cry rendering and CVars and had been left in a commented-out state. These changes restore it back to full functionality. Signed-off-by: mbalfour --- .../Code/Source/Debugger/DebugComponent.cpp | 201 +++++++++++------- .../Code/Source/Debugger/DebugComponent.h | 12 +- 2 files changed, 132 insertions(+), 81 deletions(-) diff --git a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp index c24c380d6f..5fa2d6fd88 100644 --- a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp +++ b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp @@ -10,7 +10,10 @@ #include "AreaSystemComponent.h" #include "InstanceSystemComponent.h" +#include +#include #include +#include #include #include #include @@ -22,11 +25,6 @@ #include #include -#include -#include -#include -#include - #include namespace Vegetation @@ -112,18 +110,16 @@ void DebugComponent::Activate() DebugRequestBus::Handler::BusConnect(); DebugNotificationBus::Handler::BusConnect(); DebugNotificationBus::AllowFunctionQueuing(true); - AzFramework::DebugDisplayEventBus::Handler::BusConnect(); + AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); SystemConfigurationRequestBus::Handler::BusConnect(); - AddConsoleVariables(); VEG_PROFILE_METHOD(DebugSystemDataBus::BroadcastResult(m_debugData, &DebugSystemDataBus::Events::GetDebugData)); } void DebugComponent::Deactivate() { - RemoveConsoleVariables(); SystemConfigurationRequestBus::Handler::BusDisconnect(); - AzFramework::DebugDisplayEventBus::Handler::BusDisconnect(); + AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); DebugRequestBus::Handler::BusDisconnect(); DebugNotificationBus::Handler::BusDisconnect(); @@ -153,7 +149,7 @@ bool DebugComponent::WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const return false; } -void DebugComponent::DrawGlobalDebugInfo() +void DebugComponent::DisplayEntityViewport(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { // time to collect the report? if (AZStd::chrono::microseconds(AZStd::chrono::system_clock::now() - m_lastCollectionTime).count() > m_configuration.m_collectionFrequencyUs) @@ -173,23 +169,25 @@ void DebugComponent::DrawGlobalDebugInfo() m_exportCurrentReport = false; } + if (m_configuration.m_showVisualization) + { + DrawSectorTimingData(viewportInfo, debugDisplay); + } + if (m_configuration.m_showDebugStats) { - DrawDebugStats(); + DrawDebugStats(debugDisplay); } if (m_configuration.m_showInstanceVisualization) { - DrawInstanceDebug(); + DrawInstanceDebug(debugDisplay); } } -void DebugComponent::DrawInstanceDebug() +void DebugComponent::DrawInstanceDebug(AzFramework::DebugDisplayRequests& debugDisplay) { #if defined(VEG_PROFILE_ENABLED) - // ToDo: Re-implement with Atom. LYN-3681 - /*renderAuxGeom->SetRenderFlags(e_Mode3D | e_FillModeSolid | e_CullModeBack | e_DepthWriteOff | e_DepthTestOn); - AZStd::unordered_map areaDebugDisplayDataMap; for (const auto& instance : m_activeInstances) @@ -213,16 +211,87 @@ void DebugComponent::DrawInstanceDebug() { continue; } - - Vec3 pos(AZVec3ToLYVec3(instanceData.m_position)); - Vec3 radius(areaDebugDisplayData.m_instanceSize * 0.5f); - AABB bounds(pos - radius, pos + radius); - renderAuxGeom->DrawAABB(bounds, true, ColorB(areaDebugDisplayData.m_instanceColor.ToU32()), eBBD_Faceted); - }*/ + AZ::Vector3 radius(areaDebugDisplayData.m_instanceSize * 0.5f); + debugDisplay.SetColor(areaDebugDisplayData.m_instanceColor); + debugDisplay.DrawSolidBox(instanceData.m_position - radius, instanceData.m_position + radius); + } #endif } +void DebugComponent::DrawSectorTimingData(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) +{ + static const AZ::Color s_green = AZ::Color(0.3f, 0.9f, 0.3f, .05f); + static const AZ::Color s_yellow = AZ::Color(1.0f, 1.0f, 0.0f, .05f); + static const AZ::Color s_red = AZ::Color(1.0f, 0.0f, 0.0f, .05f); + static const float boxHeightAboveTerrain = 3.0f; + + + AreaSystemConfig areaConfig; + SystemConfigurationRequestBus::Broadcast(&SystemConfigurationRequestBus::Events::GetSystemConfig, &areaConfig); + const auto sectorSizeInMeters = areaConfig.m_sectorSizeInMeters; + const AZ::u32 maxTextDisplayDistance = m_configuration.m_maxLabelDisplayDistance; + const int maxDisplayCount = m_configuration.m_maxDatapointDisplayCount; + + AZ::Vector3 cameraPos(0.0f); + if (auto viewportContextRequests = AZ::RPI::ViewportContextRequests::Get(); viewportContextRequests) + { + AZ::RPI::ViewportContextPtr viewportContext = viewportContextRequests->GetViewportContextById(viewportInfo.m_viewportId); + cameraPos = viewportContext->GetCameraTransform().GetTranslation(); + } + AZ::Vector2 cameraPos2d(cameraPos.GetX(), cameraPos.GetY()); + + for (int i = 0; i < maxDisplayCount && i < m_currentSortedTimingList.size(); ++i) + { + const auto& sectorTiming = m_currentSortedTimingList[i]; + + AZ::Vector3 topCorner{ float(sectorTiming.m_id.first), float(sectorTiming.m_id.second), 0.0f }; + topCorner *= float(sectorSizeInMeters); + + AZ::Vector3 bottomCorner = topCorner + + AZ::Vector3(float(sectorSizeInMeters), float(sectorSizeInMeters), sectorTiming.m_worldPosition.GetZ() + boxHeightAboveTerrain); + + auto aabb = AZ::Aabb::CreateFromMinMax(topCorner, bottomCorner); + const AZ::Color* color = &s_yellow; + + if (sectorTiming.m_averageTimeUs >= m_configuration.m_maxThresholdUs) + { + color = &s_red; + } + else if (sectorTiming.m_averageTimeUs < m_configuration.m_minThresholdUs) + { + color = &s_green; + } + + AZ::Color outlineColor(color->GetR(), color->GetG(), color->GetB(), 1.0f); + + // Box around the entire sector + debugDisplay.SetColor(*color); + debugDisplay.DrawSolidBox(aabb.GetMin(), aabb.GetMax()); + debugDisplay.SetColor(outlineColor); + debugDisplay.DrawWireBox(aabb.GetMin(), aabb.GetMax()); + + // Smaller box inside the sector + const AZ::Vector3 innerBoxRadius(0.5f); + debugDisplay.SetColor(outlineColor); + debugDisplay.DrawSolidBox(sectorTiming.m_worldPosition - innerBoxRadius, sectorTiming.m_worldPosition + innerBoxRadius); + + AZ::Vector2 sectorPos2d(sectorTiming.m_worldPosition.GetX(), sectorTiming.m_worldPosition.GetY()); + float distanceToCamera = cameraPos2d.GetDistance(sectorPos2d); + + if (distanceToCamera <= maxTextDisplayDistance) + { + AZStd::string displayString = AZStd::string::format("Sector %d, %d\nTime: %dus\nUpdate Count: %d", sectorTiming.m_id.first, + sectorTiming.m_id.second, static_cast(sectorTiming.m_averageTimeUs), sectorTiming.m_updateCount); + + constexpr bool centerText = true; + constexpr float fontSize = 1.5f; + debugDisplay.SetColor(AZ::Color(1.0f)); + debugDisplay.DrawTextLabel(sectorTiming.m_worldPosition, fontSize, displayString.c_str(), centerText); + } + } +} + void DebugComponent::CopyReportToSortedList() { m_currentSortedTimingList.clear(); @@ -885,23 +954,9 @@ void DebugComponent::PrepareNextReport() }); } -void DebugComponent::RemoveConsoleVariables() +void DebugComponent::DrawDebugStats(AzFramework::DebugDisplayRequests& debugDisplay) { - ISystem* crySystem = GetISystem(); - if (crySystem && crySystem->GetIConsole()) - { - IConsole* console = crySystem->GetIConsole(); - console->RemoveCommand("veg_debugToggleVisualization"); - console->RemoveCommand("veg_debugDumpReport"); - console->RemoveCommand("veg_debugRefreshAllAreas"); - console->RemoveCommand("veg_debugClearAllAreas"); - } -} - -void DebugComponent::DrawDebugStats() -{ - // ToDo: Re-implement with Atom. LYN-3681 - /*if (!m_debugData) + if (!m_debugData) { return; } @@ -915,52 +970,48 @@ void DebugComponent::DrawDebugStats() AZ::u32 destroyTaskCount = 0; InstanceSystemStatsRequestBus::BroadcastResult(destroyTaskCount, &InstanceSystemStatsRequestBus::Events::GetDestroyTaskCount); - renderAuxGeom->Draw2dLabel(4, 16, 1.5f, ColorF(1, 1, 1), false, - AZStd::string::format("VegetationSystemStats:\nActive Instances Count: %d\nInstance Register Queue: %d\nInstance Unregister Queue: %d\nThread Queue Count: %d\nThread Processing Count: %d", - instanceCount, - createTaskCount, - destroyTaskCount, - m_debugData->m_areaTaskQueueCount.load(AZStd::memory_order_relaxed), - m_debugData->m_areaTaskActiveCount.load(AZStd::memory_order_relaxed) - ).c_str());*/ + debugDisplay.SetColor(AZ::Color(1.0f)); + debugDisplay.Draw2dTextLabel( + 4.0f, 16.0f, 1.5f, + AZStd::string::format( + "VegetationSystemStats:\nActive Instances Count: %d\nInstance Register Queue: %d\nInstance Unregister Queue: %d\nThread " + "Queue Count: %d\nThread Processing Count: %d", + instanceCount, createTaskCount, destroyTaskCount, m_debugData->m_areaTaskQueueCount.load(AZStd::memory_order_relaxed), + m_debugData->m_areaTaskActiveCount.load(AZStd::memory_order_relaxed)) + .c_str(), + false); } -void DebugComponent::AddConsoleVariables() +namespace { - ISystem* crySystem = GetISystem(); - if (crySystem && crySystem->GetIConsole()) + static void veg_debugToggleVisualization([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) { - IConsole* console = crySystem->GetIConsole(); - - static auto fnCmdToggleDebugger = []([[maybe_unused]] IConsoleCmdArgs* args) - { - DebugNotificationBus::Broadcast(&DebugNotificationBus::Events::ToggleVisualization); - }; - console->AddCommand("veg_debugToggleVisualization", fnCmdToggleDebugger, VF_NULL, "Toggles visualization of sector timings"); + DebugNotificationBus::Broadcast(&DebugNotificationBus::Events::ToggleVisualization); + } + AZ_CONSOLEFREEFUNC(veg_debugToggleVisualization, AZ::ConsoleFunctorFlags::DontReplicate, "Toggles visualization of sector timings"); - static auto fnCmdDumpReport = []([[maybe_unused]] IConsoleCmdArgs* args) - { - DebugNotificationBus::Broadcast(&DebugNotificationBus::Events::ExportCurrentReport); - }; - console->AddCommand("veg_debugDumpReport", fnCmdDumpReport, VF_NULL, "Writes out a vegetation sector report"); + static void veg_debugDumpReport([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) + { + DebugNotificationBus::Broadcast(&DebugNotificationBus::Events::ExportCurrentReport); + } + AZ_CONSOLEFREEFUNC(veg_debugDumpReport, AZ::ConsoleFunctorFlags::DontReplicate, "Writes out a vegetation sector report"); - static auto fnRefreshAllAreas = []([[maybe_unused]] IConsoleCmdArgs* args) - { - AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::RefreshAllAreas); - }; - console->AddCommand("veg_debugRefreshAllAreas", fnRefreshAllAreas, VF_NULL, "Refresh all vegetation areas in the current view"); + static void veg_debugRefreshAllAreas([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) + { + AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::RefreshAllAreas); + } + AZ_CONSOLEFREEFUNC( + veg_debugRefreshAllAreas, AZ::ConsoleFunctorFlags::DontReplicate, "Refresh all vegetation areas in the current view"); - static auto fnClearAllAreas = []([[maybe_unused]] IConsoleCmdArgs* args) - { - AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::ClearAllAreas); - AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::RefreshAllAreas); - }; - console->AddCommand("veg_debugClearAllAreas", fnClearAllAreas, VF_NULL, "Clear and refresh all vegetation areas in the current view"); + static void veg_debugClearAllAreas([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) + { + AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::ClearAllAreas); + AreaSystemRequestBus::Broadcast(&AreaSystemRequestBus::Events::RefreshAllAreas); } -} + AZ_CONSOLEFREEFUNC( + veg_debugClearAllAreas, AZ::ConsoleFunctorFlags::DontReplicate, "Clear and refresh all vegetation areas in the current view"); + -namespace -{ const char* GetSortTypeString(DebugRequests::SortType sortType) { switch (sortType) diff --git a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.h b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.h index 6362d98371..224ad5ded5 100644 --- a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.h +++ b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.h @@ -54,7 +54,7 @@ namespace Vegetation class DebugComponent : public AZ::Component - , private AzFramework::DebugDisplayEventBus::Handler + , private AzFramework::EntityDebugDisplayEventBus::Handler , private DebugRequestBus::Handler , private DebugNotificationBus::Handler , private SystemConfigurationRequestBus::Handler @@ -79,7 +79,8 @@ namespace Vegetation ////////////////////////////////////////////////////////////////////////// // EntityDebugDisplayEventBus - void DrawGlobalDebugInfo() override; + void DisplayEntityViewport( + const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) override; ////////////////////////////////////////////////////////////////////////// // DebugNotifications @@ -112,10 +113,9 @@ namespace Vegetation protected: void PrepareNextReport(); void CopyReportToSortedList(); - void AddConsoleVariables(); - void RemoveConsoleVariables(); - void DrawDebugStats(); - void DrawInstanceDebug(); + void DrawSectorTimingData(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); + void DrawDebugStats(AzFramework::DebugDisplayRequests& debugDisplay); + void DrawInstanceDebug(AzFramework::DebugDisplayRequests& debugDisplay); private: AZStd::atomic_bool m_exportCurrentReport{ false }; From af8e6afc6a5fea4e37c2128821e89404e5e7fc36 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Wed, 7 Jul 2021 14:31:45 -0700 Subject: [PATCH 096/156] Update README LFS instructions (#1925) Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com> --- README.md | 98 +++++++++++-------------------------------------------- 1 file changed, 19 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 9cc816efe9..6b88097739 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,33 @@ -## Updates to this readme -July 06, 2021 -- Switch licenses to APACHE-2.0 OR MIT +# Open 3D Engine -May 14, 2021 -- Removed instructions for the 3rdParty zip file and downloader URL. This is no longer a requirement. -- Updated instructions for dependencies -- Links to full documentation +Open 3D Engine (O3DE) is an open-source, real-time, multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations. -April 7-13, 2021 -- Updates to the 3rdParty zip file - -March 25, 2021 -- Initial commit for instructions +## Contribute +For information about contributing to Open 3D Engine, visit https://o3de.org/docs/contributing/ ## Download and Install -This repository uses Git LFS for storing large binary files. You will need to create a Github personal access token to authenticate with the LFS service. - -To install Git LFS, download the binary here: https://git-lfs.github.com/. +This repository uses Git LFS for storing large binary files. -After installation, you will need to install the necessary git hooks with this command +Verify you have Git LFS installed by running the following command to print the version number. ``` -git lfs install +git lfs --version ``` -### Create a Git Personal Access Token - -You will need your personal access token credentials to authenticate when you clone the repository and when downloading objects from Git LFS - -[Create a personal access token with the 'repo' scope.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) - -During the clone operation, you will be prompted to enter a password. Your token will be used as the password. You will also be prompted a second time for Git LFS. - -### (Recommended) Verify you have a credential manager installed to store your credentials +If Git LFS is not installed, download and run the installer from: https://git-lfs.github.com/. -Recent versions of Git install a credential manager to store your credentials so you don't have to put in the credentials for every request. - -It is highly recommended you check that you have a [credential manager installed and configured](https://github.com/microsoft/Git-Credential-Manager-Core) - -For Linux and Mac, use the following commands to store credentials - -Linux: +### Install Git LFS hooks ``` -git config --global credential.helper cache -``` -Mac: -``` -git config --global credential.helper osxkeychain +git lfs install ``` + ### Clone the repository ```shell -> git clone https://github.com/o3de/o3de.git -Cloning into 'o3de'... - -# initial prompt for credentials to download the repository code -# enter your Github username and personal access token - -remote: Counting objects: 29619, done. -Receiving objects: 100% (29619/29619), 40.50 MiB | 881.00 KiB/s, done. -Resolving deltas: 100% (8829/8829), done. -Updating files: 100% (27037/27037), done. - -# second prompt for credentials when downloading LFS files -# enter your Github username and personal access token - -Filtering content: 100% (3853/3853), 621.43 MiB | 881.00 KiB/s, done. - +git clone https://github.com/o3de/o3de.git ``` -If you have the Git credential manager core or other credential helpers installed, you should not be prompted for your credentials anymore. - ## Building the Engine ### Build Requirements and redistributables #### Windows @@ -85,33 +41,21 @@ If you have the Git credential manager core or other credential helpers installe #### Optional -* WWise - 2019.2.8.7432 minimum: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) - * Note: This requires registration and installation of a client to download - * You will also need to set a environment variable: `set LY_WWISE_INSTALL_PATH=` - * For example: `set LY_WWISE_INSTALL_PATH="C:\Program Files (x86)\Audiokinetic\Wwise 2019.2.8.7432"` +* Wwise - 2021.1.1.7601 minimum: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) + * Note: This requires registration and installation of a client application to download + * Make sure to select the SDK(C++) component during installation of Wwise + * You will also need to set an environment variable: `set LY_WWISE_INSTALL_PATH=` + * For example: `set LY_WWISE_INSTALL_PATH="C:\Program Files (x86)\Audiokinetic\Wwise 2021.1.1.7601"` ### Quick Start Build Steps 1. Create a writable folder to cache 3rd Party dependencies. You can also use this to store other redistributable SDKs. - > For the 0.5 branch - Create an empty text file named `3rdParty.txt` in this folder, to allow a legacy CMake validator to pass - 1. Install the following redistributables to the following: - Visual Studio and VC++ redistributable can be installed to any location - CMake can be installed to any location, as long as it's available in the system path - - WWise can be installed anywhere, but you will need to set an environment variable for CMake to detect it: `set LY_WWISE_INSTALL_PATH=` + - (Optional) Wwise can be installed anywhere, but you will need to set an environment variable for CMake to detect it: `set LY_WWISE_INSTALL_PATH=` -1. Navigate into the repo folder, then download the python runtime with this command - - > For the 0.5 branch - Set this environment variable prior to the `get_python` command below: - > ``` - > set LY_PACKAGE_SERVER_URLS=https://d2c171ws20a1rv.cloudfront.net - > ``` - - ``` - python\get_python.bat - ``` - 1. Configure the source into a solution using this command line, replacing and <3rdParty cache path> to a path you've created: ``` cmake -B -S -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty cache path> -DLY_UNITY_BUILD=ON -DLY_PROJECTS=AutomatedTesting @@ -139,7 +83,7 @@ If you have the Git credential manager core or other credential helpers installe ``` scripts\o3de.bat register --this-engine ``` -1. Setup new projects using the `o3de create-project` command. In the 0.5 branch, the project directory must be a subdirectory in the repo folder. +1. Setup new projects using the `o3de create-project` command. ``` \scripts\o3de.bat create-project --project-path ``` @@ -151,10 +95,6 @@ If you have the Git credential manager core or other credential helpers installe ``` cmake -B -S -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty cache path> - // For the 0.5 branch, you must build a new Editor for each project: - cmake --build --target .GameLauncher Editor --config profile -- /m - - // For all other branches, just build the project: cmake --build --target .GameLauncher --config profile -- /m ``` From f9f711c039049f590a34000ad84c6a4d0b3e1b15 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:26:11 -0500 Subject: [PATCH 097/156] Removing superfluous whitespace. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../Libraries/Core/BinaryOperator.h | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h index 0558decaeb..64e59b593d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -23,7 +23,7 @@ namespace ScriptCanvas AZ_COMPONENT(BinaryOperator, "{5BD0E8C7-9B0A-42F5-9EB0-199E6EC8FA99}", Node); static void Reflect(AZ::ReflectContext* reflection); - + static const char* k_lhsName; static const char* k_rhsName; static const char* k_resultName; @@ -31,7 +31,7 @@ namespace ScriptCanvas static const char* k_evaluateName; static const char* k_outName; static const char* k_onTrue; - static const char* k_onFalse; + static const char* k_onFalse; protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override @@ -47,7 +47,7 @@ namespace ScriptCanvas SlotId GetOutputSlotId() const; }; - + class ArithmeticExpression : public BinaryOperator { @@ -57,20 +57,20 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* reflection); bool IsDeprecated() const override { return true; } - + void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; protected: // adds Number inputs, adds Number output type void OnInit() override; }; - + class BooleanExpression : public BinaryOperator { public: AZ_COMPONENT(BooleanExpression, "{36C69825-CFF8-4F70-8F3B-1A9227E8BEEA}", BinaryOperator); - + static void Reflect(AZ::ReflectContext* reflection); ////////////////////////////////////////////////////////////////////////// @@ -93,20 +93,20 @@ namespace ScriptCanvas ////////////////////////////////////////////////////////////////////////// protected: - // initialize boolean expression, adds boolean output type calls + // initialize boolean expression, adds boolean output type calls void OnInit() override; - virtual void InitializeBooleanExpression(); + virtual void InitializeBooleanExpression(); }; // accepts any type, checks for type equality, and then value equality or pointer equality class EqualityExpression - : public BooleanExpression + : public BooleanExpression { public: AZ_COMPONENT(EqualityExpression, "{78D20EB6-BA07-4071-B646-7C2D68A0A4A6}", BooleanExpression); - + static void Reflect(AZ::ReflectContext* reflection); - + protected: // adds any required input types void InitializeBooleanExpression() override; @@ -125,10 +125,10 @@ namespace ScriptCanvas AZ_COMPONENT(ComparisonExpression, "{82C50EAD-D3DD-45D2-BFCE-981D95771DC8}", EqualityExpression); static void Reflect(AZ::ReflectContext* reflection); - + protected: // adds number types - void InitializeBooleanExpression() override; + void InitializeBooleanExpression() override; }; - } -} + } +} From 3be4c9a3938188de168ea533b47a2cb56440d5c9 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 7 Jul 2021 16:25:26 -0500 Subject: [PATCH 098/156] Removing extra whitespace from the ScriptCanvas Node Library files Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../Asset/RuntimeAssetSystemComponent.cpp | 4 +- .../Framework/ScriptCanvasTraceUtilities.h | 2 +- .../ScriptCanvas/Components/EditorGraph.h | 24 ++++---- .../Code/Include/ScriptCanvas/Core/GraphBus.h | 6 +- .../Libraries/Core/EBusEventHandler.cpp | 16 ++--- .../Libraries/Core/EBusEventHandler.h | 24 ++++---- .../Libraries/Core/ExtractProperty.cpp | 4 +- .../Libraries/Core/ExtractProperty.h | 2 +- .../Libraries/Core/GetVariable.cpp | 2 +- .../ScriptCanvas/Libraries/Core/GetVariable.h | 2 +- .../ScriptCanvas/Libraries/Core/Method.cpp | 26 ++++----- .../ScriptCanvas/Libraries/Core/Method.h | 6 +- .../Libraries/Core/MethodUtility.cpp | 4 +- .../Libraries/Core/MethodUtility.h | 2 +- .../Libraries/Core/ReceiveScriptEvent.cpp | 14 ++--- .../Libraries/Core/ReceiveScriptEvent.h | 8 +-- .../ScriptCanvas/Libraries/Core/Repeater.cpp | 2 +- .../ScriptCanvas/Libraries/Core/Repeater.h | 2 +- .../Libraries/Core/ScriptEventBase.cpp | 4 +- .../Libraries/Core/ScriptEventBase.h | 2 +- .../Libraries/Core/SendScriptEvent.cpp | 14 ++--- .../ScriptCanvas/Libraries/Core/SetVariable.h | 6 +- .../Libraries/Core/UnaryOperator.h | 4 +- .../ScriptCanvas/Libraries/Entity/Entity.cpp | 2 +- .../ScriptCanvas/Libraries/Libraries.h | 2 +- .../ScriptCanvas/Libraries/Logic/Any.cpp | 2 +- .../ScriptCanvas/Libraries/Logic/Any.h | 6 +- .../ScriptCanvas/Libraries/Logic/Break.h | 4 +- .../ScriptCanvas/Libraries/Logic/Cycle.h | 2 +- .../ScriptCanvas/Libraries/Logic/Gate.h | 2 +- .../ScriptCanvas/Libraries/Logic/IsNull.cpp | 2 +- .../ScriptCanvas/Libraries/Logic/Logic.cpp | 4 +- .../ScriptCanvas/Libraries/Logic/Not.h | 2 +- .../ScriptCanvas/Libraries/Logic/Once.h | 2 +- .../Libraries/Logic/OrderedSequencer.cpp | 24 ++++---- .../Libraries/Logic/OrderedSequencer.h | 12 ++-- .../Libraries/Logic/Sequencer.cpp | 2 +- .../Libraries/Logic/TargetedSequencer.cpp | 24 ++++---- .../Libraries/Logic/TargetedSequencer.h | 8 +-- .../Logic/WeightedRandomSequencer.cpp | 58 +++++++++---------- .../Libraries/Logic/WeightedRandomSequencer.h | 26 ++++----- .../ScriptCanvas/Libraries/Logic/While.cpp | 6 +- .../ScriptCanvas/Libraries/Logic/While.h | 8 +-- .../ScriptCanvas/Libraries/Math/Math.cpp | 4 +- .../Libraries/Math/MathGenerics.h | 2 +- .../Libraries/Math/MathNodeUtilities.cpp | 4 +- .../Libraries/Math/MathNodeUtilities.h | 8 +-- .../ScriptCanvas/Libraries/Math/MathRandom.h | 48 +++++++-------- .../Libraries/Math/RotationNodes.h | 16 ++--- .../Include/ScriptCanvas/Libraries/Math/Sum.h | 2 +- .../Libraries/Math/TransformNodes.h | 20 +++---- .../Libraries/Math/Vector2Nodes.h | 8 +-- .../Libraries/Math/Vector3Nodes.h | 22 +++---- .../Libraries/Math/Vector4Nodes.h | 14 ++--- .../Operators/Containers/OperatorBack.cpp | 2 +- .../Operators/Containers/OperatorInsert.cpp | 2 +- .../Operators/Containers/OperatorSize.cpp | 2 +- .../Operators/Containers/OperatorSize.h | 2 +- .../Libraries/Operators/Math/OperatorAdd.cpp | 4 +- .../Operators/Math/OperatorArithmetic.cpp | 20 +++---- .../Operators/Math/OperatorArithmetic.h | 12 ++-- .../Libraries/Operators/Math/OperatorDiv.cpp | 12 ++-- .../Libraries/Operators/Math/OperatorDiv.h | 2 +- .../Operators/Math/OperatorDivideByNumber.h | 4 +- .../Libraries/Operators/Math/OperatorLerp.cpp | 10 ++-- .../Libraries/Operators/Math/OperatorLerp.h | 14 ++--- .../Operators/Math/OperatorLerpNodeable.h | 2 +- .../Math/OperatorLerpNodeableNode.cpp | 2 +- .../Operators/Math/OperatorLerpNodeableNode.h | 4 +- .../Libraries/Operators/Math/OperatorMul.cpp | 6 +- .../Libraries/Operators/Math/OperatorMul.h | 2 +- .../Libraries/Operators/Math/OperatorSub.cpp | 2 +- .../Libraries/Operators/Math/OperatorSub.h | 2 +- .../Libraries/Operators/Operator.cpp | 12 ++-- .../Libraries/Operators/Operator.h | 6 +- .../Libraries/Operators/Operators.cpp | 2 +- .../Libraries/Spawning/SpawnNodeable.h | 4 +- .../ScriptCanvas/Libraries/String/Format.cpp | 11 ---- .../ScriptCanvas/Libraries/String/Utilities.h | 2 +- .../ScriptCanvas/Libraries/Time/Countdown.h | 2 +- .../Libraries/Time/DelayNodeable.h | 6 +- .../ScriptCanvas/Libraries/Time/Duration.h | 2 +- .../Libraries/Time/DurationNodeable.h | 2 +- .../ScriptCanvas/Libraries/Time/HeartBeat.h | 2 +- .../ScriptCanvas/Libraries/Time/Time.cpp | 4 +- .../ScriptCanvas/Libraries/Time/Timer.h | 4 +- .../Libraries/Time/TimerNodeable.h | 2 +- .../Libraries/UnitTesting/AddFailure.cpp | 10 ---- .../UnitTesting/Auxiliary/Auxiliary.cpp | 14 ++--- .../UnitTesting/Auxiliary/Auxiliary.h | 14 ++--- .../UnitTesting/ExpectGreaterThanEqual.cpp | 6 +- .../Libraries/UnitTesting/ExpectTrue.h | 2 +- 92 files changed, 359 insertions(+), 380 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp index 38995f8dca..d8fe9e91ca 100644 --- a/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/RuntimeAssetSystemComponent.cpp @@ -1,8 +1,8 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT - *s + * */ #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 7b6b99d967..2ca5c0857f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -160,7 +160,7 @@ namespace ScriptCanvasEditor struct ScopedOutputSuppression { - ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) + ScopedOutputSuppression(bool suppressState = true) { AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 8b01177f79..60e1649620 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -110,12 +110,12 @@ namespace ScriptCanvasEditor , m_graphCanvasSaveVersion(GraphCanvas::EntitySaveDataContainer::CurrentVersion) , m_upgradeSM(this) {} - + ~Graph() override; void Activate() override; void Deactivate() override; - + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { ScriptCanvas::Graph::GetProvidedServices(provided); @@ -160,7 +160,7 @@ namespace ScriptCanvasEditor bool CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) override; bool IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const override; - + AZStd::string GetDataTypeString(const AZ::Uuid& typeId) override; void OnRemoveUnusedNodes() override; @@ -188,7 +188,7 @@ namespace ScriptCanvasEditor GraphCanvas::CanHandleMimeEventOutcome CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override; bool HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override; - GraphCanvas::SlotId RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason ) override; + GraphCanvas::SlotId RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason) override; void ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) override; void FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) override; @@ -212,7 +212,7 @@ namespace ScriptCanvasEditor void PostCreationEvent() override; void OnPasteBegin() override; void OnPasteEnd() override; - + void OnViewRegistered() override; ///////////////////////////////////////////////////////////////////////////////////////////// @@ -258,7 +258,7 @@ namespace ScriptCanvasEditor AZStd::vector GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier&) override; AZStd::vector GetVariableNodes(const ScriptCanvas::VariableId&) override; - + void RemoveUnusedVariables() override; bool CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) override; @@ -266,9 +266,9 @@ namespace ScriptCanvasEditor bool ConvertReferenceToVariableNode(const GraphCanvas::Endpoint& endpoint) override; void QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) override; - + bool CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) override; - + ScriptCanvas::Endpoint ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const override; GraphCanvas::Endpoint ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const override; //// @@ -326,8 +326,8 @@ namespace ScriptCanvasEditor Graph(const Graph&) = delete; void DisplayUpdateToast(); - - AZ::EntityId ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const; + + AZ::EntityId ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const; GraphCanvas::NodePropertyDisplay* CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const; @@ -363,10 +363,10 @@ namespace ScriptCanvasEditor AZ::EntityId m_wrapperNodeDropTarget; VariableComboBoxDataModel m_variableDataModel; - + WrappedNodeGroupingMap m_wrappedNodeGroupings; AZStd::vector< AZ::EntityId > m_lastGraphCanvasCreationGroup; - + AZ::Entity* m_graphCanvasSceneEntity; GraphCanvas::EntitySaveDataContainer::VersionInformation m_graphCanvasSaveVersion; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h index b01e23419c..111ee7f339 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h @@ -54,7 +54,7 @@ namespace ScriptCanvas virtual bool FindConnection(AZ::Entity*& connectionEntity, const Endpoint& firstEndpoint, const Endpoint& otherEndpoint) const = 0; virtual Slot* FindSlot(const Endpoint& endpoint) const = 0; - + //! Retrieves the Entity this Graph component is located on //! NOTE: There can be multiple Graph components on the same entity so calling FindComponent may not not return this GraphComponent virtual AZ::Entity* GetGraphEntity() const = 0; @@ -62,7 +62,7 @@ namespace ScriptCanvas //! Retrieves the Graph Component directly using the BusId virtual Graph* GetGraph() = 0; - virtual bool Connect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId,const SlotId& targetSlot) = 0; + virtual bool Connect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId, const SlotId& targetSlot) = 0; virtual bool Disconnect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId, const SlotId& targetSlot) = 0; virtual bool ConnectByEndpoint(const Endpoint& sourceEndpoint, const Endpoint& targetEndpoint) = 0; @@ -91,7 +91,7 @@ namespace ScriptCanvas virtual bool AddItem(AZ::Entity* itemEntity) = 0; //! Remove item if it is on the graph virtual bool RemoveItem(AZ::Entity* itemEntity) = 0; - + //! Retrieves a pointer the GraphData structure stored on the graph virtual GraphData* GetGraphData() = 0; virtual const GraphData* GetGraphDataConst() const = 0; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp index 1575cd2c75..d28f375707 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.cpp @@ -130,12 +130,12 @@ namespace ScriptCanvas { return IsIDRequired(); } - + bool EBusEventHandler::IsAutoConnected() const { return m_autoConnectToGraphOwner; } - + const Datum* EBusEventHandler::GetHandlerStartAddress() const { return FindDatum(GetSlotId(c_busIdName)); @@ -203,7 +203,7 @@ namespace ScriptCanvas { return AZ::Success(entry->m_eventName); } - + return AZ::Failure(); } @@ -244,7 +244,7 @@ namespace ScriptCanvas { return EventHandlerTranslationHelper::GetSlotsInExecutionThreadByType(*this, executionSlot, targetSlotType); } - + AZStd::vector EBusEventHandler::GetNonEventSlotIds() const { AZStd::vector nonEventSlotIds; @@ -311,7 +311,7 @@ namespace ScriptCanvas return true; } - const AZ::BehaviorEBusHandler::BusForwarderEvent& event = m_handler->GetEvents()[eventIndex]; + const AZ::BehaviorEBusHandler::BusForwarderEvent& event = m_handler->GetEvents()[eventIndex]; // Compare output type const bool eventHasOutput = !event.m_parameters.empty() && !event.m_parameters.front().m_typeId.IsNull() && event.m_parameters.front().m_typeId != azrtti_typeid(); @@ -451,7 +451,7 @@ namespace ScriptCanvas config.m_name = c_busIdName; config.m_toolTip = busToolTip; config.SetConnectionType(ConnectionType::Input); - + if (busId == azrtti_typeid()) { config.SetDefaultValue(GraphOwnerId); @@ -459,7 +459,7 @@ namespace ScriptCanvas else { Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId)); - + config.ConfigureDatum(AZStd::move(Datum(busIdType, Datum::eOriginality::Original))); } @@ -655,7 +655,7 @@ namespace ScriptCanvas return AZStd::find(m_parameterSlotIds.begin(), m_parameterSlotIds.end(), slotId) != m_parameterSlotIds.end(); } } - + bool EBusEventEntry::EBusEventEntryVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) { if (rootElement.GetVersion() == 0) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h index 54776f18de..4e4c3f45c4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h @@ -36,7 +36,7 @@ namespace ScriptCanvas static void Reflect(AZ::ReflectContext* context); AZ_TYPE_INFO(EBusEventEntry, "{92A20C1B-A54A-4583-97DB-A894377ACE21}"); - + AZStd::string m_eventName; EBusEventId m_eventId; SlotId m_eventSlotId; @@ -44,7 +44,7 @@ namespace ScriptCanvas AZStd::vector m_parameterSlotIds; int m_numExpectedArguments = {}; bool m_resultEvaluated = {}; - + bool m_shouldHandleEvent = false; bool m_isHandlingEvent = false; @@ -54,7 +54,7 @@ namespace ScriptCanvas }; //! Provides a node that represents an EBus handler - class EBusEventHandler + class EBusEventHandler : public Node , public EBusHandlerNodeRequestBus::Handler { @@ -68,7 +68,7 @@ namespace ScriptCanvas using Events = AZStd::vector; using EventMap = AZStd::map; - EBusEventHandler() + EBusEventHandler() : m_autoConnectToGraphOwner(true) {} @@ -79,7 +79,7 @@ namespace ScriptCanvas void OnInit() override; void OnActivate() override; void OnGraphSet() override; - + void CollectVariableReferences(AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const override; bool ContainsReferencesToVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const override; @@ -93,10 +93,10 @@ namespace ScriptCanvas void InitializeEvent(int eventIndex); - bool IsOutOfDate(const VersionData& graphVersion) const override; - + bool IsOutOfDate(const VersionData& graphVersion) const override; + bool CreateHandler(AZStd::string_view ebusName); - + const EBusEventEntry* FindEventWithSlot(const Slot& slot) const; AZ::Outcome GetFunctionCallName(const Slot* /*slot*/) const override; @@ -119,7 +119,7 @@ namespace ScriptCanvas AZStd::vector GetNonEventSlotIds() const override; AZ::Outcome GetDependencies() const override; - + bool IsEventSlotId(const SlotId& slotId) const; bool IsEventHandler() const override; @@ -129,7 +129,7 @@ namespace ScriptCanvas bool IsVariableWriteHandler() const override; bool IsValid() const; - + inline bool IsIDRequired() const { return m_ebus && BehaviorContextUtils::GetEBusAddressPolicy(*m_ebus) == AZ::EBusAddressPolicy::ById; @@ -156,11 +156,11 @@ namespace ScriptCanvas ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* executionChildSlot) const override; inline bool IsConfigured() const { return !m_eventMap.empty(); } - + private: EBusEventHandler(const EBusEventHandler&) = delete; - + EventMap m_eventMap; AZStd::string m_ebusName; ScriptCanvas::EBusBusId m_busId; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp index 574ccaeecb..e2f2627bbc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp @@ -56,7 +56,7 @@ namespace ScriptCanvas AddPropertySlots(dataType); } } - + Data::Type ExtractProperty::GetSourceSlotDataType() const { return m_dataType; @@ -81,7 +81,7 @@ namespace ScriptCanvas { return AZ::Success(DependencyReport::NativeLibrary(Data::GetName(m_dataType))); } - + PropertyFields ExtractProperty::GetPropertyFields() const { PropertyFields propertyFields; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h index 7cde7401db..d686ae0e1e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.h @@ -44,7 +44,7 @@ namespace ScriptCanvas bool IsOutOfDate(const VersionData& graphVersion) const override; //// - + protected: void OnInit() override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index fb6d2f21e7..f78a57308a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -289,7 +289,7 @@ namespace ScriptCanvas const GraphVariableMapping* variableMap = nullptr; GraphRequestBus::EventResult(variableMap, GetOwningScriptCanvasId(), &GraphRequests::GetVariables); - + if (variableMap && baseType.IsValid()) { for (const auto& variablePair : *variableMap) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h index a73d6b27b3..08d8d115d5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.h @@ -58,7 +58,7 @@ namespace ScriptCanvas const Slot* GetVariableOutputSlot() const override; // Translation ////////////////////////////////////////////////////////////////////////// - + protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp index 7812d80717..32b5e5741f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp @@ -121,7 +121,7 @@ namespace ScriptCanvas { return AZ::Failure(); } - + DependencyReport dependencyNames; for (size_t index(0), sentinel = m_method->GetNumArguments(); index < sentinel; ++index) { @@ -131,7 +131,7 @@ namespace ScriptCanvas return AZ::Success(dependencyNames); } - + AZ::Outcome Method::GetFunctionCallLexicalScope(const Slot* /*slot*/) const { if (m_method) @@ -139,7 +139,7 @@ namespace ScriptCanvas Grammar::LexicalScope lexicalScope; if (m_method->IsMember() - || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes)) + || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes)) { lexicalScope.m_type = Grammar::LexicalScopeType::Variable; } @@ -160,7 +160,7 @@ namespace ScriptCanvas if (m_method) { if (m_method->IsMember() - || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes)) + || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes)) { auto name = BehaviorContextUtils::FindExposedMethodName(*m_method, m_class); if (!name.empty()) @@ -172,7 +172,7 @@ namespace ScriptCanvas return AZ::Success(m_lookupName); } - + EventType Method::GetFunctionEventType(const Slot*) const { return m_eventType; @@ -206,7 +206,7 @@ namespace ScriptCanvas m_lookupName = config.m_lookupName ? AZStd::string(*config.m_lookupName) : config.m_method.m_name; m_methodType = config.m_methodType; m_eventType = config.m_eventType; - + auto isExposableOutcome = IsExposable(config.m_method); AZ_Warning("ScriptCanvas", isExposableOutcome.IsSuccess(), "BehaviorContext Method %s is no longer exposable to ScriptCanvas: %s", isExposableOutcome.GetError().data()); ConfigureMethod(config.m_method, config.m_class); @@ -322,7 +322,7 @@ namespace ScriptCanvas } } - void Method::InitializeEvent(const NamespacePath&, AZStd::string_view ebusName, AZStd::string_view eventName) + void Method::InitializeEvent(const NamespacePath&, AZStd::string_view ebusName, AZStd::string_view eventName) { AZStd::lock_guard lock(m_mutex); @@ -698,7 +698,7 @@ namespace ScriptCanvas return TupleType{ method, m_methodType, eventType, bcClass }; } - return TupleType{ nullptr, MethodType::Count, EventType::Count, nullptr}; + return TupleType{ nullptr, MethodType::Count, EventType::Count, nullptr }; } void Method::OnWriteEnd() @@ -804,13 +804,13 @@ namespace ScriptCanvas { editContext->Class("Method", "Method") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) ; } } } - } - } -} + } + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h index 930b6e8539..db34da040c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h @@ -182,6 +182,6 @@ namespace ScriptCanvas Method(const Method&) = delete; }; - } - } -} + } + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp index ea3f2015b1..bfb54d5421 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp @@ -27,7 +27,7 @@ namespace ScriptCanvas 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); @@ -83,4 +83,4 @@ namespace ScriptCanvas 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 index 890cb2427d..a6cd84dbf6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h @@ -24,4 +24,4 @@ namespace ScriptCanvas 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/ReceiveScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp index 9cbbd03e9a..190c1a78c0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp @@ -93,7 +93,7 @@ namespace ScriptCanvas bool isNewSlot = true; const auto busToolTip = AZStd::string::format("%s (Type: %s)", c_busIdTooltip, m_ebus->m_idParam.m_name); - const AZ::TypeId& busId = m_ebus->m_idParam.m_typeId; + const AZ::TypeId& busId = m_ebus->m_idParam.m_typeId; SlotId addressSlotId; @@ -117,8 +117,8 @@ namespace ScriptCanvas } else { - Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId)); - + Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId)); + config.ConfigureDatum(AZStd::move(Datum(busIdType, Datum::eOriginality::Original))); config.m_contractDescs = { { [busIdType]() { return aznew RestrictedTypeContract({ busIdType }); } } }; } @@ -267,7 +267,7 @@ namespace ScriptCanvas SlotId slotId = AddSlot(slotConfiguration, isNewSlot); AZ_Error("ScriptCanvas", populationMapping.find(argIdentifier) == populationMapping.end(), "Trying to create the same slot twice. Unable to create sane mapping."); - + populationMapping[argIdentifier] = slotId; eBusEventEntry.m_parameterSlotIds.push_back(slotId); } @@ -281,7 +281,7 @@ namespace ScriptCanvas slotConfiguration.m_isLatent = true; slotConfiguration.m_name = eventID; - slotConfiguration.SetConnectionType(ConnectionType::Output); + slotConfiguration.SetConnectionType(ConnectionType::Output); slotConfiguration.m_addUniqueSlotByNameAndType = true; auto remappingIter = m_eventSlotMapping.find(outputSlotId); @@ -323,7 +323,7 @@ namespace ScriptCanvas void ReceiveScriptEvent::OnDeactivate() { ScriptEventBase::OnDeactivate(); - } + } const Internal::ScriptEventEntry* ReceiveScriptEvent::FindEventWithSlot(const Slot& slot) const { @@ -535,7 +535,7 @@ namespace ScriptCanvas { AZ::BehaviorContext* behaviorContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationBus::Events::GetBehaviorContext); - + const auto& ebusIterator = behaviorContext->m_ebuses.find(m_definition.GetName()); if (ebusIterator == behaviorContext->m_ebuses.end()) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h index 59800c943f..ea86d263f8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h @@ -54,11 +54,11 @@ namespace ScriptCanvas AZStd::optional GetEventIndex(AZStd::string eventName) const override; AZStd::vector GetEventSlotIds() const override; AZStd::vector GetNonEventSlotIds() const override; - + bool IsIDRequired() const; - + bool IsEventSlotId(const SlotId& slotId) const; - + // NodeVersioning... bool IsOutOfDate(const VersionData& graphVersion) const override; UpdateResult OnUpdateNode() override; @@ -122,6 +122,6 @@ namespace ScriptCanvas bool m_connected; }; - } + } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp index 964c2b8454..b5c2f90fcd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp @@ -59,7 +59,7 @@ namespace ScriptCanvas if (slot == nullptr) { // Handle older versions and improperly updated names - for (auto testUnit : { BaseTimerNode::TimeUnits::Seconds, BaseTimerNode::TimeUnits::Ticks}) + for (auto testUnit : { BaseTimerNode::TimeUnits::Seconds, BaseTimerNode::TimeUnits::Ticks }) { AZStd::string legacyName = BaseTimerNode::s_timeUnitNames[static_cast(testUnit)]; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h index 0cd9c73c98..b7c3dfb698 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.h @@ -31,7 +31,7 @@ namespace ScriptCanvas const char* GetTimeSlotFormat() const override { return "Delay (%s)"; } const char* GetBaseTimeSlotName() const override { return "Interval"; } const char* GetBaseTimeSlotToolTip() const override { return "The Interval between repetitions"; } - + protected: int m_repetionCount; }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp index 45314b73f3..52f7b538ef 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.cpp @@ -21,7 +21,7 @@ namespace ScriptCanvas { namespace Internal { - void ScriptEventEntry::Reflect(AZ::ReflectContext* context) + void ScriptEventEntry::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serialize = azrtti_cast(context)) { @@ -154,7 +154,7 @@ namespace ScriptCanvas } m_definition = definition; - } + } void ScriptEventBase::OnDeactivate() { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h index 5b2104f5dd..5baa76f4b6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ScriptEventBase.h @@ -106,7 +106,7 @@ namespace ScriptCanvas AZStd::pair, bool> IsAssetOutOfDate() const; - virtual void Initialize(const AZ::Data::AssetId assetId); + virtual void Initialize(const AZ::Data::AssetId assetId); protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp index 345fb5e5e8..4ce7ee6e02 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp @@ -208,7 +208,7 @@ namespace ScriptCanvas asset.BlockUntilLoadComplete(); const ScriptEvents::ScriptEvent& definition = asset.Get()->m_definition; - + // If no name has been serialized, this is a new node, so initialize it to the Script Event's definition values. if (m_busId == ScriptCanvas::EBusBusId()) { @@ -232,7 +232,7 @@ namespace ScriptCanvas } NamespacePath emptyNamespacePath; - + ScriptEvents::ScriptEventBus::BroadcastResult(m_scriptEvent, &ScriptEvents::ScriptEventRequests::RegisterScriptEvent, assetId, m_version); AZ::BehaviorMethod* method{}; @@ -299,9 +299,9 @@ namespace ScriptCanvas ScriptEvents::Method scriptEventMethod; definition.FindMethod(method->m_name, scriptEventMethod); - + size_t argIndex = 0; - + // Address slot (BusId) if (method->HasBusId()) { @@ -397,7 +397,7 @@ namespace ScriptCanvas { return true; } - + RegisterScriptEvent(asset); if (asset && asset.IsReady()) @@ -428,7 +428,7 @@ namespace ScriptCanvas { ConfigureMethod(*method); InitializeResultSlotId(); - + return true; } } @@ -528,7 +528,7 @@ namespace ScriptCanvas if (m_scriptEvent == nullptr) { return false; - } + } m_ebus = m_scriptEvent->GetBehaviorBus(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h index b985cabfa8..05695a9b1e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.h @@ -61,13 +61,13 @@ namespace ScriptCanvas PropertyFields GetPropertyFields() const override; // Translation ////////////////////////////////////////////////////////////////////////// - + protected: void OnInit() override; - void OnPostActivate() override; - + void OnPostActivate() override; + void AddSlots(); void RemoveSlots(); void AddPropertySlots(const Data::Type& type); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h index 9805c6d9ef..fbc481bb48 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/UnaryOperator.h @@ -42,7 +42,7 @@ namespace ScriptCanvas void ConfigureSlots() override; - SlotId GetOutputSlotId() const; + SlotId GetOutputSlotId() const; }; class UnaryExpression : public UnaryOperator @@ -56,7 +56,7 @@ namespace ScriptCanvas void ConfigureSlots() override; - virtual void InitializeUnaryExpression(); + virtual void InitializeUnaryExpression(); }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp index 914a8cea28..b3bb5f474f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp @@ -62,7 +62,7 @@ namespace ScriptCanvas const AZ::TypeId nodeFunctionGenericMultiReturnTemplateTypeId("{DC5B1799-6C5B-4190-8D90-EF0C2D1BCE4E}"); const AZ::TypeId oldEntityIdIsValidFuncSignatureTypeId = azrtti_typeid(); const AZ::TypeId oldEntityIdIsValidTypeId("{7CEC53AE-E12B-4738-B542-4587B8B95DC2}"); - + // Aggregate NodeFunctionGenericMultiReturn typeid // NOTE: Aggregation order addition is not commutative and must be in the added last to first: (FirstUuid + ( SecondUuid + (ThirdUuid + ... + (NthUuid)) const AZ::TypeId oldIsValidNodeAggregateTypeId = nodeFunctionGenericMultiReturnTemplateTypeId + (oldEntityIdIsValidFuncSignatureTypeId + oldEntityIdIsValidTypeId); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h index ccc65027ed..529b74d7ab 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h @@ -60,7 +60,7 @@ namespace ScriptCanvas virtual ~LibraryDefinition() = default; static const NodeRegistry::NodeList GetNodes(const AZ::Uuid& libraryType) - { + { NodeRegistry& registry = (*GetNodeRegistry()); const auto& libraryIterator = registry.m_nodeMap.find(libraryType); if (libraryIterator != registry.m_nodeMap.end()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp index 465c336815..54430a3794 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.cpp @@ -28,7 +28,7 @@ namespace ScriptCanvas return AZ::Success(DependencyReport{}); } - bool Any::IsNoOp() const + bool Any::IsNoOp() const { return true; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h index 9fd676c22a..efc8be90d0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Any.h @@ -30,7 +30,7 @@ namespace ScriptCanvas Current }; - + public: SCRIPTCANVAS_NODE(Any); @@ -52,10 +52,10 @@ namespace ScriptCanvas //// /// Translation - bool IsNoOp() const override; + bool IsNoOp() const override; AZ::Outcome GetDependencies() const override; - + protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot*) const override { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Break.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Break.h index 6d0718ff2e..3555fea2e2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Break.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Break.h @@ -27,11 +27,11 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(Break); - Break() = default; + Break() = default; AZ::Outcome GetDependencies() const override; - + }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h index 2d26a1f816..3d903018d0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Cycle.h @@ -54,7 +54,7 @@ namespace ScriptCanvas void FixupStateNames(); int m_numOutputs; - + size_t m_executionSlot; AZStd::vector< SlotId > m_orderedOutputSlots; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h index a8e04489d0..ae9c25573b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Gate.h @@ -32,7 +32,7 @@ namespace ScriptCanvas AZ::Outcome GetDependencies() const override; - bool IsIfBranch() const override { return true; } + bool IsIfBranch() const override { return true; } protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp index 85cefcf5aa..851ccb24dd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/IsNull.cpp @@ -39,7 +39,7 @@ namespace ScriptCanvas { { auto func = []() { return aznew IsReferenceTypeContract(); }; - ContractDescriptor descriptor{ AZStd::move(func) }; + ContractDescriptor descriptor{ AZStd::move(func) }; DynamicDataSlotConfiguration slotConfiguration; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp index 444a312edc..96e511fa49 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Logic.cpp @@ -53,7 +53,7 @@ namespace ScriptCanvas AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); - AddNodeToRegistry(nodeRegistry); + AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); @@ -78,7 +78,7 @@ namespace ScriptCanvas ScriptCanvas::Nodes::Logic::TargetedSequencer::CreateDescriptor(), ScriptCanvas::Nodes::Logic::WeightedRandomSequencer::CreateDescriptor(), ScriptCanvas::Nodes::Logic::While::CreateDescriptor(), - }); + }); } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h index ee61c6637a..119a36e682 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Not.h @@ -63,7 +63,7 @@ namespace ScriptCanvas } // Translation ////////////////////////////////////////////////////////////////////////// - }; + }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h index 31bcf9a158..fc06fafbbe 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Once.h @@ -29,7 +29,7 @@ namespace ScriptCanvas Once(); - AZ::Outcome GetDependencies() const override; + AZ::Outcome GetDependencies() const override; protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.cpp index c7c3834594..4061b9adbe 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.cpp @@ -18,7 +18,7 @@ namespace ScriptCanvas OrderedSequencer::OrderedSequencer() : Node() , m_numOutputs(0) - { + { } AZ::Outcome OrderedSequencer::GetDependencies() const @@ -67,15 +67,15 @@ namespace ScriptCanvas visualExtensions.m_connectionType = ConnectionType::Output; visualExtensions.m_identifier = AZ::Crc32("AddOutputGroup"); visualExtensions.m_displayGroup = GetDisplayGroup(); - + RegisterExtension(visualExtensions); } } - + bool OrderedSequencer::CanDeleteSlot(const SlotId& slotId) const { - Slot* slot = GetSlot(slotId); - + Slot* slot = GetSlot(slotId); + // Only remove execution out slots when we have more then 1 output slot. if (slot && slot->IsExecution() && slot->IsOutput()) { @@ -88,17 +88,17 @@ namespace ScriptCanvas SlotId OrderedSequencer::HandleExtension([[maybe_unused]] AZ::Crc32 extensionId) { ExecutionSlotConfiguration executionConfiguration(GenerateOutputName(m_numOutputs), ConnectionType::Output); - + executionConfiguration.m_addUniqueSlotByNameAndType = false; executionConfiguration.m_displayGroup = GetDisplayGroup(); - + ++m_numOutputs; - + return AddSlot(executionConfiguration); } void OrderedSequencer::OnSlotRemoved([[maybe_unused]] const SlotId& slotId) - { + { FixupStateNames(); } @@ -107,12 +107,12 @@ namespace ScriptCanvas AZStd::string slotName = AZStd::string::format("Out %i", counter); return AZStd::move(slotName); } - + void OrderedSequencer::FixupStateNames() { auto outputSlots = GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut()); m_numOutputs = static_cast(outputSlots.size()); - + for (int i = 0; i < outputSlots.size(); ++i) { Slot* slot = GetSlot(outputSlots[i]->GetId()); @@ -122,7 +122,7 @@ namespace ScriptCanvas slot->Rename(GenerateOutputName(i)); } } - } + } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.h index f973446702..ca07b60834 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/OrderedSequencer.h @@ -22,7 +22,7 @@ namespace ScriptCanvas class OrderedSequencer : public Node { - + public: SCRIPTCANVAS_NODE(OrderedSequencer); @@ -43,10 +43,10 @@ namespace ScriptCanvas void ConfigureVisualExtensions() override; - + protected: - + AZStd::string GetDisplayGroup() const { return "OutputGroup"; } protected: @@ -57,11 +57,11 @@ namespace ScriptCanvas AZStd::string GenerateOutputName(int counter) const; void FixupStateNames(); - + int m_numOutputs; - + AZStd::vector< SlotId > m_orderedOutputSlots; }; } - } + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp index ca32a5eb5a..1612727fc3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/Sequencer.cpp @@ -29,7 +29,7 @@ namespace ScriptCanvas { auto inSlot = SequencerProperty::GetInSlot(this); auto nextSlot = SequencerProperty::GetNextSlot(this); - + if (inSlot && inSlot->IsConnected()) { // Replace by TargetedSequencer diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp index 445c91e1fc..5e47397e46 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.cpp @@ -18,9 +18,9 @@ namespace ScriptCanvas TargetedSequencer::TargetedSequencer() : Node() , m_numOutputs(0) - { + { } - + void TargetedSequencer::OnInit() { m_numOutputs = static_cast(GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut()).size()); @@ -45,11 +45,11 @@ namespace ScriptCanvas RegisterExtension(visualExtensions); } } - + bool TargetedSequencer::CanDeleteSlot(const SlotId& slotId) const { - Slot* slot = GetSlot(slotId); - + Slot* slot = GetSlot(slotId); + // Only remove execution out slots when we have more then 1 output slot. if (slot && slot->IsExecution() && slot->IsOutput()) { @@ -62,17 +62,17 @@ namespace ScriptCanvas SlotId TargetedSequencer::HandleExtension([[maybe_unused]] AZ::Crc32 extensionId) { ExecutionSlotConfiguration executionConfiguration(GenerateOutputName(m_numOutputs), ConnectionType::Output); - + executionConfiguration.m_addUniqueSlotByNameAndType = false; executionConfiguration.m_displayGroup = GetDisplayGroup(); - + ++m_numOutputs; - + return AddSlot(executionConfiguration); } void TargetedSequencer::OnSlotRemoved([[maybe_unused]] const SlotId& slotId) - { + { FixupStateNames(); } @@ -81,12 +81,12 @@ namespace ScriptCanvas AZStd::string slotName = AZStd::string::format("Out %i", counter); return AZStd::move(slotName); } - + void TargetedSequencer::FixupStateNames() { auto outputSlots = GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut()); m_numOutputs = static_cast(outputSlots.size()); - + for (int i = 0; i < outputSlots.size(); ++i) { Slot* slot = GetSlot(outputSlots[i]->GetId()); @@ -96,7 +96,7 @@ namespace ScriptCanvas slot->Rename(GenerateOutputName(i)); } } - } + } } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h index 68bf1601f7..f263d8d9e4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/TargetedSequencer.h @@ -31,10 +31,10 @@ namespace ScriptCanvas void OnInit() override; void OnConfigured() override; void ConfigureVisualExtensions() override; - + bool CanDeleteSlot(const SlotId& slotId) const; - SlotId HandleExtension(AZ::Crc32 extensionId); + SlotId HandleExtension(AZ::Crc32 extensionId); // Script Canvas Translation... bool IsSwitchStatement() const override { return true; } @@ -51,7 +51,7 @@ namespace ScriptCanvas ////////////////////////////////////////////////////////////////////////// protected: - + AZStd::string GetDisplayGroup() const { return "OutputGroup"; } void OnSlotRemoved(const SlotId& slotId) override; @@ -60,7 +60,7 @@ namespace ScriptCanvas AZStd::string GenerateOutputName(int counter); void FixupStateNames(); - + int m_numOutputs; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp index 21b2ead10e..1954821587 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.cpp @@ -30,7 +30,7 @@ namespace ScriptCanvas return AZ::Success(DependencyReport()); } - ConstSlotsOutcome WeightedRandomSequencer::GetSlotsInExecutionThreadByTypeImpl(const Slot& , CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const + ConstSlotsOutcome WeightedRandomSequencer::GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const { return AZ::Success(GetSlotsByType(targetSlotType)); } @@ -45,7 +45,7 @@ namespace ScriptCanvas ->Version(1) ->Field("WeightSlotId", &WeightedPairing::m_weightSlotId) ->Field("ExecutionSlotId", &WeightedPairing::m_executionSlotId) - ; + ; } } } @@ -57,7 +57,7 @@ namespace ScriptCanvas EndpointNotificationBus::MultiHandler::BusConnect({ GetEntityId(), weightedPairing.m_weightSlotId }); EndpointNotificationBus::MultiHandler::BusConnect({ GetEntityId(), weightedPairing.m_executionSlotId }); } - + // We always want at least one weighted transition state if (m_weightedPairings.empty()) { @@ -130,7 +130,7 @@ namespace ScriptCanvas return isValid; } - + SlotId WeightedRandomSequencer::HandleExtension(AZ::Crc32 extensionId) { auto weightedPairing = AddWeightedPair(); @@ -162,9 +162,9 @@ namespace ScriptCanvas { for (auto pairIter = m_weightedPairings.begin(); pairIter != m_weightedPairings.end(); ++pairIter) { - + if (pairIter->m_executionSlotId == slotId - || pairIter->m_weightSlotId == slotId) + || pairIter->m_weightSlotId == slotId) { SlotId executionSlot = pairIter->m_executionSlotId; SlotId weightSlot = pairIter->m_weightSlotId; @@ -178,15 +178,15 @@ namespace ScriptCanvas else if (slotId == weightSlot) { RemoveSlot(executionSlot); - } - + } + break; } } - + FixupStateNames(); } - + bool WeightedRandomSequencer::AllWeightsFilled() const { bool isFilled = true; @@ -197,7 +197,7 @@ namespace ScriptCanvas isFilled = false; break; } - } + } return isFilled; } @@ -225,15 +225,15 @@ namespace ScriptCanvas return hasExcess; } - + WeightedRandomSequencer::WeightedPairing WeightedRandomSequencer::AddWeightedPair() { int counterWeight = static_cast(m_weightedPairings.size()) + 1; - - WeightedPairing weightedPairing; + + WeightedPairing weightedPairing; DataSlotConfiguration dataSlotConfiguration; - + dataSlotConfiguration.SetConnectionType(ConnectionType::Input); dataSlotConfiguration.m_name = GenerateDataName(counterWeight); dataSlotConfiguration.m_toolTip = "The weight associated with the execution state."; @@ -242,24 +242,24 @@ namespace ScriptCanvas dataSlotConfiguration.SetDefaultValue(1.0f); dataSlotConfiguration.m_displayGroup = GetDisplayGroup(); - + weightedPairing.m_weightSlotId = AddSlot(dataSlotConfiguration); - + ExecutionSlotConfiguration slotConfiguration; - + slotConfiguration.m_name = GenerateOutName(counterWeight); slotConfiguration.m_addUniqueSlotByNameAndType = false; slotConfiguration.SetConnectionType(ConnectionType::Output); slotConfiguration.m_displayGroup = GetDisplayGroup(); - - weightedPairing.m_executionSlotId = AddSlot(slotConfiguration); - + + weightedPairing.m_executionSlotId = AddSlot(slotConfiguration); + m_weightedPairings.push_back(weightedPairing); return weightedPairing; } - + void WeightedRandomSequencer::FixupStateNames() { int counter = 1; @@ -267,30 +267,30 @@ namespace ScriptCanvas { AZStd::string dataName = GenerateDataName(counter); AZStd::string executionName = GenerateOutName(counter); - + Slot* dataSlot = GetSlot(weightedPairing.m_weightSlotId); - + if (dataSlot) { dataSlot->Rename(dataName); } - + Slot* executionSlot = GetSlot(weightedPairing.m_executionSlotId); - + if (executionSlot) { executionSlot->Rename(executionName); } - + ++counter; } } - + AZStd::string WeightedRandomSequencer::GenerateDataName(int counter) { return AZStd::string::format("Weight %i", counter); } - + AZStd::string WeightedRandomSequencer::GenerateOutName(int counter) { return AZStd::string::format("Out %i", counter); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h index d8be2a95c6..cffd7569c3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/WeightedRandomSequencer.h @@ -26,10 +26,10 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(WeightedRandomSequencer); static void ReflectDataTypes(AZ::ReflectContext* reflectContext); - + WeightedRandomSequencer() = default; ~WeightedRandomSequencer() = default; - + AZ::Outcome GetDependencies() const override; ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override; @@ -39,20 +39,20 @@ namespace ScriptCanvas void ConfigureVisualExtensions() override; bool OnValidateNode(ValidationResults& validationResults); - - SlotId HandleExtension(AZ::Crc32 extensionId) override; + + SlotId HandleExtension(AZ::Crc32 extensionId) override; bool CanDeleteSlot(const SlotId& slotId) const override; void OnSlotRemoved(const SlotId& slotId) override; //// - + protected: AZ::Crc32 GetWeightExtensionId() const { return AZ_CRC("WRS_Weight_Extension", 0xd17b9467); } AZ::Crc32 GetExecutionExtensionId() const { return AZ_CRC("WRS_Execution_Extension", 0x0706035e); } - AZStd::string GetDisplayGroup() const { return "WeightedExecutionGroup"; } - + AZStd::string GetDisplayGroup() const { return "WeightedExecutionGroup"; } + private: struct WeightedPairing @@ -68,22 +68,22 @@ namespace ScriptCanvas int m_totalWeight; SlotId m_executionSlotId; }; - + void RemoveWeightedPair(SlotId slotId); - + bool AllWeightsFilled() const; bool HasExcessEndpoints() const; - + WeightedPairing AddWeightedPair(); void FixupStateNames(); - + AZStd::string GenerateDataName(int counter); - AZStd::string GenerateOutName(int counter); + AZStd::string GenerateOutName(int counter); using WeightedPairingList = AZStd::vector; WeightedPairingList m_weightedPairings; }; } - } + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.cpp index 25535d3102..ffc3af4832 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.cpp @@ -19,7 +19,7 @@ namespace ScriptCanvas { return AZ::Success(DependencyReport{}); } - + SlotId While::GetLoopFinishSlotId() const { return WhileProperty::GetOutSlotId(const_cast(this)); @@ -31,8 +31,8 @@ namespace ScriptCanvas } bool While::IsFormalLoop() const - { - return true; + { + return true; } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h index bb0ed3088b..b4ce578bee 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Logic/While.h @@ -29,11 +29,11 @@ namespace ScriptCanvas AZ::Outcome GetDependencies() const override; SlotId GetLoopFinishSlotId() const override; - + SlotId GetLoopSlotId() const override; - - bool IsFormalLoop() const override; - + + bool IsFormalLoop() const override; + protected: ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp index d018bf459d..fd3f325ee0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Math.cpp @@ -79,7 +79,7 @@ namespace ScriptCanvas void Math::InitNodeRegistry(NodeRegistry& nodeRegistry) { using namespace ScriptCanvas::Nodes::Math; - + AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); @@ -101,7 +101,7 @@ namespace ScriptCanvas Vector3Nodes::Registrar::AddToRegistry(nodeRegistry); Vector4Nodes::Registrar::AddToRegistry(nodeRegistry); } - + AZStd::vector Math::GetComponentDescriptors() { AZStd::vector descriptors = { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathGenerics.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathGenerics.h index 1cd73b770c..baa287488d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathGenerics.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathGenerics.h @@ -42,5 +42,5 @@ namespace ScriptCanvas StringToNumberNode >; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.cpp index 5d652c2919..6deb1420e2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.cpp @@ -58,7 +58,7 @@ namespace ScriptCanvas AZ_Assert(randomEngineVar.IsConstructed(), "random engine is not initialized"); return dis(randomEngineVar->m_randomEngine); } - + AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs) { if (lhs == rhs) @@ -74,5 +74,5 @@ namespace ScriptCanvas } } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.h index 1d5c18ecdf..4a6e7713e8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathNodeUtilities.h @@ -24,11 +24,11 @@ namespace ScriptCanvas template AZ_INLINE void DefaultToleranceEpsilon(Node& node) { SetDefaultValuesByIndex::_(node, Data::ToleranceEpsilon()); } - + Data::NumberType GetRandom(Data::NumberType lhs, Data::NumberType rhs); - AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs); - + AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs); + template AZ_INLINE NumberType GetRandomIntegral(NumberType lhs, NumberType rhs) { @@ -56,5 +56,5 @@ namespace ScriptCanvas void RandomEngineInit(); void RandomEngineReset(); } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathRandom.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathRandom.h index 1e304dc898..74d1abb269 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathRandom.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/MathRandom.h @@ -26,9 +26,9 @@ namespace ScriptCanvas AZ_INLINE Data::ColorType RandomColor(Data::ColorType minValue, Data::ColorType maxValue) { return Data::ColorType(MathNodeUtilities::GetRandomReal(minValue.GetR(), maxValue.GetR()), - MathNodeUtilities::GetRandomReal(minValue.GetG(), maxValue.GetG()), - MathNodeUtilities::GetRandomReal(minValue.GetB(), maxValue.GetB()), - MathNodeUtilities::GetRandomReal(minValue.GetA(), maxValue.GetA())); + MathNodeUtilities::GetRandomReal(minValue.GetG(), maxValue.GetG()), + MathNodeUtilities::GetRandomReal(minValue.GetB(), maxValue.GetB()), + MathNodeUtilities::GetRandomReal(minValue.GetA(), maxValue.GetA())); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomColor, SetRandomColorDefaults, k_categoryName, "{0A984F40-322B-44A6-8753-6D2056A96659}", "Returns a random color [Min, Max]", "Min", "Max"); @@ -81,8 +81,8 @@ namespace ScriptCanvas { Data::Vector3Type halfDimensions = 0.5f * dimensions; Data::Vector3Type point(MathNodeUtilities::GetRandomReal(-halfDimensions.GetX(), halfDimensions.GetX()), - MathNodeUtilities::GetRandomReal(-halfDimensions.GetY(), halfDimensions.GetY()), - MathNodeUtilities::GetRandomReal(-halfDimensions.GetZ(), halfDimensions.GetZ())); + MathNodeUtilities::GetRandomReal(-halfDimensions.GetY(), halfDimensions.GetY()), + MathNodeUtilities::GetRandomReal(-halfDimensions.GetZ(), halfDimensions.GetZ())); return point; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInBox, SetRandomPointInBoxDefaults, k_categoryName, "{6785C5F8-2F87-4AD6-AE15-87FE5E72D142}", "returns a random point in a box", "Dimensions"); @@ -99,8 +99,8 @@ namespace ScriptCanvas float theta = MathNodeUtilities::GetRandomReal(0.f, AZ::Constants::TwoPi - std::numeric_limits::epsilon()); Data::Vector3Type point(fRadius * cosf(theta), - fRadius * sinf(theta), - 0.f); + fRadius * sinf(theta), + 0.f); return point; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointOnCircle, SetRandomPointOnCircleDefaults, k_categoryName, "{2F079E35-216D-42B3-AA81-C9823F732893}", "returns a random point on the circumference of a circle", "Radius"); @@ -150,8 +150,8 @@ namespace ScriptCanvas float theta = MathNodeUtilities::GetRandomReal(0.f, AZ::Constants::TwoPi - std::numeric_limits::epsilon()); Data::Vector3Type point(r * cosf(theta), - r * sinf(theta), - MathNodeUtilities::GetRandomReal(fNegHalfHeight, fHalfHeight)); + r * sinf(theta), + MathNodeUtilities::GetRandomReal(fNegHalfHeight, fHalfHeight)); return point; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInCylinder, SetRandomPointInCylinderDefaults, k_categoryName, "{BD81133C-AAC0-44B0-9C9A-D06E780F4CCE}", "returns a random point in a cylinder", "Radius", "Height"); @@ -168,8 +168,8 @@ namespace ScriptCanvas float theta = MathNodeUtilities::GetRandomReal(0.f, AZ::Constants::TwoPi - std::numeric_limits::epsilon()); Data::Vector3Type point(r * cosf(theta), - r * sinf(theta), - 0.f); + r * sinf(theta), + 0.f); return point; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInCircle, SetRandomPointInCircleDefaults, k_categoryName, "{93378981-85DD-42B9-9D2D-826BE68BBE8F}", "returns a random point inside the area of a circle", "Radius"); @@ -234,8 +234,8 @@ namespace ScriptCanvas { Data::Vector2Type halfDimensions = 0.5f * dimensions; Data::Vector3Type point(MathNodeUtilities::GetRandomReal(-halfDimensions.GetX(), halfDimensions.GetX()), - MathNodeUtilities::GetRandomReal(-halfDimensions.GetY(), halfDimensions.GetY()), - 0.f); + MathNodeUtilities::GetRandomReal(-halfDimensions.GetY(), halfDimensions.GetY()), + 0.f); return point; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInSquare, SetRandomPointInSquareDefaults, k_categoryName, "{B81B4049-CBD2-460E-A4AB-155AB8FFDCB9}", "returns a random point in a square", "Dimensions"); @@ -295,7 +295,7 @@ namespace ScriptCanvas { float theta = MathNodeUtilities::GetRandomReal(0.f, AZ::Constants::TwoPi - std::numeric_limits::epsilon()); return Data::Vector2Type(cosf(theta), - sinf(theta)); + sinf(theta)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RandomUnitVector2, k_categoryName, "{02CE950A-06F8-485D-87E9-77FDE808B160}", "returns a random Vector2 direction"); @@ -324,7 +324,7 @@ namespace ScriptCanvas AZ_INLINE Data::Vector2Type RandomVector2(Data::Vector2Type minValue, Data::Vector2Type maxValue) { return Data::Vector2Type(MathNodeUtilities::GetRandomReal(minValue.GetX(), maxValue.GetX()), - MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY())); + MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY())); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector2, SetRandomVector2Defaults, k_categoryName, "{6F9982F5-D6F6-4568-8A83-D5A35390D425}", "returns a random Vector2", "Min", "Max"); @@ -337,8 +337,8 @@ namespace ScriptCanvas AZ_INLINE Data::Vector3Type RandomVector3(Data::Vector3Type minValue, Data::Vector3Type maxValue) { return Data::Vector3Type(MathNodeUtilities::GetRandomReal(minValue.GetX(), maxValue.GetX()), - MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY()), - MathNodeUtilities::GetRandomReal(minValue.GetZ(), maxValue.GetZ())); + MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY()), + MathNodeUtilities::GetRandomReal(minValue.GetZ(), maxValue.GetZ())); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector3, SetRandomVector3Defaults, k_categoryName, "{FF5526DC-E56D-4101-B7DE-4E7283E31B10}", "returns a random Vector3", "Min", "Max"); @@ -351,15 +351,15 @@ namespace ScriptCanvas AZ_INLINE Data::Vector4Type RandomVector4(Data::Vector4Type minValue, Data::Vector4Type maxValue) { return Data::Vector4Type(MathNodeUtilities::GetRandomReal(minValue.GetX(), maxValue.GetX()), - MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY()), - MathNodeUtilities::GetRandomReal(minValue.GetZ(), maxValue.GetZ()), - MathNodeUtilities::GetRandomReal(minValue.GetW(), maxValue.GetW())); + MathNodeUtilities::GetRandomReal(minValue.GetY(), maxValue.GetY()), + MathNodeUtilities::GetRandomReal(minValue.GetZ(), maxValue.GetZ()), + MathNodeUtilities::GetRandomReal(minValue.GetW(), maxValue.GetW())); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector4, SetRandomVector4Defaults, k_categoryName, "{76FCA9CF-7BBF-471C-9D4A-67FE8E9C6298}", "returns a random Vector4", "Min", "Max"); AZ_INLINE void SetRandomPointInArcDefaults(Node& node) { - SetDefaultValuesByIndex<0>::_(node, Data::Vector3Type(0.f,0.f,0.f)); + SetDefaultValuesByIndex<0>::_(node, Data::Vector3Type(0.f, 0.f, 0.f)); SetDefaultValuesByIndex<1>::_(node, Data::Vector3Type(1.f, 0.f, 0.f)); SetDefaultValuesByIndex<2>::_(node, Data::Vector3Type(0.f, 0.f, 1.f)); SetDefaultValuesByIndex<3>::_(node, Data::NumberType(1.0)); @@ -405,7 +405,7 @@ namespace ScriptCanvas SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInWedge, SetRandomPointInWedgeDefaults, k_categoryName, "{F224DA37-240D-4ABB-A97A-3565197B94B4}", "returns a random point in the specified wedge", "Origin", "Direction", "Normal", "Radius", "Height", "Angle"); - using Registrar = RegistrarGeneric< + using Registrar = RegistrarGeneric < RandomColorNode , RandomGrayscaleNode , RandomIntegerNode @@ -427,6 +427,6 @@ namespace ScriptCanvas , RandomVector4Node , RandomPointInArcNode , RandomPointInWedgeNode - >; + > ; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/RotationNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/RotationNodes.h index 0f20bcf8c9..9cf3320767 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/RotationNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/RotationNodes.h @@ -20,7 +20,7 @@ namespace ScriptCanvas using namespace Data; using namespace MathNodeUtilities; static const char* k_categoryName = "Math/Quaternion"; - + AZ_INLINE QuaternionType Add(QuaternionType a, QuaternionType b) { return a + b; @@ -106,7 +106,7 @@ namespace ScriptCanvas return QuaternionType::CreateFromVector3AndValue(imaginary, aznumeric_cast(real)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromVector3AndValue, k_categoryName, "{955FE6EB-7C38-4587-BBB7-9C886ACEAF94}", "returns a rotation with the imaginary elements from Imaginary and the real element from Real", "Imaginary", "Real"); - + AZ_INLINE NumberType GetElement(QuaternionType source, NumberType index) { return source.GetElement(AZ::GetClamp(aznumeric_cast(index), 0, 3)); @@ -172,7 +172,7 @@ namespace ScriptCanvas return a.Lerp(b, aznumeric_cast(t)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Lerp, k_categoryName, "{91CF1C54-89C6-4A00-A53D-20C58454C4EC}", "returns a the linear interpolation between From and To by the amount T", "From", "To", "T"); - + AZ_INLINE QuaternionType ModX(QuaternionType source, NumberType value) { source.SetX(aznumeric_cast(value)); @@ -228,7 +228,7 @@ namespace ScriptCanvas AZ_INLINE std::tuple NormalizeWithLength(QuaternionType source) { const float length = source.NormalizeWithLength(); - return std::make_tuple( source, length ); + return std::make_tuple(source, length); } SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(NormalizeWithLength, k_categoryName, "{E1A7F3F8-854E-4BA1-9DEA-7507BEC6D369}", "returns the normalized version of Source, and the length of Source", "Source", "Normalized", "Length"); @@ -249,7 +249,7 @@ namespace ScriptCanvas return QuaternionType::CreateRotationZ(AZ::DegToRad(aznumeric_caster(degrees))); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RotationZDegrees, k_categoryName, "{8BC8B0FE-51A1-4ECC-AFF1-A828A0FC8F8F}", "creates a rotation of Degrees around the z-axis", "Degrees"); - + AZ_INLINE QuaternionType ShortestArc(Vector3Type from, Vector3Type to) { return QuaternionType::CreateShortestArc(from, to); @@ -279,7 +279,7 @@ namespace ScriptCanvas return aznumeric_caster(AZ::RadToDeg(source.GetAngle())); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToAngleDegrees, k_categoryName, "{3EA78793-9AFA-4857-8CB8-CD0D47E97D25}", "returns the angle of angle-axis pair that Source represents in degrees", "Source"); - + AZ_INLINE Vector3Type ToImaginary(QuaternionType source) { return source.GetImaginary(); @@ -301,7 +301,7 @@ namespace ScriptCanvas SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RotateVector3, k_categoryName, "{DDF7C05C-7148-4860-93A3-D507C5896B6C}", "Returns a new Vector3 that is the source vector3 rotated by the given Quaternion", "Quaternion", "Vector"); - using Registrar = RegistrarGeneric< + using Registrar = RegistrarGeneric < AddNode , ConjugateNode , ConvertTransformToRotationNode @@ -369,5 +369,5 @@ namespace ScriptCanvas > ; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h index bcff3378c9..b7cf6757e2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Sum.h @@ -24,7 +24,7 @@ namespace ScriptCanvas AZ_COMPONENT(Sum, "{6C52B2D1-3526-4855-A217-5106D54F6B90}", ArithmeticExpression); static void Reflect(AZ::ReflectContext* reflection) - { + { if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) { serializeContext->Class() diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h index 0f0fdddcac..441be22702 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h @@ -24,7 +24,7 @@ namespace ScriptCanvas AZ_INLINE std::tuple ExtractUniformScale(TransformType source) { auto scale(source.ExtractUniformScale()); - return std::make_tuple( scale, source ); + return std::make_tuple(scale, source); } SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(ExtractUniformScale, k_categoryName, "{8DFE5247-0950-4CD1-87E6-0CAAD42F1637}", "returns the uniform scale as a float, and a transform with the scale extracted ", "Source", "Uniform Scale", "Extracted"); @@ -114,7 +114,7 @@ namespace ScriptCanvas return source.IsFinite(); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsFinite, k_categoryName, "{B7D23934-0101-40B9-80E8-3D88C8580B25}", "returns true if every row of source is finite, else false", "Source"); - + AZ_INLINE BooleanType IsOrthogonal(const TransformType& source, NumberType tolerance) { return source.IsOrthogonal(aznumeric_cast(tolerance)); @@ -139,7 +139,7 @@ namespace ScriptCanvas return source.TransformVector(multiplier); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Multiply3x3ByVector3, k_categoryName, "{4F2ABFC6-2E93-4A9D-8639-C7967DB318DB}", "returns Source's 3x3 upper matrix post multiplied by Multiplier", "Source", "Multiplier"); - + AZ_INLINE TransformType MultiplyByUniformScale(TransformType source, NumberType scale) { source.MultiplyByUniformScale(scale); @@ -170,7 +170,7 @@ namespace ScriptCanvas return source.GetOrthogonalized(); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Orthogonalize, k_categoryName, "{2B4140CD-6E22-44D3-BDB5-309E69FE7CC2}", "returns an orthogonal matrix if the Source is almost orthogonal", "Source"); - + AZ_INLINE TransformType RotationXDegrees(NumberType degrees) { return TransformType::CreateRotationX(AZ::DegToRad(aznumeric_caster(degrees))); @@ -194,13 +194,13 @@ namespace ScriptCanvas return source.GetUniformScale(); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToScale, k_categoryName, "{063C58AD-F567-464D-A432-F298FE3953A6}", "returns the uniform scale of the Source", "Source"); - + using Registrar = RegistrarGeneric - < + < #if ENABLE_EXTENDED_MATH_SUPPORT - ExtractUniformScaleNode , + ExtractUniformScaleNode, #endif - FromMatrix3x3AndTranslationNode + FromMatrix3x3AndTranslationNode , FromMatrix3x3Node , FromRotationAndTranslationNode , FromRotationNode @@ -245,8 +245,8 @@ namespace ScriptCanvas , TransposedMultiply3x3Node , ZeroNode #endif - >; + > ; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector2Nodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector2Nodes.h index a807243f92..68fc2e729e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector2Nodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector2Nodes.h @@ -165,7 +165,7 @@ namespace ScriptCanvas return a.GetMin(b); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Min, k_categoryName, "{815685B8-B877-4D54-9E11-D0161185B4B9}", "returns the vector (min(A.x, B.x), min(A.y, B.y))", "A", "B"); - + AZ_INLINE Vector2Type SetX(Vector2Type source, NumberType value) { source.SetX(aznumeric_caster(value)); @@ -242,7 +242,7 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToPerpendicular, k_categoryName, "{CC4DC102-8B50-4828-BA94-0586F34E0D37}", "returns the vector (-Source.y, Source.x), a 90 degree, positive rotation", "Source"); - using Registrar = RegistrarGeneric< + using Registrar = RegistrarGeneric < AbsoluteNode , AddNode , AngleNode @@ -294,8 +294,8 @@ namespace ScriptCanvas , SlerpNode , SubtractNode , ToPerpendicularNode - >; + > ; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h index a74ae45e67..3c6f4a65e7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h @@ -33,14 +33,14 @@ namespace ScriptCanvas return lhs + rhs; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Add, k_categoryName, "{0F554E23-9AB6-4D17-A517-C885ECD024F0}", "This node is deprecated, use Add (+), it provides contextual type and slots", "A", "B"); - + AZ_INLINE Vector3Type AngleMod(const Vector3Type source) { return source.GetAngleMod(); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(AngleMod, k_categoryName, "{BF5C12A8-F42D-43E7-9CE3-D16D30B182D2}", "wraps the angle in each element into the range [-pi, pi]", "Source") - AZ_INLINE std::tuple BuildTangentBasis(Vector3Type source) + AZ_INLINE std::tuple BuildTangentBasis(Vector3Type source) { std::tuple tangentBitangent; source.NormalizeSafe(); @@ -48,13 +48,13 @@ namespace ScriptCanvas return tangentBitangent; } SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(BuildTangentBasis, k_categoryName, "{3EBA365F-063A-45A0-BDD1-ED0F995AD310}", "returns a tangent basis from the normal", "Normal", "Tangent", "Bitangent"); - + AZ_INLINE Vector3Type Clamp(const Vector3Type source, const Vector3Type min, const Vector3Type max) { return source.GetClamp(min, max); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Clamp, k_categoryName, "{28305F88-0940-43C8-B0A8-B8CEB3B0B82A}", "returns vector clamped to [min, max] and equal to source if possible", "Source", "Min", "Max"); - + AZ_INLINE Vector3Type Cosine(const Vector3Type source) { return source.GetCos(); @@ -66,7 +66,7 @@ namespace ScriptCanvas return lhs.Cross(rhs); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Cross, k_categoryName, "{6FAF4ACA-A100-4B71-ACF8-F1DB4674F51C}", "returns the vector cross product of A X B", "A", "B"); - + AZ_INLINE Vector3Type CrossXAxis(const Vector3Type source) { return source.CrossXAxis(); @@ -120,7 +120,7 @@ namespace ScriptCanvas return lhs.Dot(rhs); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Dot, k_categoryName, "{5DFA6260-C044-4798-A55C-3CF5F3DB45CE}", "returns the vector dot product of A dot B", "A", "B"); - + AZ_INLINE Vector3Type FromElement(Vector3Type source, const NumberType index, const NumberType value) { source.SetElement(AZ::GetClamp(aznumeric_cast(index), 0, 2), aznumeric_cast(value)); @@ -200,7 +200,7 @@ namespace ScriptCanvas return from.Lerp(to, aznumeric_cast(t)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Lerp, k_categoryName, "{AA063267-DA0F-4407-9356-30B4E89A9FA4}", "returns the linear interpolation (From + ((To - From) * T)", "From", "To", "T"); - + AZ_INLINE Vector3Type Max(const Vector3Type a, const Vector3Type b) { return a.GetMax(b); @@ -297,7 +297,7 @@ namespace ScriptCanvas return std::make_tuple(sin, cos); } SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(SineCosine, k_categoryName, "{04EE253D-680D-4F95-A451-837EAE104E88}", "returns a vector from the sine of each element from the source, and from the cosine of each element from the source", "Source", "Sine", "Cosine"); - + AZ_INLINE Vector3Type Slerp(const Vector3Type from, const Vector3Type to, const NumberType t) { return from.Slerp(to, aznumeric_cast(t)); @@ -328,7 +328,7 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ZAxisCross, k_categoryName, "{29206E84-392C-412E-9DD5-781B2759260D}", "returns the vector cross product of Z-Axis X Source", "Source"); - using Registrar = RegistrarGeneric< + using Registrar = RegistrarGeneric < AbsoluteNode , AddNode @@ -409,8 +409,8 @@ namespace ScriptCanvas , ZAxisCrossNode #endif - >; + > ; } -} +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h index c8ce20fe14..284582be57 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h @@ -74,13 +74,13 @@ namespace ScriptCanvas return Vector4Type(aznumeric_cast(x), aznumeric_cast(y), aznumeric_cast(z), aznumeric_cast(w)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromValues, k_categoryName, "{725D79B8-1CB1-4473-8480-4DE584C75540}", "returns a vector from elements", "X", "Y", "Z", "W"); - + AZ_INLINE Vector4Type FromVector3AndNumber(Vector3Type source, const NumberType w) { return Vector4Type::CreateFromVector3AndFloat(source, aznumeric_cast(w)); } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromVector3AndNumber, k_categoryName, "{577E2B26-BEC1-4CC7-B23B-5172ED1BFF6E}", "returns a vector with x,y,z from Source and w from W", "Source", "W"); - + AZ_INLINE NumberType GetElement(const Vector4Type source, const NumberType index) { return source.GetElement(AZ::GetClamp(aznumeric_cast(index), 0, 3)); @@ -99,7 +99,7 @@ namespace ScriptCanvas return source; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Homogenize, k_categoryName, "{9A3FAB19-0442-44A5-8454-12003BA146EE}", "returns a vector with all components divided by the w element", "Source"); - + AZ_INLINE BooleanType IsClose(const Vector4Type a, const Vector4Type b, NumberType tolerance) { return a.IsClose(b, aznumeric_cast(tolerance)); @@ -212,8 +212,8 @@ namespace ScriptCanvas return lhs - rhs; } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Subtract, k_categoryName, "{A5FA6465-9C39-4A44-BD7C-E8ECF9503E46}", "This node is deprecated, use Subtract (-), it provides contextual type and slots", "A", "B"); - - using Registrar = RegistrarGeneric< + + using Registrar = RegistrarGeneric < AbsoluteNode, AddNode, DivideByNumberNode, @@ -260,8 +260,8 @@ namespace ScriptCanvas ReciprocalNode, SubtractNode - >; + > ; } -} +} 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 dcfe5fed56..658c561c8b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp @@ -41,7 +41,7 @@ namespace ScriptCanvas slotConfiguration.m_toolTip = "The value at the specified index"; slotConfiguration.m_displayGroup = GetSourceDisplayGroup(); slotConfiguration.SetType(type); - slotConfiguration.SetConnectionType(ConnectionType::Output); + slotConfiguration.SetConnectionType(ConnectionType::Output); m_outputSlots.insert(AddSlot(slotConfiguration)); } 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 9af3f183b1..7628aa10cc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp @@ -50,7 +50,7 @@ namespace ScriptCanvas slotConfiguration.m_name = Data::GetName(type); slotConfiguration.m_displayGroup = GetSourceDisplayGroup(); slotConfiguration.SetType(type); - slotConfiguration.SetConnectionType(ConnectionType::Input); + slotConfiguration.SetConnectionType(ConnectionType::Input); m_inputSlots.insert(AddSlot(slotConfiguration)); } 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 40fbe6f54b..f24bfb2890 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp @@ -66,7 +66,7 @@ namespace ScriptCanvas AZ::SerializeContext::DataElementNode baseNodeElement = operatorBaseClass->GetSubElement(nodeElementIndex); classElement.RemoveElementByName(AZ::Crc32("BaseClass1")); - classElement.AddElement(baseNodeElement); + classElement.AddElement(baseNodeElement); } return true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h index 71c89c75e9..c323977d33 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.h @@ -33,7 +33,7 @@ namespace ScriptCanvas // Node... void OnInit() override; //// - }; + }; } } } 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 a82e8f9871..0eaf7a9a85 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp @@ -45,13 +45,13 @@ namespace ScriptCanvas Data::ColorType operator()(const Data::ColorType& lhs, const Datum& rhs) { const AZ::Color* dataRhs = rhs.GetAs(); - + float a = AZ::GetClamp(lhs.GetA(), 0.f, 1.f) + AZ::GetClamp(dataRhs->GetA(), 0.f, 1.f); float r = AZ::GetClamp(lhs.GetR(), 0.f, 1.f) + AZ::GetClamp(dataRhs->GetR(), 0.f, 1.f); float g = AZ::GetClamp(lhs.GetG(), 0.f, 1.f) + AZ::GetClamp(dataRhs->GetG(), 0.f, 1.f); float b = AZ::GetClamp(lhs.GetB(), 0.f, 1.f) + AZ::GetClamp(dataRhs->GetB(), 0.f, 1.f); - return AZ::Color(r, g, b, a); + return AZ::Color(r, g, b, a); } }; 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 4e777fff2f..a1dcbbc0e7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp @@ -73,7 +73,7 @@ namespace ScriptCanvas { // Version conversion for previous elements for (Slot& currentSlot : ModSlots()) - { + { if (currentSlot.IsData()) { auto& contracts = currentSlot.GetContracts(); @@ -89,7 +89,7 @@ namespace ScriptCanvas contract->SetSupportedOperator(OperatorFunction()); contract->SetSupportedNativeTypes(GetSupportedNativeDataTypes()); } - } + } } if (!currentSlot.IsDynamicSlot()) @@ -110,17 +110,17 @@ namespace ScriptCanvas void OperatorArithmetic::OnActivate() { if (m_scrapedInputs) - { + { m_scrapedInputs = false; m_applicableInputs.clear(); - m_result.ReconfigureDatumTo(AZStd::move(ScriptCanvas::Datum())); + m_result.ReconfigureDatumTo(AZStd::move(ScriptCanvas::Datum())); } } void OperatorArithmetic::ConfigureVisualExtensions() { - { + { VisualExtensionSlotConfiguration visualExtensions(VisualExtensionSlotConfiguration::VisualExtensionType::ExtenderSlot); visualExtensions.m_name = "Add Operand"; @@ -150,12 +150,12 @@ namespace ScriptCanvas bool OperatorArithmetic::CanDeleteSlot(const SlotId& slotId) const { - Slot* slot = GetSlot(slotId); + Slot* slot = GetSlot(slotId); if (slot && slot->GetDynamicGroup() == GetArithmeticDynamicTypeGroup()) { if (!slot->IsOutput()) - { + { auto slotList = GetSlotsWithDynamicGroup(GetArithmeticDynamicTypeGroup()); int inputCount = 0; @@ -185,14 +185,14 @@ namespace ScriptCanvas } else if (operands.size() == 1) { - const Datum* operand = operands.front(); + const Datum* operand = operands.front(); result = (*operand); return; } auto type = result.GetType(); - Operator(type.GetType(), operands, result); - } + Operator(type.GetType(), operands, result); + } void OperatorArithmetic::Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h index 5b2ea00871..86a5b17c52 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.h @@ -65,7 +65,7 @@ namespace ScriptCanvas AZ::Crc32 GetArithmeticExtensionId() const { return AZ_CRC("AddnewValueExtension", 0xea20301c); } AZ::Crc32 GetArithmeticDynamicTypeGroup() const { return AZ_CRC("ArithmeticGroup", 0x4271e41f); } AZStd::string GetArithmeticDisplayGroup() const { return "ArithmeticGroup"; } - + virtual AZStd::string_view OperatorFunction() const { return ""; } virtual AZStd::unordered_set< Data::Type > GetSupportedNativeDataTypes() const { @@ -81,14 +81,14 @@ namespace ScriptCanvas Data::Type::Matrix4x4() }; } - + // Node void OnSlotDisplayTypeChanged(const SlotId& slotId, const Data::Type& dataType) override final; void OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) override final; - + void OnConfigured() override; void OnInit() override; - void OnActivate() override; + void OnActivate() override; void ConfigureVisualExtensions() override; SlotId HandleExtension(AZ::Crc32 extensionId) override; @@ -100,7 +100,7 @@ namespace ScriptCanvas virtual void Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result); virtual void InitializeSlot(const SlotId& slotId, const Data::Type& dataType); - + ////////////////////////////////////////////////////////////////////////// // Translation AZ::Outcome GetDependencies() const override; @@ -128,7 +128,7 @@ namespace ScriptCanvas Slot* m_resultSlot; SlotId m_outSlot; }; - + //! Deprecated: kept here for version conversion class OperatorArithmeticUnary : public OperatorArithmetic { 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 b50d06e9e9..8d26ad221f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp @@ -27,7 +27,7 @@ namespace ScriptCanvas Type operator()(const Type& a, const Datum& b) { const Type* dataB = b.GetAs(); - + const Type& divisor = (*dataB); if (AZ::IsClose(divisor, Type(0), std::numeric_limits::epsilon())) { @@ -35,7 +35,7 @@ namespace ScriptCanvas return Type(0); } - return a / divisor; + return a / divisor; } private: @@ -65,9 +65,9 @@ namespace ScriptCanvas SCRIPTCANVAS_REPORT_ERROR((*m_node), "Divide by Zero"); return VectorType(0); } - } - - return a / (*divisor); + } + + return a / (*divisor); } OperatorDivVectorTypes(Node* node) @@ -114,7 +114,7 @@ namespace ScriptCanvas { const AZ::Color* dataA = lhs.GetAs(); const AZ::Color* dataB = rhs.GetAs(); - + if (dataB->IsClose(AZ::Color(), std::numeric_limits::epsilon())) { // Divide by zero diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.h index 61121ff85d..37089fe5ec 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.h @@ -33,7 +33,7 @@ namespace ScriptCanvas protected: - void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override; + void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override; bool IsValidArithmeticSlot(const SlotId& slotId) const override; void OnResetDatumToDefaultValue(ModifiableDatumView& datumView) override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h index bb33242ad4..c1eb08fddc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.h @@ -19,9 +19,9 @@ namespace ScriptCanvas #define DIVIDABLE_TYPES { Data::Type::Number(), Data::Type::Vector2(), Data::Type::Vector3(), Data::Type::Vector4() } //! Deprecated: see MethodOverloaded for "Divide by Number (/)" - class OperatorDivideByNumber + class OperatorDivideByNumber : public Node - { + { public: SCRIPTCANVAS_NODE(OperatorDivideByNumber); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp index d5cbadbfee..43b1be3f6d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.cpp @@ -25,7 +25,7 @@ namespace ScriptCanvas SlotId stepId = LerpBetweenProperty::GetStepSlotId(this); if (stepId.IsValid()) - { + { for (const SlotId& slotId : { m_startSlotId, m_stopSlotId, m_speedSlotId, stepId }) { Slot* slot = GetSlot(slotId); @@ -54,7 +54,7 @@ namespace ScriptCanvas void LerpBetween::OnConfigured() { SetupInternalSlotReferences(); - } + } void LerpBetween::SetupInternalSlotReferences() { @@ -66,7 +66,7 @@ namespace ScriptCanvas m_stepSlotId = LerpBetweenProperty::GetStepSlotId(this); m_percentSlotId = LerpBetweenProperty::GetPercentSlotId(this); } - + bool LerpBetween::IsGroupConnected() const { bool hasConnections = false; @@ -78,10 +78,10 @@ namespace ScriptCanvas break; } } - + return hasConnections; } - + bool LerpBetween::IsInGroup(const SlotId& slotId) const { return m_groupedSlotIds.count(slotId) > 0; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h index 7b8b7d2143..f6f67f30bf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerp.h @@ -25,7 +25,7 @@ namespace ScriptCanvas #define LERPABLE_TYPES { Data::Type::Number(), Data::Type::Vector2(), Data::Type::Vector3(), Data::Type::Vector4() } //! Deprecated: see NodeableNodeOverloadedLerp - class LerpBetween + class LerpBetween : public Node { public: @@ -50,21 +50,21 @@ namespace ScriptCanvas LerpBetween() = default; ~LerpBetween() override = default; - + void OnInit() override; void OnConfigured() override; - + private: void SetupInternalSlotReferences(); bool IsGroupConnected() const; - bool IsInGroup(const SlotId& slotId) const; - + bool IsInGroup(const SlotId& slotId) const; + AZStd::unordered_set< SlotId > m_groupedSlotIds; - + float m_duration; float m_counter; - + Datum m_startDatum; Datum m_differenceDatum; }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeable.h index 3807bff5e7..813c433a4f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeable.h @@ -129,7 +129,7 @@ namespace ScriptCanvas return AZ::TickBus::Handler::BusIsConnected() || AZ::SystemTickBus::Handler::BusIsConnected(); } - + protected: size_t GetRequiredOutCount() const override { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.cpp index 6082e768ef..4ae3ff8c1f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.cpp @@ -189,7 +189,7 @@ namespace ScriptCanvas dataSlotConfiguration.SetConnectionType(ScriptCanvas::ConnectionType::Output); dataSlotConfiguration.m_dynamicDataType = DynamicDataType::Value; - + SlotId slotIdStep = AddSlot(dataSlotConfiguration); AZ_Assert(slotIdStep.IsValid(), "Data slot is not created successfully."); latentOut.outputs.push_back(slotIdStep); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.h index 27b1f85612..1c2ed58403 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.h @@ -29,7 +29,7 @@ namespace ScriptCanvas AZ::Crc32 GetDataDynamicGroup() const { return AZ_CRC("LerpDataDynamicGroup", 0x62b5f89e); } }; - } + } -} +} 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 62d10ba58d..1eaba6bf17 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp @@ -75,7 +75,7 @@ namespace ScriptCanvas break; case Data::eType::Matrix4x4: OperatorEvaluator::Evaluate(OperatorMulImpl(), operands, result); - break; + break; default: AZ_Assert(false, "Multiplication operator not defined for type: %s", Data::ToAZType(type).ToString().c_str()); break; @@ -88,7 +88,7 @@ namespace ScriptCanvas FindModifiableDatumView(slotId, datumView); OnResetDatumToDefaultValue(datumView); - } + } bool OperatorMul::IsValidArithmeticSlot(const SlotId& slotId) const { @@ -110,7 +110,7 @@ namespace ScriptCanvas return (datum != nullptr); } - void OperatorMul::OnResetDatumToDefaultValue(ModifiableDatumView& datumView) + void OperatorMul::OnResetDatumToDefaultValue(ModifiableDatumView& datumView) { Data::Type displayType = GetDisplayType(GetArithmeticDynamicTypeGroup()); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.h index e901aa519b..91ec6cc112 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.h @@ -29,7 +29,7 @@ namespace ScriptCanvas AZStd::unordered_set< Data::Type > GetSupportedNativeDataTypes() const override; void Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result) override; - + protected: void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override; 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 1246feb521..82e16591a3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp @@ -50,7 +50,7 @@ namespace ScriptCanvas { const AZ::Matrix3x3* dataRhs = rhs.GetAs(); - return AZ::Matrix3x3::CreateFromColumns(lhs.GetColumn(0) - dataRhs->GetColumn(0), lhs.GetColumn(1) - dataRhs->GetColumn(1), lhs.GetColumn(2) - dataRhs->GetColumn(2)); + return AZ::Matrix3x3::CreateFromColumns(lhs.GetColumn(0) - dataRhs->GetColumn(0), lhs.GetColumn(1) - dataRhs->GetColumn(1), lhs.GetColumn(2) - dataRhs->GetColumn(2)); } }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.h index 2797a4fdea..bf1db9bfe2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.h @@ -17,7 +17,7 @@ namespace ScriptCanvas namespace Operators { //! Node that provides subtraction - class OperatorSub: public OperatorArithmetic + class OperatorSub : public OperatorArithmetic { public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp index 329b8d4c31..94b42d2829 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp @@ -182,7 +182,7 @@ namespace ScriptCanvas break; } } - } + } if (!handledConfiguration) { @@ -250,7 +250,7 @@ namespace ScriptCanvas if (handledConfiguration) { - configurationIter = unhandledConfigurations.erase(configurationIter); + configurationIter = unhandledConfigurations.erase(configurationIter); } else { @@ -296,7 +296,7 @@ namespace ScriptCanvas m_sourceDisplayType = dataType; OnDisplayTypeChanged(dataType); } - } + } } void OperatorBase::OnSlotRemoved(const SlotId& slotId) @@ -319,7 +319,7 @@ namespace ScriptCanvas return nullptr; } - + Slot* OperatorBase::GetFirstOutputSourceSlot() const { for (const SlotId& slotId : m_sourceSlots) @@ -429,7 +429,7 @@ namespace ScriptCanvas bool isInBatchAdd = false; GraphRequestBus::EventResult(isInBatchAdd, GetOwningScriptCanvasId(), &GraphRequests::IsBatchAddingGraphData); - + if (IsSourceSlotId(currentSlotId)) { auto node = AZ::EntityUtils::FindFirstDerivedComponent(endpoint.GetNodeId()); @@ -493,7 +493,7 @@ namespace ScriptCanvas } SlotId OperatorBase::AddSlotWithSourceType() - { + { Data::Type type = Data::Type::Invalid(); if (!m_sourceTypes.empty()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h index 9882ff4564..57efee7faf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h @@ -22,7 +22,7 @@ namespace ScriptCanvas { namespace Operators { - class OperatorBase + class OperatorBase : public ScriptCanvas::Node { public: @@ -41,7 +41,7 @@ namespace ScriptCanvas { SourceType m_sourceType = SourceType::SourceInput; - DynamicDataType m_dynamicDataType = DynamicDataType::Any; + DynamicDataType m_dynamicDataType = DynamicDataType::Any; AZStd::string m_name; AZStd::string m_tooltip; @@ -103,7 +103,7 @@ namespace ScriptCanvas virtual void OnInputSlotAdded(const SlotId& inputSlotId) { AZ_UNUSED(inputSlotId); }; virtual void OnDataInputSlotConnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {} - virtual void OnDataInputSlotDisconnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {} + virtual void OnDataInputSlotDisconnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {} AZ::BehaviorMethod* GetOperatorMethod(const char* methodName); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operators.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operators.cpp index 6a35c246c9..b1ee7bf471 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operators.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operators.cpp @@ -49,7 +49,7 @@ namespace ScriptCanvas void Operators::InitNodeRegistry(NodeRegistry& nodeRegistry) { using namespace ScriptCanvas::Nodes::Operators; - + // Math AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h index 3a913826c2..05bf91f5dd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h @@ -20,8 +20,8 @@ namespace ScriptCanvas::Nodeables::Spawning { class SpawnNodeable - : public ScriptCanvas::Nodeable, - public AZ::TickBus::Handler + : public ScriptCanvas::Nodeable + , public AZ::TickBus::Handler { SCRIPTCANVAS_NODE(SpawnNodeable); public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp index d05f2cd5ac..b362209cb0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp @@ -6,14 +6,3 @@ */ #include "Format.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace String - { - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h index c325414ca3..fef7fb2bd7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Utilities.h @@ -24,7 +24,7 @@ namespace ScriptCanvas { public: SCRIPTCANVAS_NODE(StartsWith); - }; + }; //! Deprecated: see class String's reflection of method "Ends With" class EndsWith diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h index f859c9900c..00bc52edfa 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Countdown.h @@ -62,7 +62,7 @@ namespace ScriptCanvas }; //! Deprecated: see DelayNodeableNode - class Countdown + class Countdown : public Node { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.h index 260f0dd5f0..8d3231f170 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.h @@ -21,13 +21,13 @@ namespace ScriptCanvas { namespace Time { - class DelayNodeable + class DelayNodeable : public ScriptCanvas::Nodeable , public AZ::TickBus::Handler { public: SCRIPTCANVAS_NODE(DelayNodeable); - + protected: void OnDeactivate() override; @@ -43,7 +43,7 @@ namespace ScriptCanvas float m_currentTime = 0.0f; float m_holdTime = 0.0f; - void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime); + void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime); }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h index 481f0c97be..98136225c6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Duration.h @@ -23,7 +23,7 @@ namespace ScriptCanvas namespace Time { //! Deprecated: see DurationNodeableNode - class Duration + class Duration : public Node { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.h index 2915232cff..1b0169699b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.h @@ -21,7 +21,7 @@ namespace ScriptCanvas { namespace Time { - class DurationNodeable + class DurationNodeable : public ScriptCanvas::Nodeable , public AZ::TickBus::Handler { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h index 680e974429..1e12395834 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/HeartBeat.h @@ -33,7 +33,7 @@ namespace ScriptCanvas protected: - }; + }; } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Time.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Time.cpp index 7a6e5bc859..e55ddb3b35 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Time.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Time.cpp @@ -57,7 +57,7 @@ namespace ScriptCanvas AddNodeToRegistry(nodeRegistry); AddNodeToRegistry(nodeRegistry); } - + AZStd::vector Time::GetComponentDescriptors() { return AZStd::vector({ @@ -73,7 +73,7 @@ namespace ScriptCanvas ScriptCanvas::Nodes::HeartBeatNodeableNode::CreateDescriptor(), ScriptCanvas::Nodes::TimeDelayNodeableNode::CreateDescriptor(), ScriptCanvas::Nodes::TimerNodeableNode::CreateDescriptor(), - }); + }); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h index 14fa3a767c..8cabda3f15 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.h @@ -23,7 +23,7 @@ namespace ScriptCanvas namespace Time { //! Deprecated: See TimerNodeableNode - class Timer + class Timer : public Node { public: @@ -31,7 +31,7 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(Timer); Timer(); - + float m_seconds; float m_milliseconds; }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.h index 2e73dc524c..e2de4b25ba 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.h @@ -21,7 +21,7 @@ namespace ScriptCanvas { namespace Time { - class TimerNodeable + class TimerNodeable : public Nodeables::Time::BaseTimer { SCRIPTCANVAS_NODE(TimerNodeable); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp index 55eded5b2f..b27065aca2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp @@ -9,13 +9,3 @@ #include "UnitTestBus.h" -namespace ScriptCanvas -{ - namespace Nodes - { - namespace UnitTesting - { - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.cpp index dff5dff30c..d9da655cc3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.cpp @@ -37,8 +37,8 @@ namespace ScriptCanvas } const char* StringConversion::CStyleToCStyle(const char* input) - { - return input; + { + return input; } void StringConversion::Reflect(AZ::ReflectContext* reflection) @@ -69,17 +69,17 @@ namespace ScriptCanvas ->Field("outcomeVector3Void", &TypeExposition::m_outcomeVector3Void) ; } - + if (auto behaviorContext = azrtti_cast(reflection)) { behaviorContext->Class("TypeExposition") ->Method("Reflect_AZStd::array", [](AZStd::array& vector) { return vector.size(); }) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) ->Method("Reflect_AZ::Outcome", [](AZ::Outcome& vector) { return vector.IsSuccess(); }) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) ; } } } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h index 94c307e07d..a56dd8775b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h @@ -36,14 +36,14 @@ namespace ScriptCanvas }; using EBus = AZ::EBus; - - class EBusHandler + + class EBusHandler : public EBus::Handler , public AZ::BehaviorEBusHandler { public: AZ_EBUS_BEHAVIOR_BINDER - ( EBusHandler + (EBusHandler , "{5168D163-AAB9-417D-9FD4-CE10541D51CE}" , AZ::SystemAllocator , CStyleToCStyle @@ -95,14 +95,14 @@ namespace ScriptCanvas return result; } }; - + class StringConversion { public: AZ_TYPE_INFO(StringConversion, "{47A9CF0C-6F34-4E0C-B1F9-F908FC2B7388}"); static const char* CStyleToCStyle(const char* input); - + static void Reflect(AZ::ReflectContext* reflection); }; @@ -118,5 +118,5 @@ namespace ScriptCanvas AZ::Outcome m_outcomeVector3Void; }; } - } -} + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp index 6e2931112d..b2d4279b5c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp @@ -50,6 +50,6 @@ namespace ScriptCanvas } //// } - } - } -} + } + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h index 12d28af093..c5d163bb88 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectTrue.h @@ -24,7 +24,7 @@ namespace ScriptCanvas SCRIPTCANVAS_NODE(ExpectTrue); - void OnInit() override; + void OnInit() override; }; } } From 80bdd4e17b615c910b488ab75c441985c85262dd Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Wed, 7 Jul 2021 14:34:45 -0700 Subject: [PATCH 099/156] Clang compile fixes (#1876) * Fix compile error from -Wwritable-strings Signed-off-by: Chris Burel * Fix flags used to build MaskedOcclusionCulling with clang Signed-off-by: Chris Burel * Fix class that has a final destructor, but the class itself was not final Signed-off-by: Chris Burel --- .../IO/Streamer/StorageDriveTests_Windows.cpp | 2 +- Gems/Atom/RPI/Code/CMakeLists.txt | 2 ++ .../Common/Clang/atom_rpi_public_clang.cmake | 18 ++++++++++++++++++ .../Common/MSVC/atom_rpi_public_msvc.cmake | 19 +++++++++++++++++++ .../Source/Platform/Windows/PAL_windows.cmake | 13 ------------- .../SceneAPIExt/Rules/MotionMetaDataRule.h | 4 ++-- 6 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 Gems/Atom/RPI/Code/Source/Platform/Common/Clang/atom_rpi_public_clang.cmake create mode 100644 Gems/Atom/RPI/Code/Source/Platform/Common/MSVC/atom_rpi_public_msvc.cmake diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp index e654ef4aa3..b505bba5dd 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp @@ -1155,7 +1155,7 @@ namespace Benchmark class StorageDriveWindowsFixture : public benchmark::Fixture { public: - constexpr static char* TestFileName = "StreamerBenchmark.bin"; + constexpr static const char* TestFileName = "StreamerBenchmark.bin"; constexpr static size_t FileSize = 64_mib; void SetupStreamer(bool enableFileSharing) diff --git a/Gems/Atom/RPI/Code/CMakeLists.txt b/Gems/Atom/RPI/Code/CMakeLists.txt index 71e5d82e48..d806b8c687 100644 --- a/Gems/Atom/RPI/Code/CMakeLists.txt +++ b/Gems/Atom/RPI/Code/CMakeLists.txt @@ -25,6 +25,8 @@ ly_add_target( ../Assets/atom_rpi_asset_files.cmake ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake ${MASKED_OCCLUSION_CULLING_FILES} + PLATFORM_INCLUDE_FILES + ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/atom_rpi_public_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake INCLUDE_DIRECTORIES PRIVATE Source diff --git a/Gems/Atom/RPI/Code/Source/Platform/Common/Clang/atom_rpi_public_clang.cmake b/Gems/Atom/RPI/Code/Source/Platform/Common/Clang/atom_rpi_public_clang.cmake new file mode 100644 index 0000000000..88309e590c --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/Platform/Common/Clang/atom_rpi_public_clang.cmake @@ -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 +# +# + +ly_add_source_properties( + SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX2.cpp + PROPERTY COMPILE_OPTIONS + VALUES -mavx2 -mfma -msse4.1 +) + +ly_add_source_properties( + SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp + PROPERTY COMPILE_OPTIONS + VALUES -mno-avx +) diff --git a/Gems/Atom/RPI/Code/Source/Platform/Common/MSVC/atom_rpi_public_msvc.cmake b/Gems/Atom/RPI/Code/Source/Platform/Common/MSVC/atom_rpi_public_msvc.cmake new file mode 100644 index 0000000000..50cfc8a179 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/Platform/Common/MSVC/atom_rpi_public_msvc.cmake @@ -0,0 +1,19 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +ly_add_source_properties( + SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX2.cpp + PROPERTY COMPILE_OPTIONS + VALUES /arch:AVX2 /W3 +) +ly_add_source_properties( + SOURCES + External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX512.cpp + External/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp + PROPERTY COMPILE_OPTIONS + VALUES /W3 +) diff --git a/Gems/Atom/RPI/Code/Source/Platform/Windows/PAL_windows.cmake b/Gems/Atom/RPI/Code/Source/Platform/Windows/PAL_windows.cmake index 896f505d05..a9e3cf10f9 100644 --- a/Gems/Atom/RPI/Code/Source/Platform/Windows/PAL_windows.cmake +++ b/Gems/Atom/RPI/Code/Source/Platform/Windows/PAL_windows.cmake @@ -7,16 +7,3 @@ set (PAL_TRAIT_BUILD_ATOM_RPI_ASSETS_SUPPORTED TRUE) set (PAL_TRAIT_BUILD_ATOM_RPI_MASKED_OCCLUSION_CULLING_SUPPORTED TRUE) - -ly_add_source_properties( - SOURCES External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX2.cpp - PROPERTY COMPILE_OPTIONS - VALUES /arch:AVX2 /W3 -) -ly_add_source_properties( - SOURCES - External/MaskedOcclusionCulling/MaskedOcclusionCullingAVX512.cpp - External/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp - PROPERTY COMPILE_OPTIONS - VALUES /W3 -) \ No newline at end of file diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionMetaDataRule.h b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionMetaDataRule.h index 873dccef72..e2f530a887 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionMetaDataRule.h +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionMetaDataRule.h @@ -37,7 +37,7 @@ namespace EMotionFX::Pipeline::Rule AZStd::unique_ptr m_motionEventTable; }; - class MotionMetaDataRule + class MotionMetaDataRule final : public ExternalToolRule> { public: @@ -46,7 +46,7 @@ namespace EMotionFX::Pipeline::Rule MotionMetaDataRule(); MotionMetaDataRule(const AZStd::shared_ptr& data); - ~MotionMetaDataRule() final = default; + ~MotionMetaDataRule() = default; const AZStd::shared_ptr& GetData() const override { return m_data; } void SetData(const AZStd::shared_ptr& data) override { m_data = data; } From 3037837be6b9dff3ebd2a1031feb5a4fa3e381fc Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 7 Jul 2021 16:37:25 -0500 Subject: [PATCH 100/156] Fixed logic to remove the tabs not close them. Signed-off-by: Chris Galvan --- .../AzQtComponents/Components/FancyDocking.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp index 3b9fe9f011..7417bed2a0 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FancyDocking.cpp @@ -3297,7 +3297,12 @@ namespace AzQtComponents continue; } - tabWidget->closeTabs(); + // Remove the tabs from the tab widget (we don't actually want to close them, which could delete them at this point) + int numTabs = tabWidget->count(); + for (int i = 0; i < numTabs; ++i) + { + tabWidget->removeTab(0); + } } // Restore the floating windows From 1b474afdb085748042e2d17c5c2b40b4e8f8a6c1 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Wed, 7 Jul 2021 14:55:36 -0700 Subject: [PATCH 101/156] ATOM-14322 Random crashes when exist RHI/Raytracing sample running __fullTestSuite__ (#1926) Signed-off-by: Tao --- Gems/Atom/RHI/Code/Source/RHI/RayTracingPipelineState.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/Atom/RHI/Code/Source/RHI/RayTracingPipelineState.cpp b/Gems/Atom/RHI/Code/Source/RHI/RayTracingPipelineState.cpp index 5e5932456e..480c11b7c9 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RayTracingPipelineState.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RayTracingPipelineState.cpp @@ -142,6 +142,8 @@ namespace AZ void RayTracingPipelineState::Shutdown() { + ShutdownInternal(); + DeviceObject::Shutdown(); } } } From 5b9647c11b319b5cc3b898754d70730180466e5d Mon Sep 17 00:00:00 2001 From: Tommy Walton <82672795+amzn-tommy@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:08:57 -0700 Subject: [PATCH 102/156] Fix for ATOM-15923 : Editor Spends Several Minutes Entering/Ending Play Game Mode (#1846) * Cut off kd-tree generation if more than 10 percent of triangles straddle split axis Signed-off-by: amzn-tommy * Switched to aznumeric_cast and added a comment with a JIRA to follow up on Signed-off-by: amzn-tommy --- .../RPI/Code/Include/Atom/RPI.Reflect/Model/ModelKdTree.h | 3 ++- Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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 cd3f1968bf..fc915bcd07 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 @@ -67,7 +67,8 @@ namespace AZ void ConstructMeshList(const ModelAsset* model, const AZ::Transform& matParent); static const int s_MinimumVertexSizeInLeafNode = 3 * 10; - + // Stop splitting the tree if more than 10% of the triangles are straddling the split axis + static constexpr float s_MaximumSplitAxisStraddlingTriangles = 1.1; AZStd::unique_ptr m_pRootNode; struct MeshData 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 54ec002893..ace4df5c0b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp @@ -84,7 +84,11 @@ namespace AZ // If either the top or bottom contain all the input indices, the triangles are too close to cut any // further and the split failed - return indices.size() != outInfo.m_aboveIndices.size() && indices.size() != outInfo.m_belowIndices.size(); + // Additionally, if too many triangles straddle the split-axis, + // the triangles are too close and the split failed + // [ATOM-15944] - Use a more sophisticated method to terminate KdTree generation + return indices.size() != outInfo.m_aboveIndices.size() && indices.size() != outInfo.m_belowIndices.size() + && aznumeric_cast(outInfo.m_aboveIndices.size() + outInfo.m_belowIndices.size()) / aznumeric_cast(indices.size()) < s_MaximumSplitAxisStraddlingTriangles; } bool ModelKdTree::Build(const ModelAsset* model) From f177f671ac14d24ac46d10df835aa611df4a8f30 Mon Sep 17 00:00:00 2001 From: Tommy Walton <82672795+amzn-tommy@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:09:14 -0700 Subject: [PATCH 103/156] Fix for LYN-4594: [Atom][EMFX] Loading a saved level with entity and an actor component causes the editor to freeze. (DCO fixup) (#1878) * Queue shader loads and register with the dynamic draw context after the shader is loaded to avoid a deadlock when there are multiple scenes processing at the same time. Signed-off-by: amzn-tommy * Fixed AzCore case in AtomFont.h and two other files I found while searching Signed-off-by: amzn-tommy * Switched to a utility that will both get the assetId and create the Asset, without calling GetAsset explicitely Signed-off-by: amzn-tommy * Fixing typos in error message Signed-off-by: amzn-tommy --- .../AtomLyIntegration/AtomFont/AtomFont.h | 5 ++ .../AtomFont/Code/Source/AtomFont.cpp | 56 +++++++++++++------ ...tomViewportDisplayIconsSystemComponent.cpp | 39 +++++++++---- .../AtomViewportDisplayIconsSystemComponent.h | 4 ++ Gems/Blast/Code/Include/Blast/BlastDebug.h | 2 +- .../Code/Source/Family/ActorRenderManager.h | 2 +- 6 files changed, 78 insertions(+), 30 deletions(-) diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont.h b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont.h index 9fe3f2c25b..9e6c38a939 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont.h +++ b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,7 @@ namespace AZ class AtomFont : public ICryFont , public AzFramework::FontQueryInterface + , private Data::AssetBus::Handler { friend class FFont; @@ -122,6 +124,9 @@ namespace AZ //! \param outputFullPath Full path to loaded font family, may need resolving with PathUtil::MakeGamePath. XmlNodeRef LoadFontFamilyXml(const char* fontFamilyName, string& outputDirectory, string& outputFullPath); + // Data::AssetBus::Handler overrides... + void OnAssetReady(Data::Asset asset) override; + private: AzFramework::ISceneSystem::SceneEvent::Handler m_sceneEventHandler; diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp index 114dbf62bb..cb157b95f6 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp @@ -29,6 +29,7 @@ #include #include +#include // Static member definitions const AZ::AtomFont::GlyphSize AZ::AtomFont::defaultGlyphSize = AZ::AtomFont::GlyphSize(ICryFont::defaultGlyphSizeX, ICryFont::defaultGlyphSizeY); @@ -349,30 +350,18 @@ AZ::AtomFont::AtomFont(ISystem* system) #endif AZ::Interface::Register(this); - // register font per viewport dynamic draw context. + // Queue a load for the font per viewport dynamic draw context shader, and wait for it to load static const char* shaderFilepath = "Shaders/SimpleTextured.azshader"; - AZ::AtomBridge::PerViewportDynamicDraw::Get()->RegisterDynamicDrawContext( - AZ::Name(AZ::AtomFontDynamicDrawContextName), - [](RPI::Ptr drawContext) - { - Data::Instance shader = AZ::RPI::LoadShader(shaderFilepath); - AZ::RPI::ShaderOptionList shaderOptions; - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("false"))); - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); - drawContext->InitShaderWithVariant(shader, &shaderOptions); - drawContext->InitVertexFormat( - { - {"POSITION", RHI::Format::R32G32B32_FLOAT}, - {"COLOR", RHI::Format::B8G8R8A8_UNORM}, - {"TEXCOORD0", RHI::Format::R32G32_FLOAT} - }); - drawContext->EndInit(); - }); + Data::Asset shaderAsset = RPI::AssetUtils::GetAssetByProductPath(shaderFilepath, RPI::AssetUtils::TraceLevel::Assert); + shaderAsset.QueueLoad(); + Data::AssetBus::Handler::BusConnect(shaderAsset.GetId()); } AZ::AtomFont::~AtomFont() { + Data::AssetBus::Handler::BusDisconnect(); + AZ::Interface::Unregister(this); m_defaultFontDrawInterface = nullptr; @@ -864,5 +853,36 @@ XmlNodeRef AZ::AtomFont::LoadFontFamilyXml(const char* fontFamilyName, string& o return root; } + +void AZ::AtomFont::OnAssetReady(Data::Asset asset) +{ + Data::Asset shaderAsset = asset; + + AZ::AtomBridge::PerViewportDynamicDraw::Get()->RegisterDynamicDrawContext( + AZ::Name(AZ::AtomFontDynamicDrawContextName), + [shaderAsset](RPI::Ptr drawContext) + { + AZ_Assert(shaderAsset->IsReady(), "Attempting to register the AtomFont" + " dynamic draw context before the shader asset is loaded. The shader should be loaded first" + " to avoid a blocking asset load and potential deadlock, since the DynamicDrawContext lambda" + " will be executed during scene processing and there may be multiple scenes executing in parallel."); + + Data::Instance shader = RPI::Shader::FindOrCreate(shaderAsset); + AZ::RPI::ShaderOptionList shaderOptions; + shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("false"))); + shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); + drawContext->InitShaderWithVariant(shader, &shaderOptions); + drawContext->InitVertexFormat( + { + {"POSITION", RHI::Format::R32G32B32_FLOAT}, + {"COLOR", RHI::Format::B8G8R8A8_UNORM}, + {"TEXCOORD0", RHI::Format::R32G32_FLOAT} + }); + drawContext->EndInit(); + }); + + Data::AssetBus::Handler::BusDisconnect(); +} + #endif diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp index 305fad8ad0..f3f06a2efc 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -87,6 +88,7 @@ namespace AZ::Render void AtomViewportDisplayIconsSystemComponent::Deactivate() { + Data::AssetBus::Handler::BusDisconnect(); Bootstrap::NotificationBus::Handler::BusDisconnect(); auto perViewportDynamicDrawInterface = AtomBridge::PerViewportDynamicDraw::Get(); @@ -338,15 +340,32 @@ namespace AZ::Render void AtomViewportDisplayIconsSystemComponent::OnBootstrapSceneReady([[maybe_unused]]AZ::RPI::Scene* bootstrapScene) { - AtomBridge::PerViewportDynamicDraw::Get()->RegisterDynamicDrawContext(m_drawContextName, [](RPI::Ptr drawContext) - { - auto shader = RPI::LoadShader(DrawContextShaderPath); - drawContext->InitShader(shader); - drawContext->InitVertexFormat( - {{"POSITION", RHI::Format::R32G32B32_FLOAT}, - {"COLOR", RHI::Format::R8G8B8A8_UNORM}, - {"TEXCOORD", RHI::Format::R32G32_FLOAT}}); - drawContext->EndInit(); - }); + // Queue a load for the draw context shader, and wait for it to load + Data::Asset shaderAsset = RPI::AssetUtils::GetAssetByProductPath(DrawContextShaderPath, RPI::AssetUtils::TraceLevel::Assert); + shaderAsset.QueueLoad(); + Data::AssetBus::Handler::BusConnect(shaderAsset.GetId()); + } + + void AtomViewportDisplayIconsSystemComponent::OnAssetReady(Data::Asset asset) + { + // Once the shader is loaded, register it with the dynamic draw context + Data::Asset shaderAsset = asset; + AtomBridge::PerViewportDynamicDraw::Get()->RegisterDynamicDrawContext(m_drawContextName, [shaderAsset](RPI::Ptr drawContext) + { + AZ_Assert(shaderAsset->IsReady(), "Attempting to register the AtomViewportDisplayIconsSystemComponent" + " dynamic draw context before the shader asset is loaded. The shader should be loaded first" + " to avoid a blocking asset load and potential deadlock, since the DynamicDrawContext lambda" + " will be executed during scene processing and there may be multiple scenes executing in parallel."); + + Data::Instance shader = RPI::Shader::FindOrCreate(shaderAsset); + drawContext->InitShader(shader); + drawContext->InitVertexFormat( + { {"POSITION", RHI::Format::R32G32B32_FLOAT}, + {"COLOR", RHI::Format::R8G8B8A8_UNORM}, + {"TEXCOORD", RHI::Format::R32G32_FLOAT} }); + drawContext->EndInit(); + }); + + Data::AssetBus::Handler::BusDisconnect(); } } // namespace AZ::Render diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h index 8cb268d36a..cd6fddf745 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h @@ -27,6 +27,7 @@ namespace AZ : public AZ::Component , public AzToolsFramework::EditorViewportIconDisplayInterface , public AZ::Render::Bootstrap::NotificationBus::Handler + , private Data::AssetBus::Handler { public: AZ_COMPONENT(AtomViewportDisplayIconsSystemComponent, "{AEC1D3E1-1D9A-437A-B4C6-CFAEE620C160}"); @@ -51,6 +52,9 @@ namespace AZ // AZ::Render::Bootstrap::NotificationBus::Handler overrides... void OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) override; + // Data::AssetBus::Handler overrides... + void OnAssetReady(Data::Asset asset) override; + private: static constexpr const char* DrawContextShaderPath = "Shaders/TexturedIcon.azshader"; static constexpr QSize MinimumRenderedSvgSize = QSize(128, 128); diff --git a/Gems/Blast/Code/Include/Blast/BlastDebug.h b/Gems/Blast/Code/Include/Blast/BlastDebug.h index 2530eb4217..9613b94ff5 100644 --- a/Gems/Blast/Code/Include/Blast/BlastDebug.h +++ b/Gems/Blast/Code/Include/Blast/BlastDebug.h @@ -8,7 +8,7 @@ #include #include -#include +#include namespace Blast { diff --git a/Gems/Blast/Code/Source/Family/ActorRenderManager.h b/Gems/Blast/Code/Source/Family/ActorRenderManager.h index c4037bb638..c0cdda158c 100644 --- a/Gems/Blast/Code/Source/Family/ActorRenderManager.h +++ b/Gems/Blast/Code/Source/Family/ActorRenderManager.h @@ -8,7 +8,7 @@ #include #include -#include +#include namespace Blast { From 992f5aab1bc38568d99f81f2460b9f13a2cea81e Mon Sep 17 00:00:00 2001 From: Shirang Jia Date: Wed, 7 Jul 2021 15:12:10 -0700 Subject: [PATCH 104/156] Convert Incremental scripts to Python3 (#1934) Convert incremental build script to Python3 --- scripts/build/Jenkins/Jenkinsfile | 8 +- .../build/bootstrap/incremental_build_util.py | 84 +++++++++---------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 8e73524878..a7a796f3b7 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -269,8 +269,8 @@ def PreBuildCommonSteps(Map pipelineConfig, String repositoryName, String projec unstash name: 'incremental_build_script' def pythonCmd = '' - if(env.IS_UNIX) pythonCmd = 'sudo -E python -u ' - else pythonCmd = 'python -u ' + if(env.IS_UNIX) pythonCmd = 'sudo -E python3 -u ' + else pythonCmd = 'python3 -u ' if(env.RECREATE_VOLUME?.toBoolean()) { palSh("${pythonCmd} ${INCREMENTAL_BUILD_SCRIPT_PATH} --action delete --repository_name ${repositoryName} --project ${projectName} --pipeline ${pipeline} --branch ${branchName} --platform ${platform} --build_type ${buildType}", 'Deleting volume', winSlashReplacement=false) @@ -382,8 +382,8 @@ def PostBuildCommonSteps(String workspace, boolean mount = true) { if (mount) { def pythonCmd = '' - if(env.IS_UNIX) pythonCmd = 'sudo -E python -u ' - else pythonCmd = 'python -u ' + if(env.IS_UNIX) pythonCmd = 'sudo -E python3 -u ' + else pythonCmd = 'python3 -u ' try { timeout(5) { diff --git a/scripts/build/bootstrap/incremental_build_util.py b/scripts/build/bootstrap/incremental_build_util.py index 0a1dce5130..ef49a27bb1 100755 --- a/scripts/build/bootstrap/incremental_build_util.py +++ b/scripts/build/bootstrap/incremental_build_util.py @@ -7,7 +7,7 @@ import argparse import ast import boto3 import datetime -import urllib2 +import urllib.request, urllib.error, urllib.parse import os import psutil import time @@ -49,7 +49,7 @@ if os.name == 'nt': def is_dir_symlink(path): FILE_ATTRIBUTE_REPARSE_POINT = 0x0400 - return os.path.isdir(path) and (ctypes.windll.kernel32.GetFileAttributesW(unicode(path)) & FILE_ATTRIBUTE_REPARSE_POINT) + return os.path.isdir(path) and (ctypes.windll.kernel32.GetFileAttributesW(str(path)) & FILE_ATTRIBUTE_REPARSE_POINT) def get_free_space_mb(path): if sys.version_info < (3,): # Python 2? @@ -84,7 +84,7 @@ else: return st.f_bavail * st.f_frsize / 1024 / 1024 def error(message): - print message + print(message) exit(1) def parse_args(): @@ -137,19 +137,19 @@ def get_ec2_client(region): def get_ec2_instance_id(): try: - instance_id = urllib2.urlopen('http://169.254.169.254/latest/meta-data/instance-id').read() - return instance_id + instance_id = urllib.request.urlopen('http://169.254.169.254/latest/meta-data/instance-id').read() + return instance_id.decode("utf-8") except Exception as e: - print e.message + print(e.message) error('No EC2 metadata! Check if you are running this script on an EC2 instance.') def get_availability_zone(): try: - availability_zone = urllib2.urlopen('http://169.254.169.254/latest/meta-data/placement/availability-zone').read() - return availability_zone + availability_zone = urllib.request.urlopen('http://169.254.169.254/latest/meta-data/placement/availability-zone').read() + return availability_zone.decode("utf-8") except Exception as e: - print e.message + print(e.message) error('No EC2 metadata! Check if you are running this script on an EC2 instance.') @@ -158,11 +158,11 @@ def kill_processes(workspace='/dev/'): Kills all processes that have open file paths associated with the workspace. Uses PSUtil for cross-platform compatibility ''' - print 'Checking for any stuck processes...' + print('Checking for any stuck processes...') for proc in psutil.process_iter(): try: if workspace in str(proc.open_files()): - print "{} has open files in {}. Terminating".format(proc.name(), proc.open_files()) + print("{} has open files in {}. Terminating".format(proc.name(), proc.open_files())) proc.kill() time.sleep(1) # Just to make sure a parent process has time to close except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): @@ -171,7 +171,7 @@ def kill_processes(workspace='/dev/'): def delete_volume(ec2_client, volume_id): response = ec2_client.delete_volume(VolumeId=volume_id) - print 'Volume {} deleted'.format(volume_id) + print('Volume {} deleted'.format(volume_id)) def find_snapshot_id(ec2_client, repository_name, project, pipeline, platform, build_type, disk_size): mount_name = get_mount_name(repository_name, project, pipeline, 'stabilization_2106', platform, build_type) # we take snapshots out of stabilization_2106 @@ -234,29 +234,29 @@ def create_volume(ec2_client, availability_zone, repository_name, project, pipel time.sleep(1) response = ec2_client.describe_volumes(VolumeIds=[volume_id, ]) - print("Volume {} created\n\tSnapshot: {}\n\tRepository {}\n\tProject {}\n\tPipeline {}\n\tBranch {}\n\tPlatform: {}\n\tBuild type: {}" - .format(volume_id, snapshot_id, repository_name, project, pipeline, branch, platform, build_type)) + print(("Volume {} created\n\tSnapshot: {}\n\tRepository {}\n\tProject {}\n\tPipeline {}\n\tBranch {}\n\tPlatform: {}\n\tBuild type: {}" + .format(volume_id, snapshot_id, repository_name, project, pipeline, branch, platform, build_type))) return volume_id, created def mount_volume(created): - print 'Mounting volume...' + print('Mounting volume...') if os.name == 'nt': f = tempfile.NamedTemporaryFile(delete=False) f.write(""" select disk 1 online disk attribute disk clear readonly - """) # assume disk # for now + """.encode('utf-8')) # assume disk # for now if created: - print 'Creating filesystem on new volume' + print('Creating filesystem on new volume') f.write("""create partition primary select partition 1 format quick fs=ntfs assign active - """) + """.encode('utf-8')) f.close() @@ -267,7 +267,7 @@ def mount_volume(created): drives_after = win32api.GetLogicalDriveStrings() drives_after = drives_after.split('\000')[:-1] - print drives_after + print(drives_after) #drive_letter = next(item for item in drives_after if item not in drives_before) drive_letter = MOUNT_PATH @@ -284,7 +284,7 @@ def mount_volume(created): def attach_volume(volume, volume_id, instance_id, timeout=DEFAULT_TIMEOUT): - print 'Attaching volume {} to instance {}'.format(volume_id, instance_id) + print('Attaching volume {} to instance {}'.format(volume_id, instance_id)) volume.attach_to_instance(Device='xvdf', InstanceId=instance_id, VolumeId=volume_id) @@ -297,7 +297,7 @@ def attach_volume(volume, volume_id, instance_id, timeout=DEFAULT_TIMEOUT): time.sleep(1) volume.load() if (time.clock() - timeout_init) > timeout: - print 'ERROR: Timeout reached trying to mount EBS' + print('ERROR: Timeout reached trying to mount EBS') exit(1) volume.create_tags( Tags=[ @@ -307,11 +307,11 @@ def attach_volume(volume, volume_id, instance_id, timeout=DEFAULT_TIMEOUT): }, ] ) - print 'Volume {} has been attached to instance {}'.format(volume_id, instance_id) + print('Volume {} has been attached to instance {}'.format(volume_id, instance_id)) def unmount_volume(): - print 'Umounting volume...' + print('Umounting volume...') if os.name == 'nt': kill_processes(MOUNT_PATH + 'workspace') f = tempfile.NamedTemporaryFile(delete=False) @@ -328,7 +328,7 @@ def unmount_volume(): def detach_volume(volume, ec2_instance_id, force, timeout=DEFAULT_TIMEOUT): - print 'Detaching volume {} from instance {}'.format(volume.volume_id, ec2_instance_id) + print('Detaching volume {} from instance {}'.format(volume.volume_id, ec2_instance_id)) volume.detach_from_instance(Device='xvdf', Force=force, InstanceId=ec2_instance_id, @@ -338,16 +338,16 @@ def detach_volume(volume, ec2_instance_id, force, timeout=DEFAULT_TIMEOUT): time.sleep(1) volume.load() if (time.clock() - timeout_init) > timeout: - print 'ERROR: Timeout reached trying to unmount EBS.' + print('ERROR: Timeout reached trying to unmount EBS.') volume.detach_from_instance(Device='xvdf',Force=True,InstanceId=ec2_instance_id,VolumeId=volume.volume_id) exit(1) - print 'Volume {} has been detached from instance {}'.format(volume.volume_id, ec2_instance_id) + print('Volume {} has been detached from instance {}'.format(volume.volume_id, ec2_instance_id)) volume.load() if len(volume.attachments): - print 'Volume still has attachments' + print('Volume still has attachments') for attachment in volume.attachments: - print 'Volume {} {} to instance {}'.format(attachment['VolumeId'], attachment['State'], attachment['InstanceId']) + print('Volume {} {} to instance {}'.format(attachment['VolumeId'], attachment['State'], attachment['InstanceId'])) def attach_ebs_and_create_partition_with_retry(volume, volume_id, ec2_instance_id, created): @@ -379,10 +379,10 @@ def mount_ebs(repository_name, project, pipeline, branch, platform, build_type, for volume in ec2_instance.volumes.all(): for attachment in volume.attachments: - print 'attachment device: {}'.format(attachment['Device']) + print('attachment device: {}'.format(attachment['Device'])) if 'xvdf' in attachment['Device'] and attachment['State'] != 'detached': - print 'A device is already attached to xvdf. This likely means a previous build failed to detach its ' \ - 'build volume. This volume is considered orphaned and will be detached from this instance.' + print('A device is already attached to xvdf. This likely means a previous build failed to detach its ' \ + 'build volume. This volume is considered orphaned and will be detached from this instance.') unmount_volume() detach_volume(volume, ec2_instance_id, False) # Force unmounts should not be used, as that will cause the EBS block device driver to fail the remount @@ -393,21 +393,21 @@ def mount_ebs(repository_name, project, pipeline, branch, platform, build_type, created = False if 'Volumes' in response and not len(response['Volumes']): - print 'Volume for {} doesn\'t exist creating it...'.format(mount_name) + print('Volume for {} doesn\'t exist creating it...'.format(mount_name)) # volume doesn't exist, create it volume_id, created = create_volume(ec2_client, ec2_availability_zone, repository_name, project, pipeline, branch, platform, build_type, disk_size, disk_type) else: volume = response['Volumes'][0] volume_id = volume['VolumeId'] - print 'Current volume {} is a {} GB {}'.format(volume_id, volume['Size'], volume['VolumeType']) + print('Current volume {} is a {} GB {}'.format(volume_id, volume['Size'], volume['VolumeType'])) if (volume['Size'] != disk_size or volume['VolumeType'] != disk_type): - print 'Override disk attributes does not match the existing volume, deleting {} and replacing the volume'.format(volume_id) + print('Override disk attributes does not match the existing volume, deleting {} and replacing the volume'.format(volume_id)) delete_volume(ec2_client, volume_id) volume_id, created = create_volume(ec2_client, ec2_availability_zone, repository_name, project, pipeline, branch, platform, build_type, disk_size, disk_type) if len(volume['Attachments']): # this is bad we shouldn't be attached, we should have detached at the end of a build attachment = volume['Attachments'][0] - print ('Volume already has attachment {}, detaching...'.format(attachment)) + print(('Volume already has attachment {}, detaching...'.format(attachment))) detach_volume(ec2_resource.Volume(volume_id), attachment['InstanceId'], True) volume = ec2_resource.Volume(volume_id) @@ -416,23 +416,23 @@ def mount_ebs(repository_name, project, pipeline, branch, platform, build_type, drives_before = win32api.GetLogicalDriveStrings() drives_before = drives_before.split('\000')[:-1] - print drives_before + print(drives_before) attach_ebs_and_create_partition_with_retry(volume, volume_id, ec2_instance_id, created) free_space_mb = get_free_space_mb(MOUNT_PATH) - print 'Free disk space {}MB'.format(free_space_mb) + print('Free disk space {}MB'.format(free_space_mb)) if free_space_mb < LOW_EBS_DISK_SPACE_LIMIT: - print 'Volume is running below EBS free disk space treshhold {}MB. Recreating volume and running clean build.'.format(LOW_EBS_DISK_SPACE_LIMIT) + print('Volume is running below EBS free disk space treshhold {}MB. Recreating volume and running clean build.'.format(LOW_EBS_DISK_SPACE_LIMIT)) unmount_volume() detach_volume(volume, ec2_instance_id, False) delete_volume(ec2_client, volume_id) new_disk_size = int(volume.size * 1.25) if new_disk_size > MAX_EBS_DISK_SIZE: - print 'Error: EBS disk size reached to the allowed maximum disk size {}MB, please contact ly-infra@ and ly-build@ to investigate.'.format(MAX_EBS_DISK_SIZE) + print('Error: EBS disk size reached to the allowed maximum disk size {}MB, please contact ly-infra@ and ly-build@ to investigate.'.format(MAX_EBS_DISK_SIZE)) exit(1) - print 'Recreating the EBS with disk size {}'.format(new_disk_size) + print('Recreating the EBS with disk size {}'.format(new_disk_size)) volume_id, created = create_volume(ec2_client, ec2_availability_zone, repository_name, project, pipeline, branch, platform, build_type, new_disk_size, disk_type) volume = ec2_resource.Volume(volume_id) attach_ebs_and_create_partition_with_retry(volume, volume_id, ec2_instance_id, created) @@ -454,13 +454,13 @@ def unmount_ebs(): for attached_volume in ec2_instance.volumes.all(): for attachment in attached_volume.attachments: - print 'attachment device: {}'.format(attachment['Device']) + print('attachment device: {}'.format(attachment['Device'])) if attachment['Device'] == 'xvdf': volume = attached_volume if not volume: # volume is not mounted - print 'Volume is not mounted' + print('Volume is not mounted') else: unmount_volume() detach_volume(volume, ec2_instance_id, False) From 5e98eefcc27cdcc4bce4b69e191c4e321a0f91ff Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 7 Jul 2021 17:13:43 -0500 Subject: [PATCH 105/156] Undoing change from review feedback as it led to an incorrect result in some cases. Signed-off-by: Ken Pruiksma --- .../ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 8042758db8..6e45cf30c8 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 @@ -111,13 +111,9 @@ float IntegrateEdge(float3 v1, float3 v2) float IntegrateEdgeDiffuse(float3 v1, float3 v2) { float cosTheta = dot(v1, v2); - float theta_sinTheta = 0.0; - if (cosTheta > 0.0) - { - float absCosTheta = abs(cosTheta); - theta_sinTheta = 1.5708 + (-0.879406 + 0.308609 * absCosTheta) * absCosTheta; - } - else + float absCosTheta = abs(cosTheta); + float theta_sinTheta = 1.5708 + (-0.879406 + 0.308609 * absCosTheta) * absCosTheta; + if (cosTheta < 0.0) { theta_sinTheta = PI * rsqrt(1.0 - cosTheta * cosTheta) - theta_sinTheta; } From b9964bbb5a3c360b4ead64939b445c0ed698102e Mon Sep 17 00:00:00 2001 From: Twolewis Date: Wed, 7 Jul 2021 17:16:09 -0500 Subject: [PATCH 106/156] Fixed Material Editor not launching (#1920) * Fixed Material Editor not launching Explicitly providing project-path as part of launch parameters. Signed-off-by: Lloyd Tullues * Update Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: Lloyd Tullues * Minor - adding whitespace for consistency Signed-off-by: Lloyd Tullues Co-authored-by: Lloyd Tullues Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../Code/Source/Material/EditorMaterialSystemComponent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp index a8d6270c7e..efb79bb06c 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp @@ -130,6 +130,12 @@ namespace AZ arguments.append(QString("--rhi=%1").arg(apiName.GetCStr())); } + AZ::IO::FixedMaxPathString projectPath(AZ::Utils::GetProjectPath()); + if (!projectPath.empty()) + { + arguments.append(QString("--project-path=%1").arg(projectPath.c_str())); + } + AtomToolsFramework::LaunchTool("MaterialEditor", ".exe", arguments); } From a75b8eb6360748fe22faaf6543d5a45f0223bddc Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 7 Jul 2021 18:00:40 -0500 Subject: [PATCH 107/156] [LYN-3913] Fix conversion to unsupported photometric unit on light type change. When converting to a light type that doesn't support the currently used photometric unit, the editor component will convert the photometric unit to the universally supported lumen. Signed-off-by: Ken Pruiksma --- .../CoreLights/EditorAreaLightComponent.cpp | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index 5dabd7317b..b9d63f6dc3 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -263,7 +263,23 @@ namespace AZ // Update the cached light type. m_lightType = m_controller.m_configuration.m_lightType; + + // Check to see if the current photometric type is supported by the light type. If not, convert to lumens before deactivating. + auto supportedPhotometricUnits = m_controller.m_configuration.GetValidPhotometricUnits(); + auto foundIt = AZStd::find_if( + supportedPhotometricUnits.begin(), + supportedPhotometricUnits.end(), + [&](const Edit::EnumConstant& entry) -> bool + { + return AZStd::RemoveEnum::type(m_controller.m_configuration.m_intensityMode) == entry.m_value; + } + ); + if (foundIt == supportedPhotometricUnits.end()) + { + m_controller.ConvertToIntensityMode(PhotometricUnit::Lumen); + } + // componets may be removed or added here, so deactivate now and reactivate the entity when everything is done shifting around. GetEntity()->Deactivate(); @@ -320,7 +336,7 @@ namespace AZ // Some light types don't require a shape, this is ok. break; } - + GetEntity()->Activate(); // Set more reasonable default values for certain shapes. @@ -333,7 +349,12 @@ namespace AZ LmbrCentral::DiskShapeComponentRequestBus::Event(GetEntityId(), &LmbrCentral::DiskShapeComponentRequests::SetRadius, 0.05f); break; } - + + if (foundIt == supportedPhotometricUnits.end()) + { + m_controller.ConvertToIntensityMode(PhotometricUnit::Lumen); + } + return true; } From 6c0264862e4cc588ff0fb9974a80238785925727 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 7 Jul 2021 18:05:36 -0500 Subject: [PATCH 108/156] Removing unnecessary code Signed-off-by: Ken Pruiksma --- .../Code/Source/CoreLights/EditorAreaLightComponent.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index b9d63f6dc3..81e87f3cb5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -350,11 +350,6 @@ namespace AZ break; } - if (foundIt == supportedPhotometricUnits.end()) - { - m_controller.ConvertToIntensityMode(PhotometricUnit::Lumen); - } - return true; } From 9ca7a698dfa0af31c61db28ab70e6e40b3d5c37e Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 7 Jul 2021 16:17:40 -0700 Subject: [PATCH 109/156] Fix Mac Editor crash when adding PhysX Collider component to an entity. (#1930) Signed-off-by: amzn-sj --- Code/Framework/AzFramework/AzFramework/Physics/Material.cpp | 4 ++-- Code/Framework/AzFramework/AzFramework/Physics/Material.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp index cdcdbe4655..05f41cc8da 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp @@ -504,7 +504,7 @@ namespace Physics } } - const AZ::Data::Asset& MaterialSelection::GetMaterialLibrary() + AZ::Data::Asset MaterialSelection::GetMaterialLibrary() { if (auto* physicsSystem = AZ::Interface::Get()) { @@ -516,7 +516,7 @@ namespace Physics return s_invalidMaterialLibrary; } - const AZ::Data::AssetId& MaterialSelection::GetMaterialLibraryId() + AZ::Data::AssetId MaterialSelection::GetMaterialLibraryId() { return GetMaterialLibrary().GetId(); } diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.h b/Code/Framework/AzFramework/AzFramework/Physics/Material.h index bd15dd338e..455da207d1 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Material.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.h @@ -306,8 +306,8 @@ namespace Physics void SyncSelectionToMaterialLibrary(); - static const AZ::Data::Asset& GetMaterialLibrary(); - static const AZ::Data::AssetId& GetMaterialLibraryId(); + static AZ::Data::Asset GetMaterialLibrary(); + static AZ::Data::AssetId GetMaterialLibraryId(); bool AreMaterialSlotsReadOnly() const; From 55a3b412226b5485f3f5bf5c1c52c4142c3de017 Mon Sep 17 00:00:00 2001 From: Shirang Jia Date: Wed, 7 Jul 2021 16:44:42 -0700 Subject: [PATCH 110/156] Fix unmounting error (#1940) --- scripts/build/bootstrap/incremental_build_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/bootstrap/incremental_build_util.py b/scripts/build/bootstrap/incremental_build_util.py index ef49a27bb1..32a6b0f526 100755 --- a/scripts/build/bootstrap/incremental_build_util.py +++ b/scripts/build/bootstrap/incremental_build_util.py @@ -318,7 +318,7 @@ def unmount_volume(): f.write(""" select disk 1 offline disk - """) + """.encode('utf-8')) f.close() subprocess.call('diskpart /s %s' % f.name) os.unlink(f.name) From 762b3ee58288fb51b8d9c93e4af69da19b81993a Mon Sep 17 00:00:00 2001 From: dmcdiar Date: Thu, 8 Jul 2021 00:24:52 -0700 Subject: [PATCH 111/156] Suspended ray tracing for DiffuseProbeGrids that are not visible, either off-screen or behind an occlusion culling plane Added a culling flag that indicates if the cullable object is currently visible in any view Signed-off-by: dmcdiar --- .../DiffuseProbeGrid.cpp | 17 ++++++++++ .../DiffuseProbeGrid.h | 3 ++ .../DiffuseProbeGridBlendDistancePass.cpp | 8 ++--- .../DiffuseProbeGridBlendIrradiancePass.cpp | 8 ++--- .../DiffuseProbeGridBorderUpdatePass.cpp | 8 ++--- .../DiffuseProbeGridClassificationPass.cpp | 9 +++--- .../DiffuseProbeGridFeatureProcessor.cpp | 32 +++++++++++++++++++ .../DiffuseProbeGridFeatureProcessor.h | 8 +++++ .../DiffuseProbeGridRayTracingPass.cpp | 10 +++--- .../DiffuseProbeGridRelocationPass.cpp | 10 +++--- .../DiffuseProbeGridRenderPass.cpp | 12 ++++++- .../Code/Include/Atom/RPI.Public/Culling.h | 4 +++ .../RPI/Code/Source/RPI.Public/Culling.cpp | 2 ++ 13 files changed, 104 insertions(+), 27 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index 7e48f0e81f..888d7c57d8 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -245,6 +245,23 @@ namespace AZ m_bakedClassificationImage.get(); } + void DiffuseProbeGrid::ResetCullingVisibility() + { + m_cullable.m_isVisible = false; + } + + bool DiffuseProbeGrid::GetIsVisible() const + { + // we need to go through the DiffuseProbeGrid passes at least once in order to initialize + // the RenderObjectSrg, which means we need to be visible until the RenderObjectSrg is created + if (m_renderObjectSrg == nullptr) + { + return true; + } + + return m_cullable.m_isVisible; + } + uint32_t DiffuseProbeGrid::GetTotalProbeCount() const { return m_probeCountX * m_probeCountY * m_probeCountZ; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h index 855b4732bd..7b36e0b2c5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h @@ -102,6 +102,9 @@ namespace AZ void DecrementRemainingRelocationIterations() { m_remainingRelocationIterations = AZStd::max(0, m_remainingRelocationIterations - 1); } void ResetRemainingRelocationIterations() { m_remainingRelocationIterations = DefaultNumRelocationIterations; } + void ResetCullingVisibility(); + bool GetIsVisible() const; + // compute total number of probes in the grid uint32_t GetTotalProbeCount() const; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index 60576dc3d3..2a150fdb4e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -82,7 +82,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -106,7 +106,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // probe raytrace image { @@ -145,7 +145,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // 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) @@ -162,7 +162,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendDistanceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index 516b3a3098..130e1864b1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -82,7 +82,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -106,7 +106,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // probe raytrace image { @@ -145,7 +145,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // 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) @@ -162,7 +162,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendIrradianceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp index 5d3cdfbc84..48da2de4d7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp @@ -95,7 +95,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -119,7 +119,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // probe irradiance image { @@ -148,7 +148,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see line ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -168,7 +168,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { uint32_t probeCountX; uint32_t probeCountY; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index 09364ec7f2..0789b3b7da 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -86,7 +86,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -110,7 +110,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // probe raytrace image { @@ -138,11 +138,12 @@ namespace AZ { RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // 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->UpdateClassificationSrg(m_srgAsset); + diffuseProbeGrid->GetClassificationSrg()->Compile(); } } @@ -154,7 +155,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetClassificationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp index 7cc9d5ef50..93d47af012 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp @@ -175,6 +175,27 @@ namespace AZ } } + void DiffuseProbeGridFeatureProcessor::OnBeginPrepareRender() + { + for (auto& diffuseProbeGrid : m_realTimeDiffuseProbeGrids) + { + diffuseProbeGrid->ResetCullingVisibility(); + } + } + + void DiffuseProbeGridFeatureProcessor::OnEndPrepareRender() + { + // re-build the list of visible real-time diffuse probe grids + m_visibleRealTimeDiffuseProbeGrids.clear(); + for (auto& diffuseProbeGrid : m_realTimeDiffuseProbeGrids) + { + if (diffuseProbeGrid->GetIsVisible()) + { + m_visibleRealTimeDiffuseProbeGrids.push_back(diffuseProbeGrid); + } + } + } + DiffuseProbeGridHandle DiffuseProbeGridFeatureProcessor::AddProbeGrid(const AZ::Transform& transform, const AZ::Vector3& extents, const AZ::Vector3& probeSpacing) { AZStd::shared_ptr diffuseProbeGrid = AZStd::make_shared(); @@ -215,6 +236,17 @@ namespace AZ m_realTimeDiffuseProbeGrids.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) + { + return (entry == probeGrid); + }); + + if (itEntry != m_visibleRealTimeDiffuseProbeGrids.end()) + { + m_visibleRealTimeDiffuseProbeGrids.erase(itEntry); + } + probeGrid = nullptr; } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h index 4d045ec62d..9771c058ad 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h @@ -76,6 +76,9 @@ 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) + DiffuseProbeGridVector& GetVisibleRealTimeProbeGrids() { return m_visibleRealTimeDiffuseProbeGrids; } + private: AZ_DISABLE_COPY_MOVE(DiffuseProbeGridFeatureProcessor); @@ -96,6 +99,8 @@ namespace AZ void HandleAssetNotification(Data::Asset asset, DiffuseProbeGridTextureNotificationType notificationType); // RPI::SceneNotificationBus::Handler overrides + void OnBeginPrepareRender() override; + void OnEndPrepareRender() override; void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override; void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override; void OnRenderPipelineRemoved(RPI::RenderPipeline* pipeline) override; @@ -110,6 +115,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 in real-time mode and visible (subset of m_realTimeDiffuseProbeGrids) + DiffuseProbeGridVector m_visibleRealTimeDiffuseProbeGrids; + // position structure for the box vertices struct Position { diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp index c3192fc36e..86a03fe128 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp @@ -131,7 +131,7 @@ namespace AZ } DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -148,9 +148,9 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - frameGraph.SetEstimatedItemCount(aznumeric_cast(diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().size())); + frameGraph.SetEstimatedItemCount(aznumeric_cast(diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().size())); - for (const auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (const auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // TLAS { @@ -255,7 +255,7 @@ namespace AZ rayTracingFeatureProcessor->GetMeshInfoBuffer() && rayTracingFeatureProcessor->GetSubMeshCount()) { - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader // inputs (see line ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -303,7 +303,7 @@ namespace AZ m_rayTracingShaderTable) { // submit the DispatchRaysItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroups[] = { diffuseProbeGrid->GetRayTraceSrg()->GetRHIShaderResourceGroup(), diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index 9627b7d938..1b3b12b754 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -86,7 +86,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -103,7 +103,7 @@ namespace AZ // create the Relocation Srgs for each DiffuseProbeGrid, and check to see if any grids need relocation bool needRelocation = false; - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); if (rayTracingDataRevision != m_rayTracingDataRevision) @@ -134,7 +134,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // probe raytrace image { @@ -162,7 +162,7 @@ namespace AZ { RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { // 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) @@ -182,7 +182,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetRelocationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp index ebb9ad9eb1..776096d35e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp @@ -94,7 +94,12 @@ namespace AZ { continue; } - + + if (!diffuseProbeGrid->GetIsVisible()) + { + continue; + } + // probe irradiance image { if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked) @@ -182,6 +187,11 @@ namespace AZ continue; } + if (!diffuseProbeGrid->GetIsVisible()) + { + continue; + } + // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() of ShaderResourceGroupData.cpp) diffuseProbeGrid->UpdateRenderObjectSrg(); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h index 72d0e3c69c..7f042e58cb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h @@ -91,6 +91,10 @@ namespace AZ }; LodData m_lodData; + //! Flag indicating if the object is visible in any view, meaning it passed the culling tests in the previous frame. + //! This flag must be manually cleared by the Cullable object every frame. + bool m_isVisible = false; + //! Flag indicating if the object is hidden, i.e., was specifically marked as //! something that shouldn't be rendered, regardless of its actual position relative to the camera bool m_isHidden = false; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index cd1b0e925a..c78d8e8169 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -339,6 +339,7 @@ namespace AZ { numDrawPackets += AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *m_jobData->m_view); ++numVisibleCullables; + c->m_isVisible = true; } } } @@ -374,6 +375,7 @@ namespace AZ { numDrawPackets += AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *m_jobData->m_view); ++numVisibleCullables; + c->m_isVisible = true; } } } From 15e0aa7984c691f9b4e4614c0ecd633145950b17 Mon Sep 17 00:00:00 2001 From: moraaar Date: Tue, 6 Jul 2021 16:06:24 +0100 Subject: [PATCH 112/156] Use latest version of nvcloth, poly2tri and v-hacd 3rdParty libraries for windows, android, mac and ios. Signed-off-by: moraaar --- Gems/NvCloth/Code/Platform/Android/PAL_android.cmake | 2 +- Gems/NvCloth/Code/Platform/Mac/PAL_mac.cmake | 2 +- Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake | 2 +- Gems/NvCloth/Code/Platform/iOS/PAL_ios.cmake | 2 +- Gems/PhysX/Code/CMakeLists.txt | 3 --- Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake | 5 +++++ Gems/PhysX/Code/Source/Platform/Mac/PAL_mac.cmake | 5 +++++ Gems/PhysX/Code/Source/Platform/Windows/PAL_windows.cmake | 5 +++++ 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Gems/NvCloth/Code/Platform/Android/PAL_android.cmake b/Gems/NvCloth/Code/Platform/Android/PAL_android.cmake index 77e8a42871..ffaa3f828f 100644 --- a/Gems/NvCloth/Code/Platform/Android/PAL_android.cmake +++ b/Gems/NvCloth/Code/Platform/Android/PAL_android.cmake @@ -5,6 +5,6 @@ # # -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev2-multiplatform TARGETS NvCloth PACKAGE_HASH 535d927782fa5d3086c5f813c46392ee3c294fc117dcd87b055d469c3f034356) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-android TARGETS NvCloth PACKAGE_HASH 01eb0bc7fae91bb088a7d4c0f9555743a2c442f7b823a89072eacad361a20b42) set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) diff --git a/Gems/NvCloth/Code/Platform/Mac/PAL_mac.cmake b/Gems/NvCloth/Code/Platform/Mac/PAL_mac.cmake index 77e8a42871..1e856fa1c2 100644 --- a/Gems/NvCloth/Code/Platform/Mac/PAL_mac.cmake +++ b/Gems/NvCloth/Code/Platform/Mac/PAL_mac.cmake @@ -5,6 +5,6 @@ # # -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev2-multiplatform TARGETS NvCloth PACKAGE_HASH 535d927782fa5d3086c5f813c46392ee3c294fc117dcd87b055d469c3f034356) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-mac TARGETS NvCloth PACKAGE_HASH 9156548da6fc35f89b592306cc512257042159e3c9c2ce5f483d8d0701b63716) set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) diff --git a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake index afedeb2df8..f62da3def9 100644 --- a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake +++ b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake @@ -7,4 +7,4 @@ set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev2-multiplatform TARGETS NvCloth PACKAGE_HASH 535d927782fa5d3086c5f813c46392ee3c294fc117dcd87b055d469c3f034356) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows TARGETS NvCloth PACKAGE_HASH 2f521d961443d66ca941800377a8afb328daf8e39f4808e4d18dde382451ab46) diff --git a/Gems/NvCloth/Code/Platform/iOS/PAL_ios.cmake b/Gems/NvCloth/Code/Platform/iOS/PAL_ios.cmake index 77e8a42871..fa099bfd3e 100644 --- a/Gems/NvCloth/Code/Platform/iOS/PAL_ios.cmake +++ b/Gems/NvCloth/Code/Platform/iOS/PAL_ios.cmake @@ -5,6 +5,6 @@ # # -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev2-multiplatform TARGETS NvCloth PACKAGE_HASH 535d927782fa5d3086c5f813c46392ee3c294fc117dcd87b055d469c3f034356) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-ios TARGETS NvCloth PACKAGE_HASH 62e17ed51da9a3452b7397a4e1f64aca79e8f4c70181a75aeb6ca596c6692971) set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index 21f9172055..9b867a7652 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -74,9 +74,6 @@ ly_create_alias(NAME PhysX.Servers NAMESPACE Gem TARGETS Gem::PhysX) if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) - ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) - ly_add_target( NAME PhysX.Editor.Static STATIC NAMESPACE Gem diff --git a/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake b/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake index 9033ea99c2..cf5b77edc3 100644 --- a/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake +++ b/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake @@ -6,3 +6,8 @@ # set(PAL_TRAIT_PHYSX_SUPPORTED TRUE) + +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) + ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) +endif() diff --git a/Gems/PhysX/Code/Source/Platform/Mac/PAL_mac.cmake b/Gems/PhysX/Code/Source/Platform/Mac/PAL_mac.cmake index 9033ea99c2..88c3808ed9 100644 --- a/Gems/PhysX/Code/Source/Platform/Mac/PAL_mac.cmake +++ b/Gems/PhysX/Code/Source/Platform/Mac/PAL_mac.cmake @@ -6,3 +6,8 @@ # set(PAL_TRAIT_PHYSX_SUPPORTED TRUE) + +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_associate_package(PACKAGE_NAME poly2tri-7f0487a-rev1-mac TARGETS poly2tri PACKAGE_HASH 23e49e6b06d79327985d17b40bff20ab202519c283a842378f5f1791c1bf8dbc) + ly_associate_package(PACKAGE_NAME v-hacd-2.3-1a49edf-rev1-mac TARGETS v-hacd PACKAGE_HASH c1de9fadb2c0db42416a1bd5fe3423401c6f41b58409bc652064b5ad23667c09) +endif() diff --git a/Gems/PhysX/Code/Source/Platform/Windows/PAL_windows.cmake b/Gems/PhysX/Code/Source/Platform/Windows/PAL_windows.cmake index 9033ea99c2..cc671f7014 100644 --- a/Gems/PhysX/Code/Source/Platform/Windows/PAL_windows.cmake +++ b/Gems/PhysX/Code/Source/Platform/Windows/PAL_windows.cmake @@ -6,3 +6,8 @@ # set(PAL_TRAIT_PHYSX_SUPPORTED TRUE) + +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_associate_package(PACKAGE_NAME poly2tri-7f0487a-rev1-windows TARGETS poly2tri PACKAGE_HASH 5fea2bf294e5130e0654fbfa39f192e6369f3853901dde90bb9b3f3a11edcb1e) + ly_associate_package(PACKAGE_NAME v-hacd-2.3-1a49edf-rev1-windows TARGETS v-hacd PACKAGE_HASH c5826ec28aedc3b5931ddf655d055395872cd3e75cd829f5745a2e607deb7468) +endif() From 7d5f8d51257ebe66637b34a15426b31c2b7d2df1 Mon Sep 17 00:00:00 2001 From: moraaar Date: Tue, 6 Jul 2021 18:19:08 +0100 Subject: [PATCH 113/156] Updating linux version of NvCloth, poly2tri and v-hacd. Signed-off-by: moraaar --- Gems/NvCloth/Code/Platform/Linux/PAL_linux.cmake | 2 +- Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/NvCloth/Code/Platform/Linux/PAL_linux.cmake b/Gems/NvCloth/Code/Platform/Linux/PAL_linux.cmake index 77e8a42871..eaf3d92b1c 100644 --- a/Gems/NvCloth/Code/Platform/Linux/PAL_linux.cmake +++ b/Gems/NvCloth/Code/Platform/Linux/PAL_linux.cmake @@ -5,6 +5,6 @@ # # -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev2-multiplatform TARGETS NvCloth PACKAGE_HASH 535d927782fa5d3086c5f813c46392ee3c294fc117dcd87b055d469c3f034356) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux TARGETS NvCloth PACKAGE_HASH c2e469c909fb358105ffe854476e87d9c69626aa16bd0ca0bcd941522adadc6d) set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) diff --git a/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake b/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake index cf5b77edc3..492d0957c7 100644 --- a/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake +++ b/Gems/PhysX/Code/Source/Platform/Linux/PAL_linux.cmake @@ -8,6 +8,6 @@ set(PAL_TRAIT_PHYSX_SUPPORTED TRUE) if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) - ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) + ly_associate_package(PACKAGE_NAME poly2tri-7f0487a-rev1-linux TARGETS poly2tri PACKAGE_HASH b16eef8f0bc469de0e3056d28d7484cf42659667e39b68b239f0d3a4cbb533d0) + ly_associate_package(PACKAGE_NAME v-hacd-2.3-1a49edf-rev1-linux TARGETS v-hacd PACKAGE_HASH 777bed3c7805a63446ddfea51c505b35398744f9245fa7ddc58e6a25d034e682) endif() From 8a582fdf3f1822ae98f403bcd480f41dd3ec41a4 Mon Sep 17 00:00:00 2001 From: moraaar Date: Wed, 7 Jul 2021 10:56:17 +0100 Subject: [PATCH 114/156] Udating SHA for nvcloth windows package. Signed-off-by: moraaar --- Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake index f62da3def9..1e8ba72eb8 100644 --- a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake +++ b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake @@ -7,4 +7,4 @@ set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) -ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows TARGETS NvCloth PACKAGE_HASH 2f521d961443d66ca941800377a8afb328daf8e39f4808e4d18dde382451ab46) +ly_associate_package(PACKAGE_NAME NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows TARGETS NvCloth PACKAGE_HASH 8f7b3d151db93fcd511afcbcb3a34884eec47fb511c90c8f2c770ac602150010) From af48fc44e383c8f953e4a7096a86297c992949f6 Mon Sep 17 00:00:00 2001 From: moraaar Date: Thu, 8 Jul 2021 10:15:26 +0100 Subject: [PATCH 115/156] Fixed warning of variable not being used in release of ImguiAtom. Signed-off-by: moraaar --- .../ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp index 843f30fced..c9fcbe33ca 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp @@ -115,7 +115,7 @@ namespace AZ #endif //define(IMGUI_ENABLED) } - void ImguiAtomSystemComponent::OnViewportDpiScalingChanged(float dpiScale) + void ImguiAtomSystemComponent::OnViewportDpiScalingChanged([[maybe_unused]] float dpiScale) { #if defined(IMGUI_ENABLED) ImGui::ImGuiManagerBus::Broadcast(&ImGui::ImGuiManagerBus::Events::SetDpiScalingFactor, dpiScale); From 86c9c04c37718ea7ddadf6ece55fe58f0866c50e Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 8 Jul 2021 08:02:27 -0500 Subject: [PATCH 116/156] Fixed EMFX nodes min/max attributes. Signed-off-by: Chris Galvan --- .../EMotionFX/Source/BlendTreeLookAtNode.cpp | 8 +++---- .../Source/BlendTreeTransformNode.cpp | 24 +++++++++---------- .../Source/BlendTreeVector3Math2Node.cpp | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeLookAtNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeLookAtNode.cpp index 57fa502abd..76b788facd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeLookAtNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeLookAtNode.cpp @@ -433,12 +433,12 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeLookAtNode::m_limitMin, "Yaw/pitch min", "The minimum rotational yaw and pitch angle limits, in degrees.") ->Attribute(AZ::Edit::Attributes::Visibility, &BlendTreeLookAtNode::GetLimitWidgetsVisibility) - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector2(-90.0f, -90.0f)) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector2(90.0f, 90.0f)) + ->Attribute(AZ::Edit::Attributes::Min, -90.0f) + ->Attribute(AZ::Edit::Attributes::Max, 90.0f) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeLookAtNode::m_limitMax, "Yaw/pitch max", "The maximum rotational yaw and pitch angle limits, in degrees.") ->Attribute(AZ::Edit::Attributes::Visibility, &BlendTreeLookAtNode::GetLimitWidgetsVisibility) - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector2(-90.0f, -90.0f)) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector2(90.0f, 90.0f)) + ->Attribute(AZ::Edit::Attributes::Min, -90.0f) + ->Attribute(AZ::Edit::Attributes::Max, 90.0f) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeLookAtNode::m_constraintRotation, "Constraint rotation", "A rotation that rotates the constraint space.") ->Attribute(AZ::Edit::Attributes::Visibility, &BlendTreeLookAtNode::GetLimitWidgetsVisibility) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &BlendTreeLookAtNode::m_twistAxis, "Roll axis", "The axis used for twist/roll.") diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp index b8abf2cc90..cfbff381eb 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp @@ -261,23 +261,23 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeTransformNode::Reinit) ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minTranslation, "Min Translation", "The minimum translation value, used when the input translation amount equals zero.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-std::numeric_limits::max())) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(std::numeric_limits::max())) + ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_maxTranslation, "Max Translation", "The maximum translation value, used when the input translation amount equals one.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-std::numeric_limits::max())) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(std::numeric_limits::max())) + ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minRotation, "Min Rotation", "The minimum rotation value, in degrees, used when the input rotation amount equals zero.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-360.0f, -360.0f, -360.0f)) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(360.0f, 360.0f, 360.0f)) + ->Attribute(AZ::Edit::Attributes::Min, -360.0f) + ->Attribute(AZ::Edit::Attributes::Max, 360.0f) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_maxRotation, "Max Rotation", "The maximum rotation value, in degrees, used when the input rotation amount equals one.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-360.0f, -360.0f, -360.0f)) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(360.0f, 360.0f, 360.0f)) + ->Attribute(AZ::Edit::Attributes::Min, -360.0f) + ->Attribute(AZ::Edit::Attributes::Max, 360.0f) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minScale, "Min Scale", "The minimum scale value, used when the input scale amount equals zero.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-std::numeric_limits::max())) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(std::numeric_limits::max())) + ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_maxScale, "Max Scale", "The maximum scale value, used when the input scale amount equals one.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-std::numeric_limits::max())) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(std::numeric_limits::max())) + ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ; } } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp index 2ee0d92dcc..acd9321ede 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp @@ -254,8 +254,8 @@ namespace EMotionFX ->EnumAttribute(MATHFUNCTION_DIVIDE, "Divide") ->EnumAttribute(MATHFUNCTION_ANGLEDEGREES, "AngleDegrees") ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeVector3Math2Node::m_defaultValue, "Default Value", "The default value for x or y when one of them has no incomming connection.") - ->Attribute(AZ::Edit::Attributes::Min, AZ::Vector3(-std::numeric_limits::max())) - ->Attribute(AZ::Edit::Attributes::Max, AZ::Vector3(std::numeric_limits::max())) + ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ; } } // namespace EMotionFX From 6d9230e2922188a4a3f8fd5dbab23d7875029fe5 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Thu, 8 Jul 2021 08:23:37 -0700 Subject: [PATCH 117/156] ATOM-15939 Add support to capture attachment for ParentPass (#1887) * ATOM-15939 Add support to capture attachment for ParentPass - Moved the attachment read back support to Pass class so it supports both ParentPass and RenderPass. - Added support to output input or output state of an InputOutput attachment. - Enabled showing ParentPass attachments in PassTree tool. Signed-off-by: Tao --- .../TrackView/AtomOutputFrameCapture.cpp | 2 +- .../Atom/Feature/Utils/FrameCaptureBus.h | 6 +- .../Source/FrameCaptureSystemComponent.cpp | 40 ++--- .../Code/Source/FrameCaptureSystemComponent.h | 5 +- .../Source/LuxCore/LuxCoreTexturePass.cpp | 18 +-- .../Code/Include/Atom/RPI.Public/Pass/Pass.h | 23 ++- .../Include/Atom/RPI.Public/Pass/RenderPass.h | 8 +- .../Specific/ImageAttachmentPreviewPass.h | 3 - .../Pass/Specific/RenderToTexturePass.h | 3 - .../RPI.Public/Pass/Specific/SelectorPass.h | 1 - .../RPI.Public/Pass/Specific/SwapChainPass.h | 4 - .../RPI/Code/Source/RPI.Public/Pass/Pass.cpp | 61 ++++++- .../Source/RPI.Public/Pass/RenderPass.cpp | 33 +--- .../Specific/ImageAttachmentPreviewPass.cpp | 12 +- .../Pass/Specific/RenderToTexturePass.cpp | 17 +- .../Pass/Specific/SwapChainPass.cpp | 14 +- .../Code/Include/Atom/Utils/ImGuiPassTree.h | 3 + .../Code/Include/Atom/Utils/ImGuiPassTree.inl | 152 ++++++++++-------- .../ThumbnailRendererSteps/CaptureStep.cpp | 2 +- 19 files changed, 200 insertions(+), 207 deletions(-) diff --git a/Code/Editor/TrackView/AtomOutputFrameCapture.cpp b/Code/Editor/TrackView/AtomOutputFrameCapture.cpp index d5ceeae9b2..cd5a977367 100644 --- a/Code/Editor/TrackView/AtomOutputFrameCapture.cpp +++ b/Code/Editor/TrackView/AtomOutputFrameCapture.cpp @@ -73,7 +73,7 @@ namespace TrackView bool startedCapture = false; AZ::Render::FrameCaptureRequestBus::BroadcastResult( startedCapture, &AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachmentWithCallback, m_passHierarchy, - AZStd::string("Output"), attachmentReadbackCallback); + AZStd::string("Output"), attachmentReadbackCallback, AZ::RPI::PassAttachmentReadbackOption::Output); return startedCapture; } diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/FrameCaptureBus.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/FrameCaptureBus.h index e783a03071..53e7de9148 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/FrameCaptureBus.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/FrameCaptureBus.h @@ -46,14 +46,16 @@ namespace AZ //! Save a buffer attachment or a image attachment binded to a pass's slot to a data file. //! @param passHierarchy For finding the pass by using PassHierarchyFilter //! @param slotName Name of the pass's slot. The attachment bound to this slot will be captured. + //! @param option Only valid for an InputOutput attachment. Use PassAttachmentReadbackOption::Input to capture the input state + //! and use PassAttachmentReadbackOption::Output to capture the output state //! @param outputFilename The output file path. virtual bool CapturePassAttachment(const AZStd::vector& passHierarchy, const AZStd::string& slotName - , const AZStd::string& outputFilePath) = 0; + , const AZStd::string& outputFilePath, RPI::PassAttachmentReadbackOption option) = 0; //! Similar to CapturePassAttachment. But instead of saving the read back result to a file, it will call the callback function provide //! in the input when callback is finished virtual bool CapturePassAttachmentWithCallback(const AZStd::vector& passHierarchy, const AZStd::string& slotName - , RPI::AttachmentReadback::CallbackFunction callback) = 0; + , RPI::AttachmentReadback::CallbackFunction callback, RPI::PassAttachmentReadbackOption option) = 0; }; using FrameCaptureRequestBus = EBus; diff --git a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp index a115bfa6e8..e8e4609ec4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.cpp @@ -343,7 +343,7 @@ namespace AZ } bool FrameCaptureSystemComponent::CapturePassAttachment(const AZStd::vector& passHierarchy, const AZStd::string& slot, - const AZStd::string& outputFilePath) + const AZStd::string& outputFilePath, RPI::PassAttachmentReadbackOption option) { InitReadback(); @@ -376,40 +376,22 @@ namespace AZ return false; } - AZ::RPI::RenderPass* renderPass = azrtti_cast(foundPasses[0]); - if (renderPass) + AZ::RPI::Pass* pass = foundPasses[0]; + if (pass->ReadbackAttachment(m_readback, Name(slot), option)) { - Name slotName = Name(slot); - AZ::RPI::PassAttachment* attachment = nullptr; - for (auto& binding : renderPass->GetAttachmentBindings()) - { - if (binding.m_name == slotName) - { - attachment = binding.m_attachment.get(); - break; - } - } - if (attachment) - { - m_state = State::Pending; - m_result = FrameCaptureResult::None; - SystemTickBus::Handler::BusConnect(); - renderPass->ReadbackAttachment(m_readback, attachment); - } - else - { - AZ_Warning("FrameCaptureSystemComponent", false, "Failed to find attachment bound to pass [%s] slot [%s]", - renderPass->GetName().GetCStr(), slotName.GetCStr()); - return false; - } + m_state = State::Pending; + m_result = FrameCaptureResult::None; + SystemTickBus::Handler::BusConnect(); + return true; } - return true; + AZ_Warning("FrameCaptureSystemComponent", false, "Failed to readback the attachment bound to pass [%s] slot [%s]", pass->GetName().GetCStr(), slot.c_str()); + return false; } bool FrameCaptureSystemComponent::CapturePassAttachmentWithCallback(const AZStd::vector& passHierarchy, const AZStd::string& slotName - , RPI::AttachmentReadback::CallbackFunction callback) + , RPI::AttachmentReadback::CallbackFunction callback, RPI::PassAttachmentReadbackOption option) { - bool result = CapturePassAttachment(passHierarchy, slotName, ""); + bool result = CapturePassAttachment(passHierarchy, slotName, "", option); // Append state change to user provided call back AZ::RPI::AttachmentReadback::CallbackFunction callbackSetState = [&, callback](const AZ::RPI::AttachmentReadback::ReadbackResult& result) diff --git a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.h b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.h index 472dd5da74..eb08494699 100644 --- a/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.h +++ b/Gems/Atom/Feature/Common/Code/Source/FrameCaptureSystemComponent.h @@ -36,9 +36,10 @@ namespace AZ bool CaptureScreenshot(const AZStd::string& filePath) override; bool CaptureScreenshotForWindow(const AZStd::string& filePath, AzFramework::NativeWindowHandle windowHandle) override; bool CaptureScreenshotWithPreview(const AZStd::string& outputFilePath) override; - bool CapturePassAttachment(const AZStd::vector& passHierarchy, const AZStd::string& slotName, const AZStd::string& outputFilePath) override; + bool CapturePassAttachment(const AZStd::vector& passHierarchy, const AZStd::string& slotName, const AZStd::string& outputFilePath, + RPI::PassAttachmentReadbackOption option) override; bool CapturePassAttachmentWithCallback(const AZStd::vector& passHierarchy, const AZStd::string& slotName - , RPI::AttachmentReadback::CallbackFunction callback) override; + , RPI::AttachmentReadback::CallbackFunction callback, RPI::PassAttachmentReadbackOption option) override; private: void CaptureAttachmentCallback(const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult); diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp index 5faaba136e..63437ebbad 100644 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp @@ -64,23 +64,9 @@ namespace AZ // Set up read back attachment before children prepare if (m_readback->IsReady()) { - AZ::RPI::RenderPass* renderPass = azrtti_cast(m_renderTargetPass.get()); - if (renderPass) + if (m_renderTargetPass) { - RPI::PassAttachment* attachment = nullptr; - for (auto& binding : renderPass->GetAttachmentBindings()) - { - if (binding.m_slotType == RPI::PassSlotType::Output) - { - attachment = binding.m_attachment.get(); - break; - } - } - if (attachment) - { - renderPass->ReadbackAttachment(m_readback, attachment); - m_attachmentReadbackComplete = true; - } + m_attachmentReadbackComplete = m_renderTargetPass->ReadbackAttachment(m_readback, AZ::Name("RenderTargetOutput")); } } } 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 c6667e660a..736252a8a2 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 @@ -57,6 +57,7 @@ namespace AZ class PassTemplate; struct PassRequest; struct PassValidationResults; + class AttachmentReadback; using SortedPipelineViewTags = AZStd::set; using PassesByDrawList = AZStd::map; @@ -65,7 +66,12 @@ namespace AZ const uint32_t PassInputBindingCountMax = 16; const uint32_t PassInputOutputBindingCountMax = PassInputBindingCountMax; const uint32_t PassOutputBindingCountMax = PassInputBindingCountMax; - + + enum class PassAttachmentReadbackOption : uint8_t + { + Input = 0, + Output + }; //! Atom's base pass class (every pass class in Atom must derive from this class). //! @@ -222,6 +228,14 @@ namespace AZ //! Enables/Disables PipelineStatistics queries for this pass virtual void SetPipelineStatisticsQueryEnabled(bool enable); + //! Readback an attachment attached to the specified slot name + //! @param readback The AttachmentReadback object which is used for readback. Its callback function will be called when readback is finished. + //! @param slotName The attachment bind to the slot with this slotName is to be readback + //! @param option The option is used for choosing input or output state when readback an InputOutput attachment. + //! It's ignored if the attachment isn't an InputOutput attachment. + //! Return true if the readback request was successful. User may expect the AttachmentReadback's callback function would be called. + bool ReadbackAttachment(AZStd::shared_ptr readback, const Name& slotName, PassAttachmentReadbackOption option = PassAttachmentReadbackOption::Output); + //! Returns whether the Timestamp queries is enabled/disabled for this pass bool IsTimestampQueryEnabled() const; @@ -266,7 +280,6 @@ namespace AZ // Update output bindings on this pass that are connected to bindings on other passes void UpdateConnectedOutputBindings(); - protected: explicit Pass(const PassDescriptor& descriptor); @@ -349,6 +362,7 @@ namespace AZ void FrameEnd(); virtual void FrameEndInternal() { } + void UpdateReadbackAttachment(FramePrepareParams params, bool beforeAddScopes); // --- Protected Members --- @@ -442,7 +456,10 @@ namespace AZ // Sort type to be used by the default sort implementation. Passes can also provide // fully custom sort implementations by overriding the SortDrawList() function. RHI::DrawListSortType m_drawListSortType = RHI::DrawListSortType::KeyThenDepth; - + + // For read back attachment + AZStd::shared_ptr m_attachmentReadback; + PassAttachmentReadbackOption m_readbackOption; private: // Return the Timestamp result of this pass diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h index b13091082b..3d4ab0a573 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h @@ -55,10 +55,7 @@ namespace AZ //! Get MultisampleState of this pass from its output attachments RHI::MultisampleState GetMultisampleState() const; - - //! Capture pass's output and input/output attachments in following frames - void ReadbackAttachment(AZStd::shared_ptr readback, const PassAttachment* attachment); - + //! Returns a pointer to the Pass ShaderResourceGroup Data::Instance GetShaderResourceGroup(); @@ -145,9 +142,6 @@ namespace AZ // Readback the results from the ScopeQueries void ReadbackScopeQueryResults(); - // For read back attachments - AZStd::shared_ptr m_attachmentReadback; - AZStd::weak_ptr m_attachmentCopy; // Readback results from the Timestamp queries diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h index f855154975..fac9abfe28 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h @@ -166,9 +166,6 @@ namespace AZ AZ::Vector2 m_position = AZ::Vector2(0, 0.6f); AZ::Vector2 m_size = AZ::Vector2(0.4f, 0.4f); bool m_keepAspectRatio = true; - - // For readback the output image attachment - AZStd::shared_ptr m_readback; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/RenderToTexturePass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/RenderToTexturePass.h index 0a689f2f74..f96fe92610 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/RenderToTexturePass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/RenderToTexturePass.h @@ -60,9 +60,6 @@ namespace AZ // Name of the template used to create the child pass. Needed for Recreate() Name m_childTemplateName; - // For read back output - AZStd::shared_ptr m_readback; - Ptr m_outputAttachment; // saved settings for this pass diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SelectorPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SelectorPass.h index 6b9559e824..9d1376c840 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SelectorPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SelectorPass.h @@ -15,7 +15,6 @@ #include #include -#include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SwapChainPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SwapChainPass.h index e7869d463c..e8aeddf7e7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SwapChainPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Specific/SwapChainPass.h @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -88,9 +87,6 @@ namespace AZ // Name of the template used to create the child pass. Needed for Recreate() Name m_childTemplateName; - - // For read back swap chain - AZStd::shared_ptr m_swapChainReadback; }; } // namespace RPI 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 9d3a776b80..dfe470c3f8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -36,8 +37,7 @@ namespace AZ { namespace RPI - { - + { // --- Constructors --- Pass::Pass(const PassDescriptor& descriptor) @@ -1285,9 +1285,15 @@ namespace AZ CreateTransientAttachments(params.m_frameGraphBuilder->GetAttachmentDatabase()); ImportAttachments(params.m_frameGraphBuilder->GetAttachmentDatabase()); + // readback attachment with input state + UpdateReadbackAttachment(params, true); + // FrameBeginInternal needs to be the last function be called in FrameBegin because its implementation expects // all the attachments are imported to database (for example, ImageAttachmentPreview) FrameBeginInternal(params); + + // readback attachment with output state + UpdateReadbackAttachment(params, false); UpdateConnectedOutputBindings(); } @@ -1426,6 +1432,57 @@ namespace AZ m_flags.m_pipelineStatisticsQueryEnabled = enable; } + bool Pass::ReadbackAttachment(AZStd::shared_ptr readback, const Name& slotName, PassAttachmentReadbackOption option) + { + // Return false if it's already readback + if (m_attachmentReadback) + { + AZ_Warning("Pass", false, "ReadbackAttachment: skip readback pass [%s] slot [%s]because there is an another active readback", m_name.GetCStr(), slotName.GetCStr()); + return false; + } + uint32_t bindingIndex = 0; + for (auto& binding : m_attachmentBindings) + { + if (slotName == binding.m_name) + { + RHI::AttachmentType type = binding.m_attachment->GetAttachmentType(); + if (type == RHI::AttachmentType::Buffer || type == RHI::AttachmentType::Image) + { + RHI::AttachmentId attachmentId = binding.m_attachment->GetAttachmentId(); + + // Append slot index and pass name so the read back's name won't be same as the attachment used in other passes. + AZStd::string readbackName = AZStd::string::format("%s_%d_%s", attachmentId.GetCStr(), + bindingIndex, GetName().GetCStr()); + if (readback->ReadPassAttachment(binding.m_attachment.get(), AZ::Name(readbackName))) + { + m_readbackOption = PassAttachmentReadbackOption::Output; + // The m_readbackOption is only meaningful if the attachment is used for InputOutput. + if (binding.m_slotType == PassSlotType::InputOutput) + { + m_readbackOption = option; + } + m_attachmentReadback = readback; + return true; + } + return false; + } + } + bindingIndex++; + } + AZ_Warning("Pass", false, "ReadbackAttachment: failed to find slot [%s] from pass [%s]", slotName.GetCStr(), m_name.GetCStr()); + return false; + } + + void Pass::UpdateReadbackAttachment(FramePrepareParams params, bool beforeAddScopes) + { + if (beforeAddScopes == (m_readbackOption == PassAttachmentReadbackOption::Input) && m_attachmentReadback) + { + // Read the attachment for one frame. The reference can be released afterwards + m_attachmentReadback->FrameBegin(params); + m_attachmentReadback = nullptr; + } + } + bool Pass::IsTimestampQueryEnabled() const { return m_flags.m_timestampQueryEnabled; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp index f386c93f63..a3e7e2a9e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp @@ -188,14 +188,8 @@ namespace AZ { SetScopeId(RHI::ScopeId(GetPathName())); } - params.m_frameGraphBuilder->ImportScopeProducer(*this); - // Read the attachment for one frame. The reference can be released afterwards - if (m_attachmentReadback) - { - m_attachmentReadback->FrameBegin(params); - m_attachmentReadback = nullptr; - } + params.m_frameGraphBuilder->ImportScopeProducer(*this); // Read back the ScopeQueries submitted from previous frames ReadbackScopeQueryResults(); @@ -414,31 +408,6 @@ namespace AZ m_flags.m_hasPipelineViewTag = !viewTag.IsEmpty(); } - void RenderPass::ReadbackAttachment(AZStd::shared_ptr readback, const PassAttachment* attachment) - { - m_attachmentReadback = readback; - - uint32_t bindingIndex = 0; - for (auto& binding : m_attachmentBindings) - { - if (attachment == binding.m_attachment) - { - RHI::AttachmentType type = binding.m_attachment->GetAttachmentType(); - if (type == RHI::AttachmentType::Buffer || type == RHI::AttachmentType::Image) - { - RHI::AttachmentId attachmentId = binding.m_attachment->GetAttachmentId(); - - // Append slot index and pass name so the read back's name won't be same as the attachment used in other passes. - AZStd::string readbackName = AZStd::string::format("%s_%d_%s", attachmentId.GetCStr(), - bindingIndex, GetName().GetCStr()); - m_attachmentReadback->ReadPassAttachment(binding.m_attachment.get(), AZ::Name(readbackName)); - return; - } - } - bindingIndex++; - } - } - TimestampResult RenderPass::GetTimestampResultInternal() const { return m_timestampResult; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp index abca45493a..66c994e113 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp @@ -334,22 +334,16 @@ namespace AZ m_passSrg->Compile(); m_passSrgChanged = false; } - - // Read preview output - if (m_readback) - { - m_readback->FrameBegin(params); - m_readback = nullptr; - } } bool ImageAttachmentPreviewPass::ReadbackOutput(AZStd::shared_ptr readback) { if (m_outputColorAttachment) { - m_readback = readback; + m_readbackOption = PassAttachmentReadbackOption::Output; + m_attachmentReadback = readback; AZStd::string readbackName = AZStd::string::format("%s_%s", m_outputColorAttachment->GetAttachmentId().GetCStr(), GetName().GetCStr()); - return m_readback->ReadPassAttachment(m_outputColorAttachment.get(), AZ::Name(readbackName)); + return m_attachmentReadback->ReadPassAttachment(m_outputColorAttachment.get(), AZ::Name(readbackName)); } return false; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/RenderToTexturePass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/RenderToTexturePass.cpp index 8b4c9b8aab..c532a1324f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/RenderToTexturePass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/RenderToTexturePass.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -77,17 +78,6 @@ namespace AZ params.m_viewportState = m_viewport; Base::FrameBeginInternal(params); - - // for read back output - if (m_readback) - { - m_readback->FrameBegin(params); - if (m_readback->IsFinished()) - { - // Done reading. Remove the reference - m_readback = nullptr; - } - } } void RenderToTexturePass::ResizeOutput(uint32_t width, uint32_t height) @@ -118,9 +108,10 @@ namespace AZ { if (m_outputAttachment) { - m_readback = readback; + m_readbackOption = PassAttachmentReadbackOption::Output; + m_attachmentReadback = readback; AZStd::string readbackName = AZStd::string::format("%s_%s", m_outputAttachment->GetAttachmentId().GetCStr(), GetName().GetCStr()); - m_readback->ReadPassAttachment(m_outputAttachment.get(), AZ::Name(readbackName)); + m_attachmentReadback->ReadPassAttachment(m_outputAttachment.get(), AZ::Name(readbackName)); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/SwapChainPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/SwapChainPass.cpp index 7a3bf3a011..62649cd0b2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/SwapChainPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Specific/SwapChainPass.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -134,13 +135,6 @@ namespace AZ attachmentDatabase.ImportSwapChain(m_windowContext->GetSwapChainAttachmentId(), m_windowContext->GetSwapChain()); ParentPass::FrameBeginInternal(params); - - // Read swap chain for one frame. The reference can be released afterwards - if (m_swapChainReadback) - { - m_swapChainReadback->FrameBegin(params); - m_swapChainReadback = nullptr; - } } void SwapChainPass::OnWindowResized([[maybe_unused]] uint32_t width, [[maybe_unused]] uint32_t height) @@ -152,9 +146,11 @@ namespace AZ { if (m_swapChainAttachment) { - m_swapChainReadback = readback; + m_readbackOption = PassAttachmentReadbackOption::Output; + m_attachmentReadback = readback; + AZStd::string readbackName = AZStd::string::format("%s_%s", m_swapChainAttachment->GetAttachmentId().GetCStr(), GetName().GetCStr()); - m_swapChainReadback->ReadPassAttachment(m_swapChainAttachment.get(), AZ::Name(readbackName)); + m_attachmentReadback->ReadPassAttachment(m_swapChainAttachment.get(), AZ::Name(readbackName)); } } diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.h index e735852926..d907e7e7eb 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.h @@ -32,11 +32,14 @@ namespace AZ void ReadbackCallback(const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult); + void DrawPassAttachments(AZ::RPI::Pass* pass); + bool m_previewAttachment = false; bool m_showAttachments = false; AZ::RPI::Pass* m_selectedPass = nullptr; AZ::RHI::AttachmentId m_attachmentId; + AZ::Name m_slotName; bool m_selectedChanged = false; AZStd::shared_ptr m_readback; diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl index cd53131933..d31674754e 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl @@ -76,6 +76,7 @@ namespace AZ::Render { m_selectedChanged = true; m_attachmentId = AZ::RHI::AttachmentId{}; + m_slotName = AZ::Name{}; } } @@ -88,13 +89,12 @@ namespace AZ::Render m_readback->SetCallback(AZStd::bind(&ImGuiPassTree::ReadbackCallback, this, AZStd::placeholders::_1)); } - if (m_selectedPass && !m_attachmentId.IsEmpty()) + if (m_selectedPass && !m_slotName.IsEmpty()) { - AZ::RPI::RenderPass* renderPass = azrtti_cast(m_selectedPass); - if (renderPass) + bool readbackResult = m_selectedPass->ReadbackAttachment(m_readback, m_slotName); + if (!readbackResult) { - AZ::RPI::PassAttachment* attachment = FindPassAttachment(renderPass, m_attachmentId); - renderPass->ReadbackAttachment(m_readback, attachment); + AZ_Error("ImGuiPassTree", false, "Failed to readback attachment from pass [%s] slot [%s]", m_selectedPass->GetName().GetCStr(), m_slotName.GetCStr()); } } } @@ -144,6 +144,77 @@ namespace AZ::Render } ImGui::End(); } + + inline void ImGuiPassTree::DrawPassAttachments(AZ::RPI::Pass* pass) + { + for (const auto& binding : pass->GetAttachmentBindings()) + { + // Binding info: [slot type] [slot name] + AZStd::string label = AZStd::string::format("[%s] [%s]", AZ::RPI::ToString(binding.m_slotType), + binding.m_name.GetCStr()); + + // Append attachment info if the attachment exists + if (binding.m_attachment) + { + AZ::RHI::AttachmentType type = binding.m_attachment->GetAttachmentType(); + + // Append attachment info: [attachment type] attachment name + label += AZStd::string::format(" [%s] %s", + AZ::RHI::ToString(type), + binding.m_attachment->m_name.GetCStr()); + + if (type == AZ::RHI::AttachmentType::Image) + { + // Append image info: [format] [size] [msaa] + AZ::RHI::ImageDescriptor descriptor; + if (binding.m_attachment->m_importedResource) + { + AZ::RPI::Image* image = static_cast(binding.m_attachment->m_importedResource.get()); + descriptor = image->GetRHIImage()->GetDescriptor(); + } + else + { + descriptor = binding.m_attachment->m_descriptor.m_image; + } + auto format = descriptor.m_format; + auto size = descriptor.m_size; + label += AZStd::string::format(" [%s] [%dx%d]", AZ::RHI::ToString(format), size.m_width, size.m_height); + + if (descriptor.m_multisampleState.m_samples > 1) + { + if (descriptor.m_multisampleState.m_customPositionsCount > 0) + { + label += AZStd::string::format(" [MSAA_Custom_%dx]", descriptor.m_multisampleState.m_samples); + } + else + { + label += AZStd::string::format(" [MSAA_%dx]", descriptor.m_multisampleState.m_samples); + } + } + } + else if (type == AZ::RHI::AttachmentType::Buffer) + { + // Append buffer info: [size] + auto size = binding.m_attachment->m_descriptor.m_buffer.m_byteCount; + label += AZStd::string::format(" [%llu]", size); + } + + if (Scriptable_ImGui::Selectable(label.c_str(), m_attachmentId == binding.m_attachment->GetAttachmentId())) + { + m_selectedPass = pass; + m_attachmentId = binding.m_attachment->GetAttachmentId(); + m_slotName = binding.m_name; + m_selectedChanged = true; + } + } + else + { + // Only draw text (not selectable) if there is no attachment binded to the slot. + ImGui::Text(label.c_str()); + } + } + + } inline void ImGuiPassTree::DrawTreeView(AZ::RPI::Pass* pass) { @@ -164,6 +235,7 @@ namespace AZ::Render { m_selectedPass = pass; m_attachmentId = AZ::RHI::AttachmentId{}; + m_slotName = AZ::Name{}; m_selectedChanged = true; } } @@ -179,76 +251,13 @@ namespace AZ::Render { m_selectedPass = pass; m_attachmentId = AZ::RHI::AttachmentId{}; + m_slotName = AZ::Name{}; m_selectedChanged = true; } if (nodeOpen) { - for (const auto& binding : pass->GetAttachmentBindings()) - { - // Binding info: [slot type] [slot name] - AZStd::string label = AZStd::string::format("[%s] [%s]", AZ::RPI::ToString(binding.m_slotType), - binding.m_name.GetCStr()); - - // Append attachment info if the attachment exists - if (binding.m_attachment) - { - AZ::RHI::AttachmentType type = binding.m_attachment->GetAttachmentType(); - - // Append attachment info: [attachment type] attachment name - label += AZStd::string::format(" [%s] %s", - AZ::RHI::ToString(type), - binding.m_attachment->m_name.GetCStr()); - - if (type == AZ::RHI::AttachmentType::Image) - { - // Append image info: [format] [size] [msaa] - AZ::RHI::ImageDescriptor descriptor; - if (binding.m_attachment->m_importedResource) - { - AZ::RPI::Image* image = static_cast(binding.m_attachment->m_importedResource.get()); - descriptor = image->GetRHIImage()->GetDescriptor(); - } - else - { - descriptor = binding.m_attachment->m_descriptor.m_image; - } - auto format = descriptor.m_format; - auto size = descriptor.m_size; - label += AZStd::string::format(" [%s] [%dx%d]", AZ::RHI::ToString(format), size.m_width, size.m_height); - - if (descriptor.m_multisampleState.m_samples > 1) - { - if (descriptor.m_multisampleState.m_customPositionsCount > 0) - { - label += AZStd::string::format(" [MSAA_Custom_%dx]", descriptor.m_multisampleState.m_samples); - } - else - { - label += AZStd::string::format(" [MSAA_%dx]", descriptor.m_multisampleState.m_samples); - } - } - } - else if (type == AZ::RHI::AttachmentType::Buffer) - { - // Append buffer info: [size] - auto size = binding.m_attachment->m_descriptor.m_buffer.m_byteCount; - label += AZStd::string::format(" [%llu]", size); - } - - if (Scriptable_ImGui::Selectable(label.c_str(), m_attachmentId == binding.m_attachment->GetAttachmentId())) - { - m_selectedPass = pass; - m_attachmentId = binding.m_attachment->GetAttachmentId(); - m_selectedChanged = true; - } - } - else - { - // Only draw text (not selectable) if there is no attachment binded to the slot. - ImGui::Text(label.c_str()); - } - } + DrawPassAttachments(pass); Scriptable_ImGui::TreePop(); } @@ -266,11 +275,13 @@ namespace AZ::Render { m_selectedPass = pass; m_attachmentId = AZ::RHI::AttachmentId{}; + m_slotName = AZ::Name{}; m_selectedChanged = true; } if (nodeOpen) { + DrawPassAttachments(pass); for (const auto& child : asParent->GetChildren()) { DrawTreeView(child.get()); @@ -354,6 +365,7 @@ namespace AZ::Render m_selectedPass = nullptr; m_attachmentId = AZ::RHI::AttachmentId{}; + m_slotName = AZ::Name{}; m_selectedChanged = false; m_readback = nullptr; m_previewPass = nullptr; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp index 46d9b59edb..3881a8c8f8 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp @@ -114,7 +114,7 @@ namespace AZ Render::FrameCaptureRequestBus::BroadcastResult( startedCapture, &Render::FrameCaptureRequestBus::Events::CapturePassAttachmentWithCallback, - m_context->GetData()->m_passHierarchy, AZStd::string("Output"), readbackCallback); + m_context->GetData()->m_passHierarchy, AZStd::string("Output"), readbackCallback, RPI::PassAttachmentReadbackOption::Output); // Reset the capture flag if the capture request was successful. Otherwise try capture it again next tick. if (startedCapture) { From 3f231075fec9b28a20716608dd9582ed7be82771 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 8 Jul 2021 08:53:19 -0700 Subject: [PATCH 118/156] Remove last of Great ScriptCanvas purge code, fix purity categorization handler connection control Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/Debug/StackTracer_Windows.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Node.cpp | 39 ------------------- .../Code/Include/ScriptCanvas/Core/Node.h | 6 --- .../Grammar/AbstractCodeModel.cpp | 29 +++++--------- .../Grammar/PrimitivesExecution.cpp | 8 ++-- .../Grammar/PrimitivesExecution.h | 6 +-- .../ScriptCanvas/Translation/GraphToLua.cpp | 10 +++-- 7 files changed, 23 insertions(+), 77 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp index 9b2ccbe754..39f6c02bde 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp @@ -146,7 +146,7 @@ namespace AZ { AZStd::mutex g_dbgLoadingMutex; HANDLE g_currentProcess = 0; /// We deal with only one process for now. CRITICAL_SECTION g_csDbgHelpDll; /// All dbg help functions are single threaded, so we need to control the access. - AZStd::fixed_vector g_moduleInfo; + AZStd::fixed_vector g_moduleInfo; // reserve 4k of scratch space so that we can get some callstack information without any allocations and as little stack frame usage as possible. const size_t g_scratchSpaceSize = 2048; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index 8250eb1763..cb1887252c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -2949,45 +2949,6 @@ namespace ScriptCanvas } } - void Node::SetInput(const Datum& newInput, const SlotId& slotId) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - - ModifiableDatumView datumView; - FindModifiableDatumView(slotId, datumView); - - if (datumView.IsValid()) - { - datumView.AssignToDatum(newInput); - } - } - - void Node::SetInput(Datum&& newInput, const SlotId& slotId) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - - ModifiableDatumView datumView; - FindModifiableDatumView(slotId, datumView); - - if (datumView.IsValid()) - { - datumView.AssignToDatum(newInput); - } - } - - void Node::SetInput(Node& node, const SlotId& id, const Datum& input) - { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); - node.SetInput(input, id); - } - - void Node::SetInput(Node& node, const SlotId& id, Datum&& input) - { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::SetInput"); - - node.SetInput(AZStd::move(input), id); - } - AZStd::string Node::GetDebugName() const { if (GetEntityId().IsValid()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h index 55379e29b9..bb598c01fd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h @@ -841,9 +841,6 @@ namespace ScriptCanvas void SignalSlotsReordered(); - static void SetInput(Node& node, const SlotId& id, const Datum& input); - static void SetInput(Node& node, const SlotId& id, Datum&& input); - // Will ignore any references and return the Datum that the slot represents. void ModifyUnderlyingSlotDatum(const SlotId& id, ModifiableDatumView& datumView); @@ -995,9 +992,6 @@ protected: void SetOwningScriptCanvasId(ScriptCanvasId scriptCanvasId); void SetGraphEntityId(AZ::EntityId graphEntityId); - virtual void SetInput(const Datum& input, const SlotId& id); - virtual void SetInput(Datum&& input, const SlotId& id); - bool SlotExists(AZStd::string_view name, const SlotDescriptor& slotDescriptor) const; bool IsTargetInDataFlowPath(const ID& targetNodeId, AZStd::unordered_set& path) const; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 348c89f45f..293ad236d3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -2422,17 +2422,17 @@ namespace ScriptCanvas ExecutionTreePtr start = OpenScope(nullptr, startNode, nullptr); start->SetSymbol(Symbol::FunctionDefinition); + m_start = start; // cache the function definition if (!m_subgraphStartCalls.empty()) { - m_start = start; - + // call OnGraphStart on all the member nodeables first for (auto node : m_subgraphStartCalls) { ExecutionTreePtr childStartCall = CreateChild(start, node, nullptr); childStartCall->SetSymbol(Symbol::FunctionCall); childStartCall->SetName(k_OnGraphStartFunctionName); - childStartCall->MarkStart(); + childStartCall->MarkStartCall(); auto lexicalScopeOutcome = node->GetFunctionCallLexicalScope(nullptr); @@ -2478,11 +2478,13 @@ namespace ScriptCanvas } } + // ExecutionTreePtr start is now either the last child start() call, or the beginning of the function block, + // either way, parsing can continue from the ExecutionTreePtr start. + if (!outSlots.empty()) { start->AddChild({ outSlots[0], {}, nullptr }); - start->MarkStart(); - + ParseExecutionMultipleOutSyntaxSugar(start, outNodes, outSlots); PostParseProcess(start); PostParseErrorDetect(start); @@ -2490,24 +2492,10 @@ namespace ScriptCanvas if (!IsErrorFree()) { start->Clear(); - - if (m_start) - { - m_start->Clear(); - } - + m_start->Clear(); AddError(AZ::EntityId{}, nullptr, ScriptCanvas::ParseErrors::StartNodeFailedToParse); return; } - - if (!m_start) - { - m_start = start; - } - } - else - { - // add warning or notification on useless start node? } if (m_start) @@ -4428,6 +4416,7 @@ namespace ScriptCanvas if (auto eventHandling = GetEBusEventHandling(node)) { auto variable = AZStd::make_shared(); + variable->m_isMember = true; variable->m_datum = Datum(eventHandling->m_handlerName); execution->MarkInputHasThisPointer(); execution->AddInput({ nullptr, variable, DebugDataSource::FromInternal() }); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp index 0984440bf4..011dfeda97 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp @@ -354,9 +354,9 @@ namespace ScriptCanvas return GetRoot()->m_isPure; } - bool ExecutionTree::IsStart() const + bool ExecutionTree::IsStartCall() const { - return m_isStart; + return m_isStartCall; } void ExecutionTree::MarkDebugEmptyStatement() @@ -403,9 +403,9 @@ namespace ScriptCanvas root->m_isLatent = true; } - void ExecutionTree::MarkStart() + void ExecutionTree::MarkStartCall() { - m_isStart = true; + m_isStartCall = true; } ExecutionChild& ExecutionTree::ModChild(size_t index) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.h index c86f445a68..80d602ad17 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesExecution.h @@ -199,7 +199,7 @@ namespace ScriptCanvas bool IsPure() const; - bool IsStart() const; + bool IsStartCall() const; void MarkDebugEmptyStatement(); @@ -215,7 +215,7 @@ namespace ScriptCanvas void MarkRootLatent(); - void MarkStart(); + void MarkStartCall(); ExecutionChild& ModChild(size_t index); @@ -286,7 +286,7 @@ namespace ScriptCanvas bool m_isPure = false; - bool m_isStart = false; + bool m_isStartCall = false; bool m_hasExplicitUserOutCalls = false; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp index 772fda4f7e..f945110674 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp @@ -806,7 +806,7 @@ namespace ScriptCanvas m_dotLua.Write("("); - if (execution->IsStart() && execution->IsPure()) + if (execution == m_model.GetStart() && execution->IsPure()) { m_dotLua.Write(Grammar::k_executionStateVariableName); @@ -1589,8 +1589,10 @@ namespace ScriptCanvas break; } - // #functions2 pure on graph start nodes with dependencies can only be added to the graph as variables -// if (execution->IsStart() && execution->IsPure()) + // #functions2 pure on graph start nodes with dependencies can only be added to the graph as variables, which is a work-flow we may never want to support + // as it effectively duplicates the Component-Entity-System. Technically, if this functionality is desired, one could just add another script component + // with the additional graph... +// if (execution->IsStartCall() && execution->IsPure()) // { // WriteFunctionCallInputOfChildStart(execution); // } @@ -1944,7 +1946,7 @@ namespace ScriptCanvas { const auto requirement = ParseConstructionRequirement(variable); - if (requirement == Grammar::VariableConstructionRequirement::None || (requirement != Grammar::VariableConstructionRequirement::Static && !execution->IsStart())) + if (requirement == Grammar::VariableConstructionRequirement::None || (requirement != Grammar::VariableConstructionRequirement::Static && !execution->IsStartCall())) { m_dotLua.WriteLineIndented("local %s = %s", variable->m_name.data(), ToValueString(variable->m_datum, m_configuration).data()); } From c132b00f6eda1fdcce5d530faf5bc263ea9729ac Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 8 Jul 2021 09:46:31 -0700 Subject: [PATCH 119/156] Removing some unused files from Code/Editor/Plugins (#1943) * fix path Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * remove some unused files from Code/Editor/Plugins Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/EditorCommon/EditorCommon.def | 6 -- .../Plugins/EditorCommon/res/EditorCommon.rc2 | Bin 782 -> 0 bytes Code/Editor/Plugins/QtMocRule.props | 10 --- Code/Editor/Plugins/QtMocRule.targets | 46 ----------- Code/Editor/Plugins/QtMocRule.xml | 74 ------------------ Code/Editor/Plugins/QtRccRule.props | 10 --- Code/Editor/Plugins/QtRccRule.targets | 46 ----------- Code/Editor/Plugins/QtRccRule.xml | 74 ------------------ Code/Editor/Plugins/QtUicRule.props | 10 --- Code/Editor/Plugins/QtUicRule.targets | 47 ----------- Code/Editor/Plugins/QtUicRule.xml | 74 ------------------ 11 files changed, 397 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/EditorCommon.def delete mode 100644 Code/Editor/Plugins/EditorCommon/res/EditorCommon.rc2 delete mode 100644 Code/Editor/Plugins/QtMocRule.props delete mode 100644 Code/Editor/Plugins/QtMocRule.targets delete mode 100644 Code/Editor/Plugins/QtMocRule.xml delete mode 100644 Code/Editor/Plugins/QtRccRule.props delete mode 100644 Code/Editor/Plugins/QtRccRule.targets delete mode 100644 Code/Editor/Plugins/QtRccRule.xml delete mode 100644 Code/Editor/Plugins/QtUicRule.props delete mode 100644 Code/Editor/Plugins/QtUicRule.targets delete mode 100644 Code/Editor/Plugins/QtUicRule.xml diff --git a/Code/Editor/Plugins/EditorCommon/EditorCommon.def b/Code/Editor/Plugins/EditorCommon/EditorCommon.def deleted file mode 100644 index a8d10ff297..0000000000 --- a/Code/Editor/Plugins/EditorCommon/EditorCommon.def +++ /dev/null @@ -1,6 +0,0 @@ -; EditorCommon.def : Declares the module parameters for the DLL. - -LIBRARY - -EXPORTS - ; Explicit exports can go here diff --git a/Code/Editor/Plugins/EditorCommon/res/EditorCommon.rc2 b/Code/Editor/Plugins/EditorCommon/res/EditorCommon.rc2 deleted file mode 100644 index 8ffc09417a13a873c604cd8f4fc9571c11d6906d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 782 zcmd6l%L>9U5Jm6WuL!slE%*nbE<}9bYb#nKEoci>7yi6@CPYLKbSXoUd1dC_OzyWt ziE6AwPJQi^>#S0hy6i`!RH2q;*ljYJtV&)d{1>z|=uRW;;M1hiR_7ccBhV}nroq@dKze=HT#%;6Aj_e3;CW( zhNmL`tSn%0+|H@&@fkJ;w|5L1ZDV{(|KE8TLQgegU - - - - %(RootDir)%(Directory)%(FileName).moc - $(QTDIR)\bin\moc.exe [AllOptions] [Inputs] - Moc'ing %(Filename)%(Extension)... - - - diff --git a/Code/Editor/Plugins/QtMocRule.targets b/Code/Editor/Plugins/QtMocRule.targets deleted file mode 100644 index fdcb95e6a3..0000000000 --- a/Code/Editor/Plugins/QtMocRule.targets +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - _QtMOC - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(QtMOC, '|') - - - - - - - diff --git a/Code/Editor/Plugins/QtMocRule.xml b/Code/Editor/Plugins/QtMocRule.xml deleted file mode 100644 index 21850b34ab..0000000000 --- a/Code/Editor/Plugins/QtMocRule.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - General - - - - - Command Line - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - diff --git a/Code/Editor/Plugins/QtRccRule.props b/Code/Editor/Plugins/QtRccRule.props deleted file mode 100644 index 9c06b5c082..0000000000 --- a/Code/Editor/Plugins/QtRccRule.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - %(RootDir)%(Directory)rcc_%(FileName).h - $(QTDIR)\bin\rcc.exe [AllOptions] [Inputs] - Rcc'ing %(Filename)%(Extension)... - - - diff --git a/Code/Editor/Plugins/QtRccRule.targets b/Code/Editor/Plugins/QtRccRule.targets deleted file mode 100644 index bd4e7ae90e..0000000000 --- a/Code/Editor/Plugins/QtRccRule.targets +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - _QtRCC - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(QtRCC, '|') - - - - - - - diff --git a/Code/Editor/Plugins/QtRccRule.xml b/Code/Editor/Plugins/QtRccRule.xml deleted file mode 100644 index ce7b98c323..0000000000 --- a/Code/Editor/Plugins/QtRccRule.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - General - - - - - Command Line - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - diff --git a/Code/Editor/Plugins/QtUicRule.props b/Code/Editor/Plugins/QtUicRule.props deleted file mode 100644 index ce08b40be7..0000000000 --- a/Code/Editor/Plugins/QtUicRule.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - %(RootDir)%(Directory)ui_%(FileName).h - $(QTDIR)\bin\uic.exe [AllOptions] [Inputs] - Uic'ing %(Filename)%(Extension)... - - - diff --git a/Code/Editor/Plugins/QtUicRule.targets b/Code/Editor/Plugins/QtUicRule.targets deleted file mode 100644 index a5ada15f79..0000000000 --- a/Code/Editor/Plugins/QtUicRule.targets +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - _QtUIC - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(QtUIC, '|') - - - - - - - - diff --git a/Code/Editor/Plugins/QtUicRule.xml b/Code/Editor/Plugins/QtUicRule.xml deleted file mode 100644 index ec7ce4b214..0000000000 --- a/Code/Editor/Plugins/QtUicRule.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - General - - - - - Command Line - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - From cb069d68f084513261eee819de772842e9dbe632 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 8 Jul 2021 11:54:51 -0500 Subject: [PATCH 120/156] Removed min/max settings that were just using the float min/max since these are the default. Signed-off-by: Chris Galvan --- .../Code/EMotionFX/Source/BlendTreeTransformNode.cpp | 8 -------- .../Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp | 2 -- 2 files changed, 10 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp index cfbff381eb..f67bf831f9 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTransformNode.cpp @@ -261,11 +261,7 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeTransformNode::Reinit) ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minTranslation, "Min Translation", "The minimum translation value, used when the input translation amount equals zero.") - ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) - ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_maxTranslation, "Max Translation", "The maximum translation value, used when the input translation amount equals one.") - ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) - ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minRotation, "Min Rotation", "The minimum rotation value, in degrees, used when the input rotation amount equals zero.") ->Attribute(AZ::Edit::Attributes::Min, -360.0f) ->Attribute(AZ::Edit::Attributes::Max, 360.0f) @@ -273,11 +269,7 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::Min, -360.0f) ->Attribute(AZ::Edit::Attributes::Max, 360.0f) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_minScale, "Min Scale", "The minimum scale value, used when the input scale amount equals zero.") - ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) - ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeTransformNode::m_maxScale, "Max Scale", "The maximum scale value, used when the input scale amount equals one.") - ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) - ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ; } } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp index acd9321ede..356fa78b59 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeVector3Math2Node.cpp @@ -254,8 +254,6 @@ namespace EMotionFX ->EnumAttribute(MATHFUNCTION_DIVIDE, "Divide") ->EnumAttribute(MATHFUNCTION_ANGLEDEGREES, "AngleDegrees") ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeVector3Math2Node::m_defaultValue, "Default Value", "The default value for x or y when one of them has no incomming connection.") - ->Attribute(AZ::Edit::Attributes::Min, -std::numeric_limits::max()) - ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) ; } } // namespace EMotionFX From d075d5f7b5043c54b1389b39533e2a415923845c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:29:55 -0700 Subject: [PATCH 121/156] fix AzGenericTypeInfo template handling with clang 12+ (#833) (#1947) Co-authored-by: Tom spot Callaway Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Co-authored-by: Tom "spot" Callaway <72474383+spotaws@users.noreply.github.com> Co-authored-by: Tom spot Callaway --- Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h b/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h index 4bb4bac2d3..27a3e9d2cf 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h +++ b/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h @@ -145,8 +145,13 @@ namespace AZ // also needs to be an overload for every version because they all represent overloads for different non-types. namespace AzGenericTypeInfo { - template - constexpr bool false_v = false; + /// Needs to match declared parameter type. + template %2
").arg(color).arg(text); - m_ui->logText->setTextFormat(Qt::RichText); - m_ui->logText->setText(QString("%2%1").arg(m_ui->logText->text()).arg(fullText)); - } - -#include "Qt/moc_LogContainer.cpp" - -} diff --git a/Code/Tools/News/NewsBuilder/Qt/LogContainer.h b/Code/Tools/News/NewsBuilder/Qt/LogContainer.h deleted file mode 100644 index 8f46f3b406..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/LogContainer.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 - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace Ui -{ - class LogContainerWidget; -} - -namespace News -{ - //! A control for displaying log - class LogContainer - : public QWidget - { - Q_OBJECT - - public: - explicit LogContainer(QWidget* parent); - ~LogContainer(); - - void AddLog(QString text, LogType logType) const; - - private: - QScopedPointer m_ui; - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/Qt/LogContainer.ui b/Code/Tools/News/NewsBuilder/Qt/LogContainer.ui deleted file mode 100644 index 3757f52480..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/LogContainer.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - LogContainerWidget - - - - 0 - 0 - 547 - 125 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - LogContainer - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - true - - - - - 0 - 0 - 545 - 123 - - - - - 0 - 0 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - background-color: rgb(45, 45, 45); - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - false - - - Qt::TextBrowserInteraction - - - - - - - - - - - - diff --git a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp b/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp deleted file mode 100644 index 5cbb510dd6..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.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 "NewsBuilder.h" -#include "Qt/ArticleDetails.h" -#include "Qt/BuilderArticleViewContainer.h" -#include "NewsShared/Qt/ArticleViewContainer.h" -#include "NewsShared/ResourceManagement/Resource.h" -#include "ResourceManagement/BuilderResourceManifest.h" -#include "ArticleDetailsContainer.h" -#include "LogContainer.h" -#include "EndpointManagerView.h" -#include "EndpointManager.h" -#include "Qt/QCustomMessageBox.h" - -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option") -#include -AZ_POP_DISABLE_WARNING - -#include -#include -#include -#include - -#include "Qt/ui_Newsbuilder.h" - -namespace News -{ - NewsBuilder::NewsBuilder(QWidget* parent, const AZ::IO::PathView& engineRootPath) - : QMainWindow(parent) - , m_ui(new Ui::NewsBuilderClass()) - , m_manifest(new BuilderResourceManifest( - std::bind(&NewsBuilder::SyncSuccess, this), - std::bind(&NewsBuilder::SyncFail, this, std::placeholders::_1), - std::bind(&NewsBuilder::SyncUpdate, this, std::placeholders::_1, std::placeholders::_2))) - , m_articleDetailsContainer(new ArticleDetailsContainer(this, *m_manifest)) - , m_articleViewContainer(new BuilderArticleViewContainer(this, *m_manifest)) - , m_logContainer(new LogContainer(this)) - { - - AzQtComponents::StyleManager* m_styleSheet = new AzQtComponents::StyleManager(this); - m_styleSheet->initialize(qApp, engineRootPath); - - m_ui->setupUi(this); - - QDir rootDir = QString::fromUtf8(engineRootPath.Native().data(), aznumeric_cast(engineRootPath.Native().size())); - const auto pathOnDisk = rootDir.absoluteFilePath("Code/Tools/News/NewsBuilder/Resources"); - const auto qrcPath = QStringLiteral(":/NewsBuilder"); - AzQtComponents::StyleManager::addSearchPaths("newsbuilder", pathOnDisk, qrcPath, engineRootPath); - - AzQtComponents::StyleManager::setStyleSheet(this, QStringLiteral("newsbuilder:NewsBuilder.qss")); - - UpdateEndpointLabel(); - - m_ui->articleViewContainerRoot->layout()->addWidget(m_articleViewContainer); - m_ui->articleDetailsContainerRoot->layout()->addWidget(m_articleDetailsContainer); - m_ui->dockWidgetContents->layout()->addWidget(m_logContainer); - - connect(m_articleViewContainer, SIGNAL(articleSelectedSignal(QString)), - this, SLOT(selectArticleSlot(QString))); - connect(m_articleViewContainer, SIGNAL(logSignal(QString, LogType)), - this, SLOT(addLogSlot(QString, LogType))); - - connect(m_articleDetailsContainer, &ArticleDetailsContainer::updateArticleSignal, - this, &NewsBuilder::updateArticleSlot); - connect(m_articleDetailsContainer, &ArticleDetailsContainer::deleteArticleSignal, - this, &NewsBuilder::deleteArticleSlot); - connect(m_articleDetailsContainer, &ArticleDetailsContainer::orderChangedSignal, - this, &NewsBuilder::orderChangedSlot); - connect(m_articleDetailsContainer, &ArticleDetailsContainer::closeArticleSignal, - this, &NewsBuilder::closeArticleSlot); - connect(m_articleDetailsContainer, SIGNAL(logSignal(QString, LogType)), - this, SLOT(addLogSlot(QString, LogType))); - - m_manifest->SetSyncType(SyncType::Merge); - m_manifest->Sync(); - - // Sync Console pane with View menu - connect(m_ui->actionConsole, &QAction::triggered, this, &NewsBuilder::OnViewLogWindow); - connect(m_ui->dockWidget, &QDockWidget::visibilityChanged, this, &NewsBuilder::OnViewVisibilityChanged); - } - - NewsBuilder::~NewsBuilder() {} - - void NewsBuilder::selectArticleSlot(const QString& id) const - { - m_articleDetailsContainer->SelectArticle(id); - } - - void NewsBuilder::addLogSlot(QString text, LogType logType) const - { - AddLog(text, logType); - } - - void NewsBuilder::addArticleToBottomSlot() const - { - m_articleViewContainer->AddArticle(); - } - - void NewsBuilder::updateArticleSlot(QString id) const - { - m_articleViewContainer->UpdateArticle(id); - } - - void NewsBuilder::deleteArticleSlot(QString id) const - { - m_articleViewContainer->DeleteArticle(id); - } - - void NewsBuilder::closeArticleSlot(QString id) const - { - m_articleViewContainer->CloseArticle(id); - } - - void NewsBuilder::orderChangedSlot(QString id, bool direction) const - { - m_articleViewContainer->UpdateArticleOrder(id, direction); - } - - void NewsBuilder::openSlot() - { - EndpointManagerView endpointManagerView( - m_ui->centralWidget, - *m_manifest); - if (endpointManagerView.exec() == QDialog::Accepted) - { - m_manifest->Sync(); - } - UpdateEndpointLabel(); - } - - void NewsBuilder::publishSlot() - { - if (!m_manifest->HasChanges()) - { - QCustomMessageBox msgBox( - QCustomMessageBox::Information, - tr("Nothing to publish"), - tr("No local changes were made, nothing to publish."), - this); - msgBox.AddButton(tr("Good"), 0); - msgBox.exec(); - return; - } - - enum Response - { - Yes, No - }; - - QCustomMessageBox msgBox( - QCustomMessageBox::Critical, - tr("Publish resources"), - tr("You are about to overwrite the current Open 3D Engine Welcome Message. Are you sure you want to publish?"), - this); - msgBox.AddButton("Yes", Yes); - msgBox.AddButton("No", No); - if (msgBox.exec() == Yes) - { - m_manifest->SetSyncType(SyncType::Verify); - m_manifest->Sync(); - } - } - - void NewsBuilder::OnViewVisibilityChanged([[maybe_unused]] bool visibility) - { - UpdateViewMenu(); - } - - void NewsBuilder::UpdateViewMenu() - { - if (m_ui->actionConsole->isChecked() != m_ui->dockWidget->isVisible()) - { - QSignalBlocker signalBlocker(m_ui->actionConsole); - m_ui->actionConsole->setChecked(m_ui->dockWidget->isVisible()); - } - } - - void NewsBuilder::OnViewLogWindow() - { - if (m_ui->dockWidget) - { - m_ui->dockWidget->toggleViewAction()->trigger(); - } - } - - void NewsBuilder::UpdateEndpointLabel() - { - auto pEndpoint = m_manifest->GetEndpointManager()->GetSelectedEndpoint(); - if (pEndpoint) - { - this->setWindowTitle("News Builder (" + pEndpoint->GetName() + ")"); - } - else - { - this->setWindowTitle("News Builder (No endpoint selected)"); - } - } - - void NewsBuilder::AddLog(QString text, LogType logType) const - { - m_logContainer->AddLog(text, logType); - } - - void NewsBuilder::SyncUpdate(const QString& message, LogType logType) const - { - AddLog(message, logType); - } - - void NewsBuilder::SyncFail(ErrorCode error) - { - const char* errorMessage = GetErrorMessage(error); - AddLog(tr("Sync failed: %1").arg(errorMessage), LogError); - QCustomMessageBox msgBoxSyncFail( - QCustomMessageBox::Critical, - tr("Sync failed"), - errorMessage, - this); - msgBoxSyncFail.AddButton("Ok", 0); - msgBoxSyncFail.exec(); - - m_articleViewContainer->PopulateArticles(); - m_articleDetailsContainer->Reset(); - } - - void NewsBuilder::SyncSuccess() const - { - AddLog("Sync completed", LogOk); - m_articleViewContainer->PopulateArticles(); - m_articleDetailsContainer->Reset(); - } -#include "Qt/moc_NewsBuilder.cpp" - -} diff --git a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.h b/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.h deleted file mode 100644 index 61e25bda1b..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.h +++ /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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include - -#include "NewsShared/LogType.h" -#include "NewsShared/ErrorCodes.h" - -#include -#endif - -class QSignalMapper; -class QPushButton; - -namespace Ui -{ - class NewsBuilderClass; -} - -namespace News -{ - class BuilderArticleViewContainer; - class LogContainer; - class BuilderResourceManifest; - class ArticleDetailsContainer; - - //! A central control of News Builder. - class NewsBuilder - : public QMainWindow - { - Q_OBJECT - - public: - explicit NewsBuilder(QWidget* parent, const AZ::IO::PathView& engineRootPath); - ~NewsBuilder(); - - private: - QScopedPointer m_ui; - BuilderResourceManifest* m_manifest = nullptr; - ArticleDetailsContainer* m_articleDetailsContainer = nullptr; - BuilderArticleViewContainer* m_articleViewContainer = nullptr; - LogContainer* m_logContainer = nullptr; - - void UpdateEndpointLabel(); - void AddLog(QString text, LogType logType = LogInfo) const; - - void SyncUpdate(const QString& message, LogType logType) const; - void SyncFail(ErrorCode error); - void SyncSuccess() const; - - void OnViewVisibilityChanged(bool visibility); - void UpdateViewMenu(); - void OnViewLogWindow(); - - private Q_SLOTS: - void selectArticleSlot(const QString& id) const; - void addLogSlot(QString text, LogType logType) const; - void addArticleToBottomSlot() const; - void updateArticleSlot(QString id) const; - void deleteArticleSlot(QString id) const; - void closeArticleSlot(QString id) const; - void orderChangedSlot(QString id, bool direction) const; - void openSlot(); - void publishSlot(); - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.qrc b/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.qrc deleted file mode 100644 index 768281fb12..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - ../Resources/missing-image.png - - diff --git a/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.ui b/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.ui deleted file mode 100644 index 55e7fe5b68..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/Newsbuilder.ui +++ /dev/null @@ -1,326 +0,0 @@ - - - NewsBuilderClass - - - - 0 - 0 - 800 - 540 - - - - - 0 - 480 - - - - - 1024 - 16777215 - - - - News Builder - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 800 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 480 - 0 - - - - - 16777215 - 16777215 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 0 - - - 5 - - - 5 - - - 5 - - - 5 - - - - - - - - - - - - - 0 - 0 - 800 - 21 - - - - - File - - - - - - - Article - - - - - - View - - - - - - - - - - - 0 - 0 - - - - - 63 - 66 - - - - QDockWidget::DockWidgetClosable - - - Qt::BottomDockWidgetArea - - - Console - - - 8 - - - - - 5 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - Change Endpoint - - - false - - - - - Publish Resources - - - false - - - - - Add to Bottom - - - - - Delete Selected - - - - - true - - - Console - - - - - - - AzQtComponents::StyledDockWidget - QDockWidget -
AzQtComponents/Components/StyledDockWidget.h
- 1 -
-
- - - - - - actionOpen - triggered() - NewsBuilderClass - openSlot() - - - -1 - -1 - - - 399 - 269 - - - - - actionPublish - triggered() - NewsBuilderClass - publishSlot() - - - -1 - -1 - - - 399 - 269 - - - - - actionAdd_New - triggered() - NewsBuilderClass - addArticleToBottomSlot() - - - -1 - -1 - - - 399 - 269 - - - - -
diff --git a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.cpp b/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.cpp deleted file mode 100644 index 1b92f91e42..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "QCustomMessageBox.h" -#include "Qt/ui_QCustomMessageBox.h" - -#include -#include -#include - -namespace News -{ - - QCustomMessageBox::QCustomMessageBox( - Icon icon, - const QString& title, - const QString& text, - QWidget* parent) - : QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint) - , m_ui(new Ui::CustomMessageBoxDialog) - { - m_ui->setupUi(this); - - m_signalMapper = new QSignalMapper(this); - - this->setWindowTitle(title); - m_ui->labelText->setText(text); - - QStyle* style = QApplication::style(); - QIcon tmpIcon; - switch (icon) - { - case Information: - tmpIcon = style->standardIcon(QStyle::SP_MessageBoxInformation); - break; - case Warning: - tmpIcon = style->standardIcon(QStyle::SP_MessageBoxWarning); - break; - case Critical: - tmpIcon = style->standardIcon(QStyle::SP_MessageBoxCritical); - break; - case Question: - tmpIcon = style->standardIcon(QStyle::SP_MessageBoxQuestion); - default: - break; - } - if (!tmpIcon.isNull()) - { - QLabel* iconLabel = new QLabel(this); - iconLabel->setPixmap(tmpIcon.pixmap(64, 64)); - m_ui->bodyLayout->insertWidget(0, iconLabel); - } - - connect(m_signalMapper, SIGNAL(mapped(int)), - this, SLOT(clickedSlot(int))); - } - - QCustomMessageBox::~QCustomMessageBox() - { - delete m_signalMapper; - } - - void QCustomMessageBox::AddButton(const QString& name, int result) - { - auto button = new QPushButton(name, this); - connect(button, SIGNAL(clicked()), m_signalMapper, SLOT(map())); - m_signalMapper->setMapping(button, result); - m_ui->buttonLayout->layout()->addWidget(button); - } - - void QCustomMessageBox::clickedSlot(int result) - { - done(result); - } - -#include "Qt/moc_QCustomMessageBox.cpp" - -} diff --git a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.h b/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.h deleted file mode 100644 index 6cd6771514..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -class QSignalMapper; - -namespace Ui -{ - class CustomMessageBoxDialog; -} - -namespace News -{ - class ArticleDetails; - class BuilderResourceManifest; - class SelectImage; - class ResourceManifest; - class Resource; - - //! Allows to add custom buttons which is not well-supported by default QMessageBox - class QCustomMessageBox - : public QDialog - { - Q_OBJECT - - public: - enum Icon { - NoIcon = 0, - Information = 1, - Warning = 2, - Critical = 3, - Question = 4 - }; - - QCustomMessageBox( - Icon, - const QString& title, - const QString& text, - QWidget* parent); - ~QCustomMessageBox(); - - void AddButton(const QString& name, int result); - - private: - QScopedPointer m_ui; - QSignalMapper* m_signalMapper = nullptr; - - private Q_SLOTS: - void clickedSlot(int result); - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.ui b/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.ui deleted file mode 100644 index c1fb5f40bf..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/QCustomMessageBox.ui +++ /dev/null @@ -1,84 +0,0 @@ - - - CustomMessageBoxDialog - - - - 0 - 0 - 102 - 43 - - - - - 0 - 0 - - - - Message Title - - - - - - - - - - - Message text - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - - - 10 - - - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - - - - - - diff --git a/Code/Tools/News/NewsBuilder/Qt/SelectImage.cpp b/Code/Tools/News/NewsBuilder/Qt/SelectImage.cpp deleted file mode 100644 index 7a9e427f4b..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/SelectImage.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 "SelectImage.h" -#include "ImageItem.h" -#include "NewsShared/ResourceManagement/Resource.h" -#include "ResourceManagement/BuilderResourceManifest.h" - -#include "Qt/ui_SelectImage.h" - -namespace News -{ - - const int SelectImage::MAX_COLS = 2; - - SelectImage::SelectImage(const ResourceManifest& manifest) - : QDialog() - , m_ui(new Ui::SelectImageDialog) - , m_manifest(manifest) - { - m_ui->setupUi(this); - - auto layout = static_cast(m_ui->scrollAreaContents->layout()); - layout->setAlignment(Qt::AlignTop | Qt::AlignLeft); - int row = 0; - int col = 0; - //! read all image resources and populate the container - for (auto pResource : m_manifest) - { - if (pResource->GetType().compare("image") == 0) - { - auto imageItem = new ImageItem(*pResource); - connect(imageItem, &ImageItem::selectSignal, this, &SelectImage::ImageSelected); - layout->addWidget(imageItem, row, col, Qt::AlignLeft); - m_images.append(imageItem); - col++; - if (col >= MAX_COLS) - { - col = 0; - row++; - } - } - } - - connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - } - - SelectImage::~SelectImage() {} - - Resource* SelectImage::GetSelected() const - { - return m_pSelected; - } - - void SelectImage::ImageSelected(ImageItem* imageItem) - { - for (auto image : m_images) - { - image->SetSelect(image == imageItem); - } - if (imageItem) - { - m_pSelected = &imageItem->GetResource(); - } - } - -#include "Qt/moc_SelectImage.cpp" - -} diff --git a/Code/Tools/News/NewsBuilder/Qt/SelectImage.h b/Code/Tools/News/NewsBuilder/Qt/SelectImage.h deleted file mode 100644 index 5fc80cfe5a..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/SelectImage.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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class SelectImageDialog; -} - -namespace News { - class ImageItem; - class Resource; - class ResourceManifest; - - //! Allows to select existing images for multiple messages without re-uploading same one - class SelectImage - : public QDialog - { - Q_OBJECT - public: - explicit SelectImage(const ResourceManifest& manifest); - ~SelectImage(); - - void Select(); - void Close(); - Resource* GetSelected() const; - - private: - const static int MAX_COLS; - QScopedPointer m_ui; - const ResourceManifest& m_manifest; - QList m_images; - Resource* m_pSelected = nullptr; - - void ImageSelected(ImageItem* imageItem); - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/Qt/SelectImage.ui b/Code/Tools/News/NewsBuilder/Qt/SelectImage.ui deleted file mode 100644 index 55b27bfb7f..0000000000 --- a/Code/Tools/News/NewsBuilder/Qt/SelectImage.ui +++ /dev/null @@ -1,106 +0,0 @@ - - - SelectImageDialog - - - Qt::ApplicationModal - - - - 0 - 0 - 439 - 406 - - - - Select Image - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::LeftToRight - - - Qt::ScrollBarAlwaysOff - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - 0 - 0 - 437 - 379 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 2 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.cpp b/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.cpp deleted file mode 100644 index 0a845216fe..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.cpp +++ /dev/null @@ -1,497 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "BuilderResourceManifest.h" -#include "NewsShared/ResourceManagement/QtDownloadManager.h" -#include "NewsBuilder/S3Connector.h" -#include "UidGenerator.h" -#include "NewsShared/ResourceManagement/Resource.h" -#include "NewsBuilder/ResourceManagement/UploadDescriptor.h" -#include "NewsBuilder/ResourceManagement/DeleteDescriptor.h" -#include "NewsShared/ResourceManagement/ArticleDescriptor.h" -#include "NewsBuilder/ResourceManagement/ImageDescriptor.h" -#include "EndpointManager.h" - -#include -#include - -#include -#include - -namespace News { - - BuilderResourceManifest::BuilderResourceManifest( - std::function syncSuccessCallback, - std::function syncFailCallback, - std::function syncUpdateCallback) - : ResourceManifest(syncSuccessCallback, syncFailCallback, syncUpdateCallback) - , m_s3Connector(new S3Connector) - , m_uidGenerator(new UidGenerator) - , m_endpointManager(new EndpointManager) {} - - - Resource* BuilderResourceManifest::AddArticle() - { - auto pResource = new Resource( - QString("%1").arg(m_uidGenerator->GenerateUid()), - "article"); - QJsonObject json; - json["title"] = "New Article"; - json["body"] = "Enter article body here"; - json["imageId"] = "0"; - QJsonDocument doc(json); - QByteArray data = doc.toJson(QJsonDocument::Compact).toStdString().data(); - pResource->SetData(data); - m_toUpload.push(pResource); - AppendResource(pResource); - m_order.append(pResource->GetId()); - return pResource; - } - - Resource* BuilderResourceManifest::AddImage(const QString& filename) - { - auto pResource = new Resource( - QString("%1").arg(m_uidGenerator->GenerateUid()), - "image"); - ImageDescriptor descriptor(*pResource); - QString error; - if (!descriptor.Read(filename, error)) - { - m_syncUpdateCallback(error, LogError); - delete pResource; - return nullptr; - } - m_toUpload.push(pResource); - AppendResource(pResource); - return pResource; - } - - void BuilderResourceManifest::UpdateResource(Resource* pResource) - { - if (!m_toUpload.contains(pResource)) - { - pResource->SetVersion(pResource->GetVersion() + 1); - m_toUpload.push(pResource); - } - } - - void BuilderResourceManifest::UseResource(const QString& id) - { - auto pResource = FindById(id, m_resources); - if (!pResource) - { - return; - } - pResource->SetRefCount(pResource->GetRefCount() + 1); - UpdateResource(pResource); - } - - void BuilderResourceManifest::FreeResource(const QString& id) - { - auto pResource = FindById(id, m_resources); - if (!pResource) - { - return; - } - if (m_toDelete.contains(pResource)) - { - return; - } - pResource->SetRefCount(pResource->GetRefCount() - 1); - if (pResource->GetRefCount() <= 0) - { - m_toDelete.push(pResource); - RemoveResource(pResource); - m_toUpload.removeAll(pResource); - - if (pResource->GetType().compare("article") == 0) - { - m_order.removeAll(pResource->GetId()); - } - } - else - { - m_toUpload.push(pResource); - } - } - - bool BuilderResourceManifest::UpdateArticleOrder(const QString& id, bool direction, ErrorCode& error) - { - int index = m_order.indexOf(id); - if (index == -1) - { - m_syncUpdateCallback(QString("Couldn't find article: %1").arg(id), LogError); - error = ErrorCode::MissingArticle; - return false; - } - m_order.removeAll(id); - - index = index + (direction ? -1 : 1); - if (index < 0) - { - index = 0; - } - if (index > m_order.count()) - { - index = m_order.count(); - } - m_order.insert(index, id); - return true; - } - - EndpointManager* BuilderResourceManifest::GetEndpointManager() const - { - return m_endpointManager; - } - - void BuilderResourceManifest::Sync() - { - if (!m_endpointManager->GetSelectedEndpoint()) - { - FailSync(ErrorCode::NoEndpoint); - return; - } - if (!InitS3Connector()) - { - FailSync(ErrorCode::S3Fail); - return; - } - ResourceManifest::Sync(); - } - - void BuilderResourceManifest::Reset() - { - if (s_syncing) - { - m_syncUpdateCallback("Sync is already running", LogError); - return; - } - - m_toUpload.clear(); - - for (auto pResource : m_toDelete) - { - delete pResource; - } - m_toDelete.clear(); - - m_uidGenerator->Clear(); - - ResourceManifest::Reset(); - } - - void BuilderResourceManifest::PersistLocalResources() - { - // we are switching to another manifest here, while having the local data still present - // so we need to explicitly mark it for uploading so that it does not get deleted - for (auto pResource : m_resources) - { - if (!m_toUpload.contains(pResource)) - { - m_toUpload.push(pResource); - } - } - } - - void BuilderResourceManifest::SetSyncType(SyncType syncType) - { - m_syncType = syncType; - } - - bool BuilderResourceManifest::HasChanges() const - { - return m_toUpload.count() > 0 || m_toDelete.count() > 0; - } - - void BuilderResourceManifest::AppendResource(Resource* pResource) - { - m_uidGenerator->AddUid(pResource->GetId().toInt()); - ResourceManifest::AppendResource(pResource); - } - - void BuilderResourceManifest::RemoveResource(Resource* pResource) - { - m_uidGenerator->RemoveUid(pResource->GetId().toInt()); - ResourceManifest::RemoveResource(pResource); - } - - void BuilderResourceManifest::OnDownloadFail() - { - QMessageBox msgBox(QMessageBox::Critical, - "Sync failed", - QString("%1\n\n%2") - .arg(GetErrorMessage(ErrorCode::ManifestDownloadFail)) - .arg(QObject::tr("Overwrite resource manifest?")), - QMessageBox::Yes | QMessageBox::No); - if (msgBox.exec() == QMessageBox::Yes) - { - if (!UploadManifest()) - { - m_failed = true; - m_errorCode = ErrorCode::ManifestUploadFail; - } - } - ResourceManifest::OnDownloadFail(); - } - - //! This function overrides ResourceManifest Read and tries to do some minimal version checking - //! NOTE: version checking is not done yet, this needs a lot more work to version check properly - ErrorCode BuilderResourceManifest::Read(const QJsonObject& json) - { - int version = json["version"].toInt(); - if (version > m_version && m_syncType == SyncType::Verify) - { - return ErrorCode::OutOfSync; - } - - m_version = version; - QJsonArray resourceArray = json["resources"].toArray(); - - // initially mark ALL existing resource for deletion - QList toDelete = m_resources; - - for (auto resourceDoc : resourceArray) - { - auto pNewResource = new Resource(resourceDoc.toObject()); - // find local resource with the same id as new resource - auto pOldResource = FindById(pNewResource->GetId(), m_resources); - // if resource with the same id already exists then check its version - if (pOldResource) - { - // local resource is outdated, keep its in delete list, and download new one instead - if (pNewResource->GetVersion() > pOldResource->GetVersion()) - { - if (m_syncType == SyncType::Merge) - { - m_toDownload.push(pNewResource); - } - else if (m_syncType == SyncType::Overwrite) - { - m_toDelete.push(pNewResource); - } - } - // local resource is newer or same version, keep it (remove from toDelete list) - // and don't need to download new one - else - { - delete pNewResource; - toDelete.removeAll(pOldResource); - } - } - else - { - // if remote resource was NOT deleted locally then download it - if (!FindById(pNewResource->GetId(), m_toDelete)) - { - if (m_syncType == SyncType::Merge) - { - m_toDownload.push(pNewResource); - } - else if (m_syncType == SyncType::Overwrite) - { - m_toDelete.push(pNewResource); - } - } - // otherwise user deleted it... needs version check here - else - { - delete pNewResource; - } - } - } - - for (auto pResource : m_toUpload) - { - toDelete.removeAll(pResource); - } - - for (auto pResource : toDelete) - { - RemoveResource(pResource); - m_toDelete.removeAll(pResource); - delete pResource; - } - - //! Sync article display order - //! this is more complex to implement because articles may have been added or deleted - //! remotely by another developer while newsbuilder was running - //! for now just overwrite s3 version - QJsonArray orderArray = json["order"].toArray(); - for (auto idObject : orderArray) - { - QString id = idObject.toString(); - if (FindById(id, m_toDownload) && !m_order.contains(id)) - { - m_order.append(id); - } - } - return ErrorCode::None; - } - - //! Write resource manifest to JSON - void BuilderResourceManifest::Write(QJsonObject& json) const - { - QJsonArray resourceArray; - foreach(auto pResource, m_resources) - { - QJsonObject resourceObject; - pResource->Write(resourceObject); - resourceArray.append(resourceObject); - } - json["resources"] = resourceArray; - - QJsonArray orderArray; - foreach(auto id, m_order) - { - orderArray.append(id); - } - json["order"] = orderArray; - json["version"] = m_version; - } - - //! Figure out how many resources need to be synced - void BuilderResourceManifest::PrepareForSync() - { - // if resource is locally marked for deletion, then we don't need to upload/download it - for (auto pResource : m_toDelete) - { - m_toDownload.removeAll(pResource); - m_toUpload.removeAll(pResource); - } - - m_syncLeft = - m_toDownload.size() + - m_toUpload.size() + - m_toDelete.size(); - } - - void BuilderResourceManifest::SyncResources() - { - ResourceManifest::SyncResources(); - UploadResources(); - DeleteResources(); - } - - void BuilderResourceManifest::UploadResources() - { - QStack failures; - while (m_toUpload.count() > 0) - { - m_syncUpdateCallback( - QString("Uploading: %1 resources left").arg(m_toUpload.count()), - LogInfo); - - auto pResource = m_toUpload.pop(); - - auto uploadDescriptor = UploadDescriptor(*pResource); - uploadDescriptor.Upload(*m_s3Connector, - [&](QString url) - { - UpdateSync(); - }, - [&, pResource](QString error) - { - failures.push(pResource); - m_failed = true; - UpdateSync(); - m_syncUpdateCallback( - error, - LogError); - }); - } - while (failures.count() > 0) - { - m_toUpload.push(failures.pop()); - } - } - - void BuilderResourceManifest::DeleteResources() - { - while (m_toDelete.count() > 0) - { - m_syncUpdateCallback( - QString("Deleting: %1 resources left").arg(m_toDelete.count()), - LogInfo); - - auto pResource = m_toDelete.pop(); - - auto deleteDescriptor = DeleteDescriptor(*pResource); - deleteDescriptor.Delete(*m_s3Connector, - [&, pResource]() - { - delete pResource; - UpdateSync(); - }, - [&, pResource](QString error) - { - m_failed = true; - delete pResource; - UpdateSync(); - m_syncUpdateCallback( - QString("Failed to delete resource: %1").arg(error), - LogError); - }); - } - } - - void BuilderResourceManifest::FinishSync() - { - if (!m_failed) - { - QString error; - if (!UploadManifest()) - { - m_failed = true; - m_errorCode = ErrorCode::ManifestUploadFail; - } - } - ResourceManifest::FinishSync(); - } - - bool BuilderResourceManifest::UploadManifest() - { - m_syncUpdateCallback(QObject::tr("%1 to %2") - .arg("Uploading manifest") - .arg(m_endpointManager->GetSelectedEndpoint()->GetBucket()), - LogInfo); - m_version++; - Aws::String awsError; - QJsonObject manifestObject; - Write(manifestObject); - QJsonDocument doc(manifestObject); - auto ss = Aws::MakeShared( - S3Connector::ALLOCATION_TAG, - std::ios::in | std::ios::out | std::ios::binary); - *ss << QString(doc.toJson(QJsonDocument::Compact)).toStdString(); - Aws::String url; - if (!m_s3Connector->PutObject("resourceManifest", ss, url, awsError)) - { - m_syncUpdateCallback(QObject::tr(awsError.c_str()), LogError); - return false; - } - return true; - } - - bool BuilderResourceManifest::InitS3Connector() const - { - auto awsProfileName = - m_endpointManager->GetSelectedEndpoint()->GetAwsProfile(); - auto bucketName = - m_endpointManager->GetSelectedEndpoint()->GetBucket(); - Aws::String awsError; - if (!m_s3Connector->Init( - awsProfileName.toStdString().c_str(), - bucketName.toStdString().c_str(), - awsError)) - { - m_syncUpdateCallback(QObject::tr(awsError.c_str()), LogError); - return false; - } - return true; - } - -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.h b/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.h deleted file mode 100644 index b6c20df571..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/BuilderResourceManifest.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 "NewsShared/ResourceManagement/ResourceManifest.h" - -#include - -class QJsonObject; - -namespace News -{ - class EndpointManager; - class ArticleDescriptor; - class UidGenerator; - class S3Connector; - class QtDownloadManager; - class Descriptor; - class DownloadDescriptor; - class Resource; - - //! Type of sync behavior - enum class SyncType - { - Merge, // merge resources from both endpoints, i.e. replacing outdated and appending missing (also normal sync behavior) - Overwrite, // overwrite resources on new endpoint with old endpoint - Verify // attempt to publish changes but abort if out of sync - }; - - //! Adds news-builder functionality layer to resource manager - class BuilderResourceManifest - : public ResourceManifest - { - public: - explicit BuilderResourceManifest( - std::function syncSuccessCallback, - std::function syncFailCallback, - std::function syncUpdateCallback); - - //! Create new article resource - /*! - Create new article with default parameters, - Add it to resource collection, - Mark it for upload. - - \retval Resource * - a pointer to an article Resource - */ - Resource* AddArticle(); - - //! Create new image resource - /*! - Create new image from file, - add it to resource collection, - mark it for upload. - - \param filename - path to an image on hard drive - \retval Resource * - a pointer to an image Resource - */ - Resource* AddImage(const QString& filename); - - //! If resource was modified, add it to upload list and increment its version - void UpdateResource(Resource* resource); - - //! When resource is used by several other resources, this function is called - //! to increment its ref count - void UseResource(const QString& id); - - //! When resource is no longer used by another resource - //! decrement refCount, - //! if nothing else is using it, then mark for delete - void FreeResource(const QString& id); - - //! Move article either up or down in order queue - bool UpdateArticleOrder(const QString& id, bool direction, ErrorCode& error); - - EndpointManager* GetEndpointManager() const; - - void Sync() override; - - void Reset() override; - - //! When switching endpoints Merge allows to persist resources to another endpoint, - //! thus copying news from one location to another upon next Sync - void PersistLocalResources(); - - void SetSyncType(SyncType syncType); - - //! Are there local changes - bool HasChanges() const; - - protected: - void AppendResource(Resource* pResource) override; - void RemoveResource(Resource* pResource) override; - void OnDownloadFail() override; - void FinishSync() override; - - private: - S3Connector* m_s3Connector = nullptr; - UidGenerator* m_uidGenerator = nullptr; - EndpointManager* m_endpointManager = nullptr; - SyncType m_syncType = SyncType::Merge; - - QStack m_toUpload; - QStack m_toDelete; - - ErrorCode Read(const QJsonObject& json) override; - void Write(QJsonObject& json) const; - - void PrepareForSync() override; - void SyncResources() override; - - void UploadResources(); - void DeleteResources(); - - bool UploadManifest(); - - //! Initializes S3 connector with selected endpoint - bool InitS3Connector() const; - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.cpp b/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.cpp deleted file mode 100644 index 63cdb46218..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.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 "DeleteDescriptor.h" -#include "NewsBuilder/S3Connector.h" -#include "NewsShared/ResourceManagement/Resource.h" - -#include - -namespace News -{ - - DeleteDescriptor::DeleteDescriptor(Resource& resource) - : Descriptor(resource) {} - - void DeleteDescriptor::Delete(S3Connector& s3Connector, - std::function deleteSuccessCallback, - std::function deleteFailCallback) const - { - Aws::String error; - if (!s3Connector.DeleteObject( - m_resource.GetId().toStdString().c_str(), - error)) - { - deleteFailCallback(QString("Error deleting resource %1: %2") - .arg(m_resource.GetId()) - .arg(error.c_str())); - } - else - { - deleteSuccessCallback(); - } - } - -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.h b/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.h deleted file mode 100644 index 8928e9e19d..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/DeleteDescriptor.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 "NewsShared/ResourceManagement/Descriptor.h" - -#include -#include - -namespace News -{ - class S3Connector; - - class DeleteDescriptor - : public Descriptor - { - public: - explicit DeleteDescriptor(Resource& resource); - - void Delete(S3Connector& s3Connector, - std::function deleteSuccessCallback, - std::function deleteFailCallback) const; - }; -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.cpp b/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.cpp deleted file mode 100644 index a16ec48851..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.cpp +++ /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 - * - */ - -#include "ImageDescriptor.h" -#include "NewsShared/ResourceManagement/Resource.h" - -#include -#include -#include -#include -#include - -namespace News -{ - - ImageDescriptor::ImageDescriptor( - Resource& resource) - : Descriptor(resource) - { - } - - bool ImageDescriptor::Read(const QString& filename, QString& error) const - { - QImageReader reader(filename); - if (!reader.canRead()) - { - error = reader.errorString(); - return false; - } - QImage image = reader.read(); - - QPixmap pixmap(filename); - QByteArray data; - QBuffer buffer(&data); - buffer.open(QIODevice::WriteOnly); - QFile test("test.png"); - if (pixmap.save(&buffer, "PNG")) - { - m_resource.SetData(data); - return true; - } - error = QString("failed to save image %1").arg(filename); - return false; - } - -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.h b/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.h deleted file mode 100644 index ba4533b0c0..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/ImageDescriptor.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 - -class QString; - -namespace News -{ - class ImageDescriptor - : public Descriptor - { - public: - explicit ImageDescriptor(Resource& resource); - - bool Read(const QString& filename, QString& error) const; - }; -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.cpp b/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.cpp deleted file mode 100644 index 699959ed85..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.cpp +++ /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 - * - */ - -#include "NewsBuilder/S3Connector.h" -#include "UploadDescriptor.h" -#include "NewsShared/ResourceManagement/Resource.h" - -#include -#include -#include - -#include - -namespace News -{ - - UploadDescriptor::UploadDescriptor(Resource& resource) - : Descriptor(resource) {} - - void UploadDescriptor::Upload(S3Connector& s3Connector, - std::function uploadSuccessCallback, - std::function uploadFailCallback) const - { - Aws::String error; - - auto ss = - Aws::MakeShared(S3Connector::ALLOCATION_TAG, - std::ios::in | std::ios::out | std::ios::binary); - auto* pbuf = ss->rdbuf(); - pbuf->sputn(m_resource.GetData().data(), m_resource.GetData().size()); - Aws::String awsUrl; - - if (!s3Connector.PutObject( - m_resource.GetId().toStdString().c_str(), - ss, - m_resource.GetData().size(), - awsUrl, - error)) - { - uploadFailCallback(QObject::tr("Error uploading resource %1: %2") - .arg(m_resource.GetId()) - .arg(error.c_str())); - } - else - { - uploadSuccessCallback(QString(awsUrl.c_str())); - } - } - -} diff --git a/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.h b/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.h deleted file mode 100644 index 71a7732c1e..0000000000 --- a/Code/Tools/News/NewsBuilder/ResourceManagement/UploadDescriptor.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 "NewsShared/ResourceManagement/Descriptor.h" - -#include -#include - -namespace News -{ - class S3Connector; - - class UploadDescriptor - : public Descriptor - { - public: - explicit UploadDescriptor(Resource& resource); - - void Upload(S3Connector& s3Connector, - std::function uploadSuccessCallback, - std::function uploadFailCallback) const; - }; -} diff --git a/Code/Tools/News/NewsBuilder/Resources/NewsBuilder.qss b/Code/Tools/News/NewsBuilder/Resources/NewsBuilder.qss deleted file mode 100644 index 01ca308585..0000000000 --- a/Code/Tools/News/NewsBuilder/Resources/NewsBuilder.qss +++ /dev/null @@ -1,44 +0,0 @@ -QLabel -{ - font-size: 12px; - color: #FFFFFF; - line-height: 20px; - background-color: transparent; - margin: 0; -} - -QLabel#titleLabel -{ - font-size: 22px; - line-height: 32px; -} - -QLabel#bodyLabel -{ - font-size: 14px; - line-height: 20px; -} - -QFrame#viewContainer[articleStyle="pinned"] -{ - background: rgba(180,139,255,5%); - border: 1px solid #B48BFF; - box-shadow: 0 0 4px 0 rgba(0,0,0,50%); -} - -QWidget#articleViewContainerRoot -{ - background: #222222; -} - -QScrollArea#previewArea, -QWidget#articleViewContents, -QFrame#imageFrame -{ - background-color: transparent; -} - -News--ArticleView.SelectedArticle > QWidget -{ - background: #333333; -} diff --git a/Code/Tools/News/NewsBuilder/Resources/missing-image.png b/Code/Tools/News/NewsBuilder/Resources/missing-image.png deleted file mode 100644 index 889493e628..0000000000 --- a/Code/Tools/News/NewsBuilder/Resources/missing-image.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4255a25636d77a54809592bc98bef47fa9044be03cd65d73daa821711489e00f -size 7379 diff --git a/Code/Tools/News/NewsBuilder/S3Connector.cpp b/Code/Tools/News/NewsBuilder/S3Connector.cpp deleted file mode 100644 index a54b6fa8f8..0000000000 --- a/Code/Tools/News/NewsBuilder/S3Connector.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "S3Connector.h" - -#include -#include -#include - - -AZ_PUSH_DISABLE_WARNING(4251 4819, "-Wunknown-warning-option") // Invalid character not in default code page -#include -#include -#include -#include -#include -#include -#include -#include -AZ_POP_DISABLE_WARNING - -namespace News -{ - const char* S3Connector::ALLOCATION_TAG = "NewsBuilder"; - - S3Connector::S3Connector() - : m_s3Client(nullptr) - , m_limiter(nullptr) - , m_valid(false) - { - } - - S3Connector::~S3Connector() {} - - bool S3Connector::Init(const char* awsProfileName, const char* bucket, Aws::String& error) - { - Aws::SDKOptions options; - options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; - Aws::InitAPI(options); - - Aws::Client::ClientConfiguration config; - config.enableTcpKeepAlive = AZ_TRAIT_AZFRAMEWORK_AWS_ENABLE_TCP_KEEP_ALIVE_SUPPORTED; - config.scheme = Aws::Http::Scheme::HTTPS; - config.connectTimeoutMs = 30000; - config.requestTimeoutMs = 30000; - config.readRateLimiter = m_limiter; - config.writeRateLimiter = m_limiter; - - auto provider = - Aws::MakeShared( - ALLOCATION_TAG, - awsProfileName); - - auto accessKeyId = provider->GetAWSCredentials().GetAWSAccessKeyId(); - - //! verify that credential file exists - if (accessKeyId.empty()) - { - error = "LY_NEWS_DEVELOPER AWS credentials not found. Add credentials in LY Editor AWS->ClientManager"; - m_valid = false; - return false; - } - - m_bucket = Aws::String(bucket); - m_s3Client = Aws::MakeShared( - ALLOCATION_TAG, - provider, - config); - - m_valid = true; - return true; - } - - bool S3Connector::GetObject(const char* key, - Aws::String& data, - Aws::String& url, - Aws::String& error) const - { - if (!m_valid) - { - error = "Client not initialized"; - return false; - } - - Aws::S3::Model::GetObjectRequest getObjectRequest; - getObjectRequest.SetBucket(m_bucket); - getObjectRequest.SetKey(key); - auto outcome = m_s3Client->GetObject(getObjectRequest); - if (!outcome.IsSuccess()) - { - error = outcome.GetError().GetMessage(); - return false; - } - url = m_s3Client->GeneratePresignedUrl(m_bucket, key, Aws::Http::HttpMethod::HTTP_GET); - Aws::StringStream ss; - ss << outcome.GetResult().GetBody().rdbuf(); - data = ss.str(); - return true; - } - - bool S3Connector::PutObject(const char* key, - STREAM_PTR stream, - Aws::String& url, - Aws::String& error) const - { - return PutObject(key, stream, GetStreamLength(stream), url, error); - } - - bool S3Connector::PutObject(const char* key, - STREAM_PTR stream, - int length, - Aws::String& url, - Aws::String& error) const - { - if (!m_valid) - { - error = "Client not initialized"; - return false; - } - - Aws::S3::Model::PutObjectRequest putObjectRequest; - putObjectRequest.SetBucket(m_bucket); - putObjectRequest.SetBody(stream); - putObjectRequest.SetContentLength(length); - putObjectRequest.SetContentMD5( - Aws::Utils::HashingUtils::Base64Encode( - Aws::Utils::HashingUtils::CalculateMD5(*putObjectRequest.GetBody()))); - putObjectRequest.SetContentType(Aws::String("binary/octet-stream")); - putObjectRequest.SetKey(key); - putObjectRequest.SetACL(Aws::S3::Model::ObjectCannedACL::public_read); - auto outcome = m_s3Client->PutObject(putObjectRequest); - if (!outcome.IsSuccess()) - { - error = outcome.GetError().GetMessage(); - return false; - } - url = m_s3Client->GeneratePresignedUrl(m_bucket, key, Aws::Http::HttpMethod::HTTP_GET); - return true; - } - - bool S3Connector::DeleteObject(const char* key, Aws::String& error) const - { - if (!m_valid) - { - error = "Client not initialized"; - return false; - } - - Aws::S3::Model::DeleteObjectRequest deleteObjectRequest; - deleteObjectRequest.SetBucket(m_bucket); - deleteObjectRequest.SetKey(key); - auto outcome = m_s3Client->DeleteObject(deleteObjectRequest); - if (!outcome.IsSuccess()) - { - error = outcome.GetError().GetMessage(); - return false; - } - return true; - } - - int S3Connector::GetStreamLength(STREAM_PTR stream) - { - stream->seekg(0, std::ios::end); - auto length = stream->tellg(); - stream->seekg(0, std::ios::beg); - return static_cast(length); - } - -} diff --git a/Code/Tools/News/NewsBuilder/S3Connector.h b/Code/Tools/News/NewsBuilder/S3Connector.h deleted file mode 100644 index d0404bfddb..0000000000 --- a/Code/Tools/News/NewsBuilder/S3Connector.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 -AZ_PUSH_DISABLE_WARNING(4251 4355 4996, "-Wunknown-warning-option") // includes ppltasks.h which throws a C4355 warning: 'this' used in base member initializer list -#include -AZ_POP_DISABLE_WARNING - -typedef std::shared_ptr STREAM_PTR; - -namespace News -{ - //! A light wrapper around AWS SDK - class S3Connector - { - public: - static const char* ALLOCATION_TAG; - - S3Connector(); - ~S3Connector(); - - //! Make s3 client using credentials stored in [user]/.aws/credentials file - /*! - \param awsProfileName - name of AWS credentials - \param bucket - name of s3 bucket to use for AWS operations - \param error - error string - \retval bool - true if success else false - */ - bool Init(const char* awsProfileName, const char* bucket, Aws::String& error); - - bool GetObject(const char* key, - Aws::String& data, - Aws::String& url, - Aws::String& error) const; - - bool PutObject(const char* key, - STREAM_PTR stream, - Aws::String& url, - Aws::String& error) const; - - bool PutObject(const char* key, - STREAM_PTR stream, - int length, - Aws::String& url, - Aws::String& error) const; - - bool DeleteObject(const char* key, - Aws::String& error) const; - - private: - Aws::String m_bucket; - std::shared_ptr m_s3Client; - std::shared_ptr m_limiter; - bool m_valid; - - static int GetStreamLength(STREAM_PTR stream); - }; -} // namespace News diff --git a/Code/Tools/News/NewsBuilder/UidGenerator.cpp b/Code/Tools/News/NewsBuilder/UidGenerator.cpp deleted file mode 100644 index 060f593996..0000000000 --- a/Code/Tools/News/NewsBuilder/UidGenerator.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 "UidGenerator.h" - -#include - -namespace News -{ - - UidGenerator::UidGenerator() - { - srand(static_cast(time(nullptr))); - } - - int UidGenerator::GenerateUid() - { - int uid; - do - { - uid = rand(); - } - while (std::find(m_uids.begin(), m_uids.end(), uid) != m_uids.end()); - m_uids.push_back(uid); - return uid; - } - - int UidGenerator::AddUid(int uid) - { - if (std::find(m_uids.begin(), m_uids.end(), uid) == m_uids.end()) - { - m_uids.push_back(uid); - } - return uid; - } - - void UidGenerator::RemoveUid(int uid) - { - auto it = std::find(m_uids.begin(), m_uids.end(), uid); - if (it != m_uids.end()) - { - m_uids.erase(it); - } - } - - void UidGenerator::Clear() - { - m_uids.clear(); - } - -} diff --git a/Code/Tools/News/NewsBuilder/UidGenerator.h b/Code/Tools/News/NewsBuilder/UidGenerator.h deleted file mode 100644 index 825df9e340..0000000000 --- a/Code/Tools/News/NewsBuilder/UidGenerator.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 News -{ - //! A simple unique id generator. - class UidGenerator - { - public: - UidGenerator(); - int GenerateUid(); - int AddUid(int uid); - void RemoveUid(int uid); - void Clear(); - - private: - std::vector m_uids; - }; -} diff --git a/Code/Tools/News/NewsBuilder/main.cpp b/Code/Tools/News/NewsBuilder/main.cpp deleted file mode 100644 index 6a43c681b1..0000000000 --- a/Code/Tools/News/NewsBuilder/main.cpp +++ /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 - * - */ - -#include -#include - -#include "Qt/NewsBuilder.h" -#include -#include -#include -#include - - -int main(int argc, char *argv[]) -{ - // Must be set before QApplication is initialized, so that we support HighDpi monitors, like the Retina displays - // on Windows 10 - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); - - QApplication a(argc, argv); - AZ::IO::FixedMaxPath engineRootPath; - { - AZ::ComponentApplication componentApplication; - auto settingsRegistry = AZ::SettingsRegistry::Get(); - settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder); - } - News::NewsBuilder w(nullptr, engineRootPath); - w.show(); - return a.exec(); -} diff --git a/Code/Tools/News/NewsBuilder/news_builder.qrc b/Code/Tools/News/NewsBuilder/news_builder.qrc deleted file mode 100644 index 010ac598f1..0000000000 --- a/Code/Tools/News/NewsBuilder/news_builder.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - Resources/NewsBuilder.qss - - diff --git a/Code/Tools/News/NewsBuilder/news_builder_files.cmake b/Code/Tools/News/NewsBuilder/news_builder_files.cmake deleted file mode 100644 index c46e66a357..0000000000 --- a/Code/Tools/News/NewsBuilder/news_builder_files.cmake +++ /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 -# -# - -set(FILES - main.cpp - S3Connector.cpp - S3Connector.h - UidGenerator.cpp - UidGenerator.h - EndpointManager.cpp - EndpointManager.h - Qt/ArticleDetails.cpp - Qt/ArticleDetails.h - Qt/ArticleDetails.ui - Qt/ArticleDetailsContainer.cpp - Qt/ArticleDetailsContainer.h - Qt/ArticleDetailsContainer.ui - Qt/AwsDialog.ui - Qt/BuilderArticleViewContainer.cpp - Qt/BuilderArticleViewContainer.h - Qt/BuilderArticleViewContainer.ui - Qt/EndpointEntryView.cpp - Qt/EndpointEntryView.h - Qt/EndpointEntryView.ui - Qt/EndpointManagerView.cpp - Qt/EndpointManagerView.h - Qt/EndpointManagerView.ui - Qt/ImageItem.cpp - Qt/ImageItem.h - Qt/ImageItem.ui - Qt/LogContainer.cpp - Qt/LogContainer.h - Qt/LogContainer.ui - Qt/NewsBuilder.cpp - Qt/NewsBuilder.h - Qt/Newsbuilder.qrc - Qt/Newsbuilder.ui - Qt/QCustomMessageBox.cpp - Qt/QCustomMessageBox.h - Qt/QCustomMessageBox.ui - Qt/SelectImage.cpp - Qt/SelectImage.h - Qt/SelectImage.ui - ResourceManagement/BuilderResourceManifest.cpp - ResourceManagement/BuilderResourceManifest.h - ResourceManagement/DeleteDescriptor.cpp - ResourceManagement/DeleteDescriptor.h - ResourceManagement/ImageDescriptor.cpp - ResourceManagement/ImageDescriptor.h - ResourceManagement/UploadDescriptor.cpp - ResourceManagement/UploadDescriptor.h -) - -set(SKIP_UNITY_BUILD_INCLUSION_FILES - # Fix for unity causing the 'News::BuilderResourceManifest::UpdateResourceA' symbol to be unresolved - Qt/ArticleDetails.cpp - # Fix for unity causing the ' Aws::S3::S3Client::GetObjectA' symbol to be unresolved - S3Connector.cpp - -) diff --git a/Code/Tools/News/NewsShared/ErrorCodes.h b/Code/Tools/News/NewsShared/ErrorCodes.h deleted file mode 100644 index 444e0c6f67..0000000000 --- a/Code/Tools/News/NewsShared/ErrorCodes.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 - -namespace News -{ - enum class ErrorCode : int - { - None, - OutOfSync, - ManifestDownloadFail, - FailedToSync, - AlreadySyncing, - FailedToParseManifest, - MissingArticle, - NoEndpoint, - ManifestUploadFail, - S3Fail - }; - - inline extern const char* GetErrorMessage(ErrorCode errorCode) - { - static const char* errors[] - { - "", - "Your manifest is out of sync. Reopen the same endpoint and sync to resolve the conflict and try again.", - "Failed to download resource manifest", - "Failed to sync resources", - "Sync is already running", - "Failed to parse resource manifest", - "Could not find article, try syncing again", - "Missing or incorrect endpoint selected", - "Failed to upload resource manifest", - "Failed to init S3 connection" - }; - int errorCount = sizeof errors / sizeof errors[0]; - int typeIndex = static_cast(errorCode); - if (typeIndex < 0 || typeIndex >= errorCount) - { - return "Invalid error code"; - } - return errors[typeIndex]; - } -} // namespace News diff --git a/Code/Tools/News/NewsShared/LogType.h b/Code/Tools/News/NewsShared/LogType.h deleted file mode 100644 index 92834adc58..0000000000 --- a/Code/Tools/News/NewsShared/LogType.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 News { - enum LogType - { - LogOk, - LogInfo, - LogError, - LogWarning - }; -} // namespace News diff --git a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.cpp b/Code/Tools/News/NewsShared/Qt/ArticleErrorView.cpp deleted file mode 100644 index 6f2a7e3c9c..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.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 "ArticleErrorView.h" -#include "NewsShared/Qt/ui_ArticleErrorView.h" - -using namespace News; - -ArticleErrorView::ArticleErrorView( - QWidget* parent) - : QWidget(parent) - , m_ui(new Ui::ArticleErrorViewWidget()) -{ - m_ui->setupUi(this); -} - -ArticleErrorView::~ArticleErrorView(){} - -#include "NewsShared/Qt/moc_ArticleErrorView.cpp" diff --git a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.h b/Code/Tools/News/NewsShared/Qt/ArticleErrorView.h deleted file mode 100644 index 3130690dc1..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class ArticleErrorViewWidget; -} - -namespace AzQtComponents -{ - class ExtendedLabel; -} - -namespace News -{ - class ArticleErrorView - : public QWidget - { - Q_OBJECT - public: - ArticleErrorView(QWidget* parent); - ~ArticleErrorView(); - - private: - QScopedPointer m_ui; - }; -} diff --git a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui b/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui deleted file mode 100644 index c94c636720..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui +++ /dev/null @@ -1,239 +0,0 @@ - - - ArticleErrorViewWidget - - - - 0 - 0 - 192 - 228 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - ArticleView - - - background-color: none; text-align: left; - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - border: none; - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 14 - - - - - - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 14 - 20 - - - - - - - - 0 - - - - - - 160 - 90 - - - - - - - :/images/Resources/ErrorImage.jpg - - - - 160 - 90 - - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - 0 - 0 - - - - - Open Sans - 8 - 50 - false - - - - a { text-decoration: underline; color: red } - - - We couldn’t connect to the network or access our news database. To see the latest Open 3D Engine news, blogs, tutorials, and more, please visit the <a href="http://aws.amazon.com/lumberyard/">Lumberyard website</a>. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - true - - - Qt::LinksAccessibleByMouse - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 14 - 20 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - - - AzQtComponents::ExtendedLabel - QLabel -
AzQtComponents/Components/ExtendedLabel.h
-
-
- - - - -
diff --git a/Code/Tools/News/NewsShared/Qt/ArticleView.cpp b/Code/Tools/News/NewsShared/Qt/ArticleView.cpp deleted file mode 100644 index 082a29d38a..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleView.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "ArticleView.h" - -#include - -AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: '...' needs to have dll-interface to be used by clients of class '...' -#include "NewsShared/ResourceManagement/ArticleDescriptor.h" -#include "NewsShared/Qt/ui_ArticleView.h" -#include "NewsShared/Qt/ui_PinnedArticleView.h" -#include "NewsShared/ResourceManagement/ResourceManifest.h" -#include "NewsShared/ResourceManagement/Resource.h" - - -#include -#include -AZ_POP_DISABLE_WARNING - -using namespace News; - -ArticleView::ArticleView( - QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest) - : QWidget(parent) - , m_pArticle(new ArticleDescriptor(article)) - , m_manifest(manifest) - , m_icon(nullptr) -{ - -} - -void ArticleView::Update() -{ - Q_ASSERT(m_widgetImageFrame && m_widgetTitle && m_widgetBody); - - auto pResource = m_manifest.FindById(m_pArticle->GetResource().GetId()); - m_pArticle.reset(); - if (pResource) - { - m_pArticle = QSharedPointer(new ArticleDescriptor(*pResource)); - m_widgetTitle->setText(m_pArticle->GetTitle()); - m_widgetBody->setText(m_pArticle->GetBody()); - auto pImageResource = m_manifest.FindById(m_pArticle->GetImageId()); - if (pImageResource) - { - QPixmap pixmap; - if (pixmap.loadFromData(pImageResource->GetData())) - { - if (!m_icon) - { - m_icon = new AzQtComponents::ExtendedLabel(this); - m_icon->setStyleSheet("border: none;"); - m_icon->setAlignment(Qt::AlignCenter); - static_cast( - m_widgetImageFrame->layout())->insertWidget(0, m_icon); - connect(m_icon, &AzQtComponents::ExtendedLabel::clicked, this, &ArticleView::articleSelectedSlot); - } - m_icon->setPixmap(pixmap.scaled(m_widgetImageFrame->minimumWidth(), - m_widgetImageFrame->minimumHeight(), - Qt::KeepAspectRatioByExpanding)); - } - else - { - RemoveIcon(); - } - } - else - { - RemoveIcon(); - } - } -} - -void ArticleView::mousePressEvent([[maybe_unused]] QMouseEvent* event) -{ - articleSelectedSlot(); -} - -void ArticleView::RemoveIcon() -{ - if (m_icon) - { - delete m_icon; - m_icon = nullptr; - } -} - -void ArticleView::linkActivatedSlot(const QString& link) -{ - QDesktopServices::openUrl(QUrl(link)); - Q_EMIT linkActivatedSignal(link); -} - -void ArticleView::articleSelectedSlot() -{ - Q_EMIT articleSelectedSignal(m_pArticle->GetResource().GetId()); -} - -QSharedPointer ArticleView::GetArticle() const -{ - return m_pArticle; -} - -void ArticleView::SetupViewWidget(QFrame* widgetImageFrame, AzQtComponents::ExtendedLabel* widgetTitle, AzQtComponents::ExtendedLabel* widgetBody) -{ - Q_ASSERT(m_widgetImageFrame == nullptr && m_widgetTitle == nullptr && m_widgetBody == nullptr); - - m_widgetImageFrame = widgetImageFrame; - m_widgetTitle = widgetTitle; - m_widgetBody = widgetBody; - - connect(m_widgetTitle, &QLabel::linkActivated, this, &ArticleView::linkActivatedSlot); - connect(m_widgetBody, &QLabel::linkActivated, this, &ArticleView::linkActivatedSlot); - connect(m_widgetTitle, &AzQtComponents::ExtendedLabel::clicked, this, &ArticleView::articleSelectedSlot); - connect(m_widgetBody, &AzQtComponents::ExtendedLabel::clicked, this, &ArticleView::articleSelectedSlot); - - Q_ASSERT(m_widgetImageFrame && m_widgetTitle && m_widgetBody); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// ArticleViewDefaultWidget -//////////////////////////////////////////////////////////////////////////////////////////////////// -ArticleViewDefaultWidget::ArticleViewDefaultWidget(QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest) - : ArticleView(parent, article, manifest) - , m_ui(new Ui::ArticleViewWidget()) -{ - m_ui->setupUi(this); - SetupViewWidget(m_ui->imageFrame, m_ui->titleLabel, m_ui->bodyLabel); - Update(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// ArticleViewPinnedWidget -//////////////////////////////////////////////////////////////////////////////////////////////////// -ArticleViewPinnedWidget::ArticleViewPinnedWidget(QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest) - : ArticleView(parent, article, manifest) - , m_ui(new Ui::PinnedArticleViewWidget()) -{ - m_ui->setupUi(this); - SetupViewWidget(m_ui->imageFrame, m_ui->titleLabel, m_ui->bodyLabel); - Update(); -} - -#include "NewsShared/Qt/moc_ArticleView.cpp" diff --git a/Code/Tools/News/NewsShared/Qt/ArticleView.h b/Code/Tools/News/NewsShared/Qt/ArticleView.h deleted file mode 100644 index 16a29732f0..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleView.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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class ArticleViewWidget; - class PinnedArticleViewWidget; -} - -namespace AzQtComponents -{ - class ExtendedLabel; -} - -class QFrame; - -namespace News -{ - class ArticleDescriptor; - class ResourceManifest; - - class ArticleView - : public QWidget - { - Q_OBJECT - public: - ArticleView(QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest); - ~ArticleView() = default; - - void Update(); - QSharedPointer GetArticle() const; - - Q_SIGNALS: - void articleSelectedSignal(QString resourceId); - void linkActivatedSignal(const QString& link); - - protected: - void SetupViewWidget(QFrame* widgetImageFrame, AzQtComponents::ExtendedLabel* widgetTitle, AzQtComponents::ExtendedLabel* widgetBody); - void mousePressEvent(QMouseEvent* event); - - private: - - QFrame* m_widgetImageFrame = nullptr; - AzQtComponents::ExtendedLabel* m_widgetTitle = nullptr; - AzQtComponents::ExtendedLabel* m_widgetBody = nullptr; - AzQtComponents::ExtendedLabel* m_icon = nullptr; - - QSharedPointer m_pArticle; - const ResourceManifest& m_manifest; - - void RemoveIcon(); - - private Q_SLOTS: - void linkActivatedSlot(const QString& link); - void articleSelectedSlot(); - }; - - class ArticleViewDefaultWidget : public ArticleView - { - public: - ArticleViewDefaultWidget(QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest); - ~ArticleViewDefaultWidget() = default; - - private: - Ui::ArticleViewWidget* m_ui = nullptr; - }; - - class ArticleViewPinnedWidget : public ArticleView - { - public: - ArticleViewPinnedWidget(QWidget* parent, - const ArticleDescriptor& article, - const ResourceManifest& manifest); - ~ArticleViewPinnedWidget() = default; - - private: - Ui::PinnedArticleViewWidget* m_ui = nullptr; - }; -} diff --git a/Code/Tools/News/NewsShared/Qt/ArticleView.ui b/Code/Tools/News/NewsShared/Qt/ArticleView.ui deleted file mode 100644 index 67d1d8857b..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleView.ui +++ /dev/null @@ -1,244 +0,0 @@ - - - ArticleViewWidget - - - - 0 - 0 - 430 - 376 - - - - - 0 - 0 - - - - - 430 - 0 - - - - - 430 - 16777215 - - - - ArticleView - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - default - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 430 - 184 - - - - - 430 - 184 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 0 - 20 - - - - - - - - - 0 - 0 - - - - - Open Sans - 14 - 50 - false - - - - Title: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - false - - - Qt::LinksAccessibleByMouse - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 12 - - - - - - - - - 0 - 0 - - - - - Open Sans - 8 - 50 - false - - - - Body - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 0 - - - 0 - - - false - - - Qt::LinksAccessibleByMouse - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 0 - 24 - - - - - - - - - - - - AzQtComponents::ExtendedLabel - QLabel -
AzQtComponents/Components/ExtendedLabel.h
-
-
- - -
diff --git a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.cpp b/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.cpp deleted file mode 100644 index 1d718d1bb8..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.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 "ArticleViewContainer.h" -#include "ArticleView.h" -#include "NewsShared/ResourceManagement/ResourceManifest.h" -#include "NewsShared/ResourceManagement/ArticleDescriptor.h" -#include "NewsShared/ResourceManagement/Resource.h" -#include "NewsShared/Qt/ArticleErrorView.h" -#include "NewsShared/Qt/KeepInTouchView.h" -#include "NewsShared/Qt/ui_ArticleViewContainer.h" - -#include -#include - -namespace News -{ - - ArticleViewContainer::ArticleViewContainer(QWidget* parent, ResourceManifest& manifest) - : QWidget(parent) - , m_ui(new Ui::ArticleViewContainerWidget) - , m_manifest(manifest) - , m_loadingLabel(nullptr) - , m_errorMessage(nullptr) - { - m_ui->setupUi(this); - AddLoadingMessage(); - - m_keepInTouchViewWidget = new KeepInTouchView(this); - m_keepInTouchViewWidget->setVisible(false); - connect(m_keepInTouchViewWidget, &KeepInTouchView::linkActivatedSignal, - this, &ArticleViewContainer::linkActivatedSignal); - } - - ArticleViewContainer::~ArticleViewContainer() {} - - void ArticleViewContainer::PopulateArticles() - { - Clear(); - - bool articlesFound = false; - for (auto id : m_manifest.GetOrder()) - { - auto pResource = m_manifest.FindById(id); - if (pResource && pResource->GetType().compare("article") == 0) - { - AddArticleView(ArticleDescriptor(*pResource)); - articlesFound = true; - } - } - - if (!articlesFound) - { - AddErrorMessage(); - } - else - { - auto layout = static_cast(m_ui->articleViewContents->layout()); - layout->insertWidget(layout->count() - 1, m_keepInTouchViewWidget); - m_keepInTouchViewWidget->setVisible(true); - } - - qApp->processEvents(); - } - - ArticleView* ArticleViewContainer::FindById(const QString& id) - { - auto it = std::find_if( - m_articles.begin(), - m_articles.end(), - [id](ArticleView* articleView) -> bool - { - if (!articleView) - { - return false; - } - return articleView->GetArticle()->GetResource().GetId().compare(id) == 0; - }); - if (it == m_articles.end()) - { - return nullptr; - } - return *it; - } - - void ArticleViewContainer::AddArticleView(const ArticleDescriptor& articleDesc, int articlePosition) - { - ClearError(); - - ArticleView* view = CreateArticleView(articleDesc); - if (view == nullptr) - { - return; - } - - m_articles.append(view); - - connect(view, &ArticleView::articleSelectedSignal, - this, &ArticleViewContainer::articleSelectedSlot); - connect(view, &ArticleView::linkActivatedSignal, - this, &ArticleViewContainer::linkActivatedSignal); - - auto layout = static_cast(m_ui->articleViewContents->layout()); - if (articlePosition == -1) - { - articlePosition = layout->count() - 1; - } - - layout->insertWidget(articlePosition, view); - qApp->processEvents(); - } - - void ArticleViewContainer::DeleteArticleView(ArticleView* view) - { - m_articles.removeAll(view); - m_ui->articleViewContents->layout()->removeWidget(view); - delete view; - } - - void ArticleViewContainer::ForceRefreshArticleView(ArticleView* articleView) - { - if (articleView == nullptr) - { - return; - } - - QSharedPointer articleDesc = articleView->GetArticle(); - auto layout = static_cast(m_ui->articleViewContents->layout()); - const int viewIndex = layout->indexOf(articleView); - - DeleteArticleView(articleView); - AddArticleView(*articleDesc, viewIndex); - } - - void ArticleViewContainer::ScrollToView(ArticleView* view) const - { - m_ui->previewArea->ensureWidgetVisible(view); - } - - void ArticleViewContainer::ClearError() - { - //delete loading label - if (m_loadingLabel) - { - delete m_loadingLabel; - m_loadingLabel = nullptr; - } - - //delete error message - if (m_errorMessage) - { - delete m_errorMessage; - m_errorMessage = nullptr; - } - } - - void ArticleViewContainer::articleSelectedSlot(QString id) - { - emit articleSelectedSignal(id); - } - - void ArticleViewContainer::UpdateArticleOrder(ArticleView* view, bool direction) const - { - QVBoxLayout* layout = qobject_cast(m_ui->articleViewContents->layout()); - - const int index = layout->indexOf(view); - - if (direction && index == 0) - { - return; - } - - if (!direction && index == layout->count() - 2) - { - return; - } - - const int newIndex = direction ? index - 1 : index + 1; - layout->removeWidget(view); - layout->insertWidget(newIndex, view); - } - - void ArticleViewContainer::AddLoadingMessage() - { - if (m_errorMessage) - { - delete m_errorMessage; - m_errorMessage = nullptr; - } - - if (!m_loadingLabel) - { - m_loadingLabel = new QLabel(this); - m_loadingLabel->setText("Retrieving news..."); - auto layout = static_cast(m_ui->articleViewContents->layout()); - layout->insertWidget(0, m_loadingLabel); - } - } - - void ArticleViewContainer::AddErrorMessage() - { - if (m_loadingLabel) - { - delete m_loadingLabel; - m_loadingLabel = nullptr; - } - - if (!m_errorMessage) - { - m_errorMessage = new ArticleErrorView(this); - auto layout = static_cast(m_ui->articleViewContents->layout()); - layout->insertWidget(0, m_errorMessage); - } - } - - void ArticleViewContainer::Clear() - { - ClearError(); - - for (auto articleView : m_articles) - { - delete articleView; - } - - m_articles.clear(); - } - - ArticleViewContainer::ArticleStyle ArticleViewContainer::GetArticleStyleEnumFromString(const QString& articleStyleStr) const - { - static const QMap articleStyleStringEnumMap = { - { "default", ArticleStyle::Default }, - { "pinned", ArticleStyle::Pinned } - }; - - if (articleStyleStringEnumMap.contains(articleStyleStr) == false) - { - Q_ASSERT(false); - return ArticleStyle::Default; - } - - return articleStyleStringEnumMap.value(articleStyleStr); - } - - ArticleView* ArticleViewContainer::CreateArticleView(const ArticleDescriptor& articleDesc) - { - ArticleStyle articleStyle = GetArticleStyleEnumFromString(articleDesc.GetArticleStyle()); - - switch(articleStyle) - { - case ArticleStyle::Default: - return new ArticleViewDefaultWidget(this, articleDesc, m_manifest); - case ArticleStyle::Pinned: - return new ArticleViewPinnedWidget(this, articleDesc, m_manifest); - default: - Q_ASSERT(false); - return nullptr; - } - } - -} - -#include "NewsShared/Qt/moc_ArticleViewContainer.cpp" diff --git a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.h b/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.h deleted file mode 100644 index c0ae3b2701..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.h +++ /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 - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include "NewsShared/LogType.h" - -#include -#include -#endif - -class QLabel; - -namespace Ui -{ - class ArticleViewContainerWidget; -} - -namespace News -{ - class Resource; - class ArticleView; - class ArticleDescriptor; - class ResourceManifest; - class ArticleErrorView; - class KeepInTouchView; - - class ArticleViewContainer - : public QWidget - { - Q_OBJECT - - enum ArticleStyle - { - Default, - Pinned - }; - - public: - explicit ArticleViewContainer(QWidget* parent, ResourceManifest& manifest); - ~ArticleViewContainer(); - - virtual void PopulateArticles(); - ArticleView* FindById(const QString& id); - void AddArticleView(const ArticleDescriptor& articleDesc, int articlePosition = -1); - void DeleteArticleView(ArticleView* view); - void ForceRefreshArticleView(ArticleView* articleView); - void ScrollToView(ArticleView* view) const; - void UpdateArticleOrder(ArticleView* view, bool direction) const; - void AddLoadingMessage(); - void AddErrorMessage(); - void Clear(); - - Q_SIGNALS: - void articleSelectedSignal(QString resourceId); - void addArticle(Resource* article); - void logSignal(QString text, LogType logType = LogInfo); - void scrolled(); - void linkActivatedSignal(const QString& link); - - private: - QScopedPointer m_ui; - QList m_articles; - ResourceManifest& m_manifest; - QLabel* m_loadingLabel; - ArticleErrorView* m_errorMessage; - KeepInTouchView* m_keepInTouchViewWidget = nullptr; - - void ClearError(); - ArticleStyle GetArticleStyleEnumFromString(const QString& articleStyleStr) const; - ArticleView* CreateArticleView(const ArticleDescriptor& articleDesc); - - private Q_SLOTS: - virtual void articleSelectedSlot(QString id); - }; -} diff --git a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.ui b/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.ui deleted file mode 100644 index dfb71ea31f..0000000000 --- a/Code/Tools/News/NewsShared/Qt/ArticleViewContainer.ui +++ /dev/null @@ -1,104 +0,0 @@ - - - ArticleViewContainerWidget - - - - 0 - 0 - 606 - 753 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - 0 - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - true - - - Qt::AlignHCenter|Qt::AlignTop - - - - - 0 - 0 - 589 - 753 - - - - - 16 - - - 15 - - - 15 - - - 15 - - - 15 - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - - - - - diff --git a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.cpp b/Code/Tools/News/NewsShared/Qt/KeepInTouchView.cpp deleted file mode 100644 index 43c32c43fc..0000000000 --- a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "KeepInTouchView.h" -#include "NewsShared/Qt/ui_KeepInTouchView.h" - -#include -#include -#include -#include - -namespace News -{ - KeepInTouchView::KeepInTouchView(QWidget* parent) - : QWidget(parent) - , m_ui(new Ui::KeepInTouchViewWidget()) - { - m_ui->setupUi(this); - - m_ui->twich_container->setCursor(Qt::PointingHandCursor); - m_ui->twitter_container->setCursor(Qt::PointingHandCursor); - m_ui->youtube_container->setCursor(Qt::PointingHandCursor); - m_ui->facebook_container->setCursor(Qt::PointingHandCursor); - - m_ui->twich_container->installEventFilter(this); - m_ui->twitter_container->installEventFilter(this); - m_ui->youtube_container->installEventFilter(this); - m_ui->facebook_container->installEventFilter(this); - } - - bool KeepInTouchView::eventFilter(QObject *watched, QEvent *event) - { - if (event->type() == QEvent::MouseButtonRelease) - { - if (watched == m_ui->twich_container) - { - return LaunchSocialMediaUrl(SocialMediaType::Twitch); - } - else if (watched == m_ui->twitter_container) - { - return LaunchSocialMediaUrl(SocialMediaType::Twitter); - } - else if (watched == m_ui->youtube_container) - { - return LaunchSocialMediaUrl(SocialMediaType::YouTube); - } - else if (watched == m_ui->facebook_container) - { - return LaunchSocialMediaUrl(SocialMediaType::Facebook); - } - } - - return QWidget::eventFilter(watched, event); - } - - bool KeepInTouchView::LaunchSocialMediaUrl(SocialMediaType type) - { - static const QMap socialMediaTypeToUrlMap = - { - { SocialMediaType::Twitch, m_twitchUrl }, - { SocialMediaType::Twitter, m_twitterUrl }, - { SocialMediaType::YouTube, m_youtubeUrl }, - { SocialMediaType::Facebook, m_facebookUrl } - }; - - if (socialMediaTypeToUrlMap.contains(type) == false) - { - return false; - } - - QString link = socialMediaTypeToUrlMap[type]; - Q_EMIT linkActivatedSignal(link); - - return QDesktopServices::openUrl(QUrl(link)); - } -} - -#include "NewsShared/Qt/moc_KeepInTouchView.cpp" diff --git a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.h b/Code/Tools/News/NewsShared/Qt/KeepInTouchView.h deleted file mode 100644 index 5d5c6a9e36..0000000000 --- a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class KeepInTouchViewWidget; -} - -namespace News -{ - class KeepInTouchView - : public QWidget - { - Q_OBJECT - - enum class SocialMediaType - { - Twitch, - Twitter, - YouTube, - Facebook - }; - - public: - KeepInTouchView(QWidget* parent); - ~KeepInTouchView() = default; - - bool eventFilter(QObject *watched, QEvent *event); - - Q_SIGNALS: - void linkActivatedSignal(const QString& link); - - private: - bool LaunchSocialMediaUrl(SocialMediaType type); - - Ui::KeepInTouchViewWidget* m_ui = nullptr; - - const char* m_twitchUrl = "https://docs.aws.amazon.com/console/lumberyard/twitch"; - const char* m_twitterUrl = "https://docs.aws.amazon.com/console/lumberyard/twitter"; - const char* m_youtubeUrl = "https://docs.aws.amazon.com/console/lumberyard/youtube"; - const char* m_facebookUrl = "https://docs.aws.amazon.com/console/lumberyard/facebook"; - }; -} diff --git a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.ui b/Code/Tools/News/NewsShared/Qt/KeepInTouchView.ui deleted file mode 100644 index 076059f49d..0000000000 --- a/Code/Tools/News/NewsShared/Qt/KeepInTouchView.ui +++ /dev/null @@ -1,423 +0,0 @@ - - - KeepInTouchViewWidget - - - - 0 - 0 - 430 - 336 - - - - - 0 - 0 - - - - - 430 - 0 - - - - - 430 - 16777215 - - - - ArticleView - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 430 - 184 - - - - - 430 - 184 - - - - - - - :/images/Resources/KeepInTouchBanner.jpg - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 0 - 20 - - - - - - - - - 0 - 0 - - - - - Open Sans - 14 - 50 - false - - - - Keep in touch! - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - false - - - Qt::LinksAccessibleByMouse - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 12 - - - - - - - - - 0 - 0 - - - - - Open Sans - 8 - 50 - false - - - - Want to know the latest news at AmazonGameDev? Sign up for our newsletter and use the following links to find us! - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 0 - - - 0 - - - false - - - Qt::LinksAccessibleByMouse - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - background: transparent; - - - - 20 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 8 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - :/images/Resources/icon_twitch.png - - - - - - - Twitch - - - - - - - - - - - 0 - 0 - - - - - 8 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - :/images/Resources/icon_twitter.png - - - - - - - Twitter - - - - - - - - - - - 0 - 0 - - - - - 8 - - - 0 - - - 0 - - - 0 - - - - - - - - :/images/Resources/icon_youtube.png - - - - - - - Youtube - - - - - - - - - - - 8 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - :/images/Resources/icon_facebook.png - - - - - - - Facebook - - - - - - - - - - - - - - - - - AzQtComponents::ExtendedLabel - QLabel -
AzQtComponents/Components/ExtendedLabel.h
-
-
- - - - -
diff --git a/Code/Tools/News/NewsShared/Qt/NewsShared.qrc b/Code/Tools/News/NewsShared/Qt/NewsShared.qrc deleted file mode 100644 index 8d5b84494b..0000000000 --- a/Code/Tools/News/NewsShared/Qt/NewsShared.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - ../Resources/ErrorImage.jpg - ../Resources/KeepInTouchBanner.jpg - ../Resources/icon_facebook.png - ../Resources/icon_twitch.png - ../Resources/icon_twitter.png - ../Resources/icon_youtube.png - - diff --git a/Code/Tools/News/NewsShared/Qt/PinnedArticleView.ui b/Code/Tools/News/NewsShared/Qt/PinnedArticleView.ui deleted file mode 100644 index 928046a064..0000000000 --- a/Code/Tools/News/NewsShared/Qt/PinnedArticleView.ui +++ /dev/null @@ -1,260 +0,0 @@ - - - PinnedArticleViewWidget - - - - 0 - 0 - 430 - 376 - - - - - 0 - 0 - - - - - 430 - 0 - - - - - 430 - 16777215 - - - - ArticleView - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - pinned - - - - 12 - - - 16 - - - 16 - - - 16 - - - 16 - - - - - - 128 - 0 - - - - - 128 - 16777215 - - - - background-color: transparent; - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 128 - 96 - - - - - 128 - 96 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - - - background-color: transparent; - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - Open Sans - 14 - 50 - false - - - - Title: - - - true - - - false - - - Qt::LinksAccessibleByMouse - - - sectionTitle - - - - - - - - 0 - 0 - - - - - Open Sans - 8 - 50 - false - - - - Body - - - true - - - false - - - Qt::LinksAccessibleByMouse - - - - - - - - - - - - - - AzQtComponents::ExtendedLabel - QLabel -
AzQtComponents/Components/ExtendedLabel.h
-
-
- - -
diff --git a/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.cpp b/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.cpp deleted file mode 100644 index c26d2357d7..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.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 "ArticleDescriptor.h" -#include "Resource.h" - -#include -#include - -using namespace News; - -ArticleDescriptor::ArticleDescriptor( - Resource& resource) - : JsonDescriptor(resource) - , m_imageId(m_json["image"].toString()) - , m_title(m_json["title"].toString()) - , m_body(m_json["body"].toString()) - , m_order(m_json["order"].toInt()) -{ - if (m_json.contains("articleStyle") == true) - { - m_articleStyle = m_json["articleStyle"].toString(); - } -} - -void ArticleDescriptor::Update() const -{ - QJsonObject json; - json["image"] = m_imageId; - json["title"] = m_title; - json["body"] = m_body; - json["order"] = m_order; - json["articleStyle"] = m_articleStyle; - QJsonDocument doc(json); - QByteArray data = doc.toJson(QJsonDocument::Compact).toStdString().data(); - m_resource.SetData(data); -} - -const QString& ArticleDescriptor::GetArticleStyle() const -{ - return m_articleStyle; -} - -void ArticleDescriptor::SetArticleStyle(const QString& style) -{ - m_articleStyle = style; -} - -const QString& ArticleDescriptor::GetImageId() const -{ - return m_imageId; -} - -void ArticleDescriptor::SetImageId(const QString& imageId) -{ - m_imageId = imageId; -} - -const QString& ArticleDescriptor::GetTitle() const -{ - return m_title; -} - -void ArticleDescriptor::SetTitle(const QString& title) -{ - m_title = title; -} - -const QString& ArticleDescriptor::GetBody() const -{ - return m_body; -} - -void ArticleDescriptor::SetBody(const QString& body) -{ - m_body = body; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.h b/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.h deleted file mode 100644 index c0ca459cf4..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/ArticleDescriptor.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 "JsonDescriptor.h" - -#include - -namespace News -{ - class Resource; - - //! ArticleDescriptor represents Resource as an article - class ArticleDescriptor - : public JsonDescriptor - { - public: - explicit ArticleDescriptor(Resource& resource); - - //! If article was modified, call this to update resource data - void Update() const; - - const QString& GetArticleStyle() const; - - void SetArticleStyle(const QString& style); - - const QString& GetImageId() const; - - void SetImageId(const QString& imageId); - - const QString& GetTitle() const; - - void SetTitle(const QString& title); - - const QString& GetBody() const; - - void SetBody(const QString& body); - - private: - QString m_articleStyle = "default"; - QString m_imageId; - QString m_title; - QString m_body; - int m_order; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.cpp b/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.cpp deleted file mode 100644 index 0d21a18c05..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.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 "Descriptor.h" - -using namespace News; - -Descriptor::Descriptor(Resource& resource) - : m_resource(resource) {} - -Descriptor::~Descriptor() {} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.h b/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.h deleted file mode 100644 index 3d56037543..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/Descriptor.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 - -namespace News -{ - class Resource; - - //! Descriptor is a simple solution to add additional functionality to a Resource - /*! - Some descriptors can only work with certain resource types, like AerticleDescriptor - */ - class Descriptor - { - public: - explicit Descriptor(Resource& resource); - virtual ~Descriptor(); - - Resource& GetResource() const - { - return m_resource; - } - - protected: - Resource& m_resource; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.cpp b/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.cpp deleted file mode 100644 index 5e71c8f10b..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.cpp +++ /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 - * - */ - -#include "JsonDescriptor.h" -#include "Resource.h" - -#include - -using namespace News; - -JsonDescriptor::JsonDescriptor(Resource& resource) - : Descriptor(resource) - , m_doc(QJsonDocument::fromJson(m_resource.GetData())) - , m_json(m_doc.object()) -{ -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.h b/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.h deleted file mode 100644 index 286e66c4ac..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/JsonDescriptor.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 "Descriptor.h" - -#include -#include - -namespace News -{ - //! JsonDescriptor assumes Resource is a JSON file - class JsonDescriptor - : public Descriptor - { - public: - explicit JsonDescriptor(Resource& resource); - - protected: - QJsonDocument m_doc; - QJsonObject m_json; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.cpp b/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.cpp deleted file mode 100644 index e70285fd31..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "QtDownloadManager.h" -#include "QtDownloader.h" - -namespace News -{ - -QtDownloadManager::QtDownloadManager() - : QObject() - , m_worker(new QtDownloader) // this will start the thread which does downloads -{ - // make sure the response handlers are queued connections as the worker runs in a different thread - connect(m_worker, &QtDownloader::failed, this, &QtDownloadManager::failedReply, Qt::QueuedConnection); - connect(m_worker, &QtDownloader::successfullyFinished, this, &QtDownloadManager::successfulReply, Qt::QueuedConnection); -} - -QtDownloadManager::~QtDownloadManager() -{ - // NOTE: we don't delete the QtDownloader; it deletes itself. - // We just tell it to stop - m_worker->Finish(); -} - -void QtDownloadManager::Download(const QString& url, - std::function downloadSuccessCallback, - std::function downloadFailCallback) -{ - int downloadId = m_worker->Download(url); - m_downloads[downloadId] = { downloadSuccessCallback, downloadFailCallback }; -} - -void QtDownloadManager::Abort() -{ - m_worker->Abort(); - m_downloads.clear(); -} - -void QtDownloadManager::successfulReply(int downloadId, QByteArray data) -{ - m_downloads[downloadId].downloadSuccessCallback(data); - m_downloads.remove(downloadId); -} - -void QtDownloadManager::failedReply(int downloadId) -{ - m_downloads[downloadId].downloadFailCallback(); - m_downloads.remove(downloadId); -} - -} // namespace News - -#include "NewsShared/ResourceManagement/moc_QtDownloadManager.cpp" diff --git a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.h b/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.h deleted file mode 100644 index 6a7c93a51f..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloadManager.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 -#include -#endif - -namespace News -{ - class QtDownloader; - - //! QtDownloadManager handles multiple asynchronous downloads - class QtDownloadManager - : public QObject - { - Q_OBJECT - public: - QtDownloadManager(); - ~QtDownloadManager(); - - //! Asynchronously download a file from the input url and return it as QByteArray via the success callback - /*! - \param url - file url to download - \param downloadSuccessCallback - if download is successful pass file's data as QByteArray - \param downloadFailCallback - if download failed, pass error message - */ - void Download(const QString& url, - std::function downloadSuccessCallback, - std::function downloadFailCallback); - - //! Aborts all currently active downloads. Success/failure callbacks will not be called. - void Abort(); - - private: - void successfulReply(int downloadId, QByteArray data); - void failedReply(int downloadId); - - QtDownloader* m_worker = nullptr; - - struct DownloadResponses - { - std::function downloadSuccessCallback; - std::function downloadFailCallback; - }; - QMap m_downloads; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.cpp b/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.cpp deleted file mode 100644 index 0139ec5344..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.cpp +++ /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 - * - */ - -#include "QtDownloader.h" - -#include -#include -#include -#include - - -namespace News -{ - QtDownloader::QtDownloader() - : m_thread(new QThread()) - { - // make sure that everything that QObject::connects to us knows we're running in a different thread - moveToThread(m_thread); - - // handle clean up of both ourselves and of our thread. - // We manage thread clean up so that it can keep running and be cleaned up later, regardless of what - // the thing that created the QtDownloader does - connect(m_thread, &QThread::finished, m_thread, [this] { - m_thread->deleteLater(); - deleteLater(); - }); - - auto abortDownloadsHandler = [this] { - auto replies = m_downloads.keys(); - for (QNetworkReply* reply : replies) - { - reply->abort(); - } - - m_downloads.clear(); - }; - - auto queueDownloadHandler = [this](int downloadId, QString url) { - if (m_networkManager) - { - QNetworkReply* reply = m_networkManager->get(QNetworkRequest(QUrl(url))); - m_downloads.insert(reply, downloadId); - } - }; - - auto createNetworkManagerHandler = [this] { - m_networkManager = new QNetworkAccessManager; - connect(m_networkManager, &QNetworkAccessManager::finished, this, &QtDownloader::downloadFinished); - }; - - auto deleteNetworkManagerHandler = [this] { - delete m_networkManager; - m_networkManager = nullptr; - }; - - auto quitHandler = [this] { - // call quit via this callback, so that it executes in the running thread. - // QThread::quit() is actually blocking and waits until everything finishes, so - // we don't want to call it in the main thread - m_thread->quit(); - }; - - // make sure the response handlers are queued connections as the worker runs in one thread, but these triggers - // will be emitted from the main thread - connect(this, &QtDownloader::triggerAbortAll, this, abortDownloadsHandler, Qt::QueuedConnection); - connect(this, &QtDownloader::triggerDownload, this, queueDownloadHandler, Qt::QueuedConnection); - connect(this, &QtDownloader::triggerQuit, this, quitHandler, Qt::QueuedConnection); - - // create/delete the QNetworkAccessManager in our thread, to ensure that any slowdowns caused by - // having to create network connectors / load drivers are done in our non-ui thread. - // make sure that these connections are direct so that network requests can't predate the network engine itself - connect(m_thread, &QThread::started, this, createNetworkManagerHandler, Qt::DirectConnection); - connect(m_thread, &QThread::finished, this, deleteNetworkManagerHandler, Qt::DirectConnection); - - m_thread->start(); - } - - QtDownloader::~QtDownloader() - { - } - - int QtDownloader::Download(const QString& url) - { - // create a unique id for this download - int downloadId = m_lastId++; - - // trigger a download running in our worker thread - Q_EMIT triggerDownload(downloadId, url); - - return downloadId; - } - - void QtDownloader::Abort() - { - // trigger an abort in our worker thread - Q_EMIT triggerAbortAll(); - } - - void QtDownloader::Finish() - { - // trigger a quit in our worker thread - Q_EMIT triggerQuit(); - } - - void QtDownloader::downloadFinished(QNetworkReply* reply) - { - // Note: this will run in our worker thread - int downloadId = m_downloads[reply]; - - // emit the signal back to the main thread indicating that we're finished, either - // successfully or unsuccessfully - if (reply->error() == QNetworkReply::NoError) - { - Q_EMIT successfullyFinished(downloadId, reply->readAll()); - } - else - { - Q_EMIT failed(downloadId); - } - - // clean up the reply; have to do this later, according to the Qt docs - reply->deleteLater(); - - // make sure to remove our reference to this reply from our list of active downloads - m_downloads.remove(reply); - } - - #include "NewsShared/ResourceManagement/moc_QtDownloader.cpp" -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.h b/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.h deleted file mode 100644 index 0dcc86e951..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/QtDownloader.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 - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#endif - -class QNetworkAccessManager; -class QNetworkReply; -class QThread; - -namespace News -{ - //! QtDownloader is a wrapper around Qt's file download functions - /*! - The QtDownloader spins up another thread and does all downloads in that thread. - The public slot methods (Finish, Download and Abort) can all be called from any thread. - The response signals (successfullyFinished and failed) should be QObject::connect to with - Qt::QueuedConnection, as they will be emitted from the worker thread. - */ - class QtDownloader - : public QObject - { - Q_OBJECT - - public: - QtDownloader(); - ~QtDownloader(); - - public Q_SLOTS: - void Finish(); - - int Download(const QString& url); - void Abort(); - - Q_SIGNALS: - void successfullyFinished(int downloadId, QByteArray data); - void failed(int downloadId); - - // *********************************************** - // private - DO NOT CONNECT TO outside of the class! - // (qt signals can't be made private) - void triggerAbortAll(); - void triggerDownload(int downloadId, QString url); - void triggerQuit(); - // *********************************************** - - private: - void downloadFinished(QNetworkReply* reply); - - int m_lastId = 0; - - QMap m_downloads; - QNetworkAccessManager* m_networkManager = nullptr; - QThread* m_thread; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/Resource.cpp b/Code/Tools/News/NewsShared/ResourceManagement/Resource.cpp deleted file mode 100644 index d40b66d6d7..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/Resource.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 "Resource.h" - -#include - -using namespace News; - -Resource::Resource(const QJsonObject& json) - : Resource( - json["id"].toString(), - QByteArray(), - json["url"].toString(), - json["type"].toString(), - json["refCount"].toInt(), - json["version"].toInt()) {} - -Resource::Resource(const QString& id, const QString& type) - : Resource( - id, - QByteArray(), - "", - type, - 1, - 0) {} - -Resource::Resource(const QString& id, - const QByteArray& data, - [[maybe_unused]] const QString& url, - const QString& type, - int refCount, - int version) - : m_id(id) - , m_data(data) - , m_type(type) - , m_refCount(refCount) - , m_version(version) {} - -Resource::~Resource() {} - -void Resource::Write(QJsonObject& json) const -{ - json["id"] = m_id; - json["type"] = m_type; - json["refCount"] = m_refCount; - json["version"] = m_version; -} - -QString Resource::GetId() const -{ - return m_id; -} - -void Resource::SetId(const QString& id) -{ - m_id = id; -} - -QByteArray Resource::GetData() const -{ - return m_data; -} - -void Resource::SetData(QByteArray data) -{ - m_data = data; -} - -QString Resource::GetType() const -{ - return m_type; -} - -int Resource::GetRefCount() const -{ - return m_refCount; -} - -void Resource::SetRefCount(int refCount) -{ - m_refCount = refCount; -} - -int Resource::GetVersion() const -{ - return m_version; -} - -void Resource::SetVersion(int version) -{ - m_version = version; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/Resource.h b/Code/Tools/News/NewsShared/ResourceManagement/Resource.h deleted file mode 100644 index 1174fea788..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/Resource.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 - -#include - -class QJsonObject; - -namespace News -{ - class Descriptor; - - //! Resource is a central element of in-editor messages - //! It represents articles, images, and anything else that is part of news feed - class Resource - { - public: - //! resources are stored as json objects in \ref News::ResourceManifest - //! this creates resource with empty data array, that can be downloaded later - //! by calling News::ResourceManifest::Sync - explicit Resource(const QJsonObject& json); - - explicit Resource(const QString& id, - const QString& type); - - Resource(const QString& id, - const QByteArray& data, - const QString& url, - const QString& type, - int refCount, - int version); - - ~Resource(); - - //! Saves resource's description to a json file - void Write(QJsonObject& json) const; - - QString GetId() const; - - void SetId(const QString& id); - - QByteArray GetData() const; - - void SetData(QByteArray data); - - QString GetType() const; - - int GetRefCount() const; - - void SetRefCount(int refCount); - - int GetVersion() const; - - void SetVersion(int version); - - private: - QString m_id; - QByteArray m_data; - QString m_type; - int m_refCount; - int m_version; - }; -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.cpp b/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.cpp deleted file mode 100644 index 969c4ec8f1..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "ResourceManifest.h" -#include "NewsShared/ResourceManagement/QtDownloadManager.h" -#include "NewsShared/ResourceManagement/Resource.h" -#include "NewsShared/ResourceManagement/ArticleDescriptor.h" - -#include -#include -#include -#include -#include - -namespace News -{ - - const QString ResourceManifest::MANIFEST_NAME = "resourceManifest"; - bool ResourceManifest::s_syncing = false; - - ResourceManifest::ResourceManifest( - std::function syncSuccessCallback, - std::function syncFailCallback, - std::function syncUpdateCallback) - : m_downloader(new QtDownloadManager) - , m_syncSuccessCallback(syncSuccessCallback) - , m_syncFailCallback(syncFailCallback) - , m_syncUpdateCallback(syncUpdateCallback) - { - } - - ResourceManifest::~ResourceManifest() - { - // clean everything up - DeleteResources(); - - delete m_downloader; - } - - Resource* ResourceManifest::FindById(const QString& id) const - { - return FindById(id, m_resources); - } - - Resource* ResourceManifest::FindById(const QString& id, const QList& resources) - { - auto it = std::find_if( - resources.begin(), - resources.end(), - [id](Resource* resource) -> bool - { - return resource->GetId().compare(id) == 0; - }); - if (it == resources.end()) - { - return nullptr; - } - return *it; - } - - Resource* ResourceManifest::FindById(const QString& id, - const QStack& resources) - { - auto it = std::find_if( - resources.begin(), - resources.end(), - [id](Resource* resource) -> bool - { - return resource->GetId().compare(id) == 0; - }); - if (it == resources.end()) - { - return nullptr; - } - return *it; - } - - void ResourceManifest::Sync() - { - if (s_syncing) - { - FailSync(ErrorCode::AlreadySyncing); - return; - } - s_syncing = true; - m_failed = false; - - m_syncUpdateCallback("Starting sync", LogInfo); - - ReadConfig(); - - // first download the manifest json - m_syncUpdateCallback("Downloading manifest", LogInfo); - m_downloader->Download(QString(m_url).append(MANIFEST_NAME), - std::bind(&ResourceManifest::OnDownloadSuccess, this, std::placeholders::_1), - std::bind(&ResourceManifest::OnDownloadFail, this)); - } - - void ResourceManifest::Abort() - { - m_aborted = true; - m_downloader->Abort(); - } - - void ResourceManifest::Reset() - { - if (s_syncing) - { - m_syncUpdateCallback("Sync is already running", LogError); - return; - } - - m_aborted = false; - m_failed = false; - m_version = -1; - - DeleteResources(); - - m_order.clear(); - } - - QList::const_iterator ResourceManifest::begin() const - { - return m_resources.constBegin(); - } - - QList::const_iterator ResourceManifest::end() const - { - return m_resources.constEnd(); - } - - QList ResourceManifest::GetOrder() const - { - return m_order; - } - - void ResourceManifest::OnDownloadSuccess(QByteArray data) - { - QJsonDocument doc(QJsonDocument::fromJson(data)); - if (doc.isNull()) - { - FailSync(ErrorCode::FailedToParseManifest); - return; - } - - ErrorCode error = Read(doc.object()); - if (error != ErrorCode::None) - { - FailSync(error); - return; - } - - // check how many resources to sync - PrepareForSync(); - // if there is anything to sync, do that - if (m_syncLeft > 0) - { - m_syncUpdateCallback("Syncing resources", LogInfo); - SyncResources(); - } - // otherwise just finish sync - else - { - m_syncUpdateCallback("No new resources to sync", LogInfo); - FinishSync(); - } - } - - void ResourceManifest::OnDownloadFail() - { - FailSync(ErrorCode::ManifestDownloadFail); - } - - ErrorCode ResourceManifest::Read(const QJsonObject& json) - { - m_version = json["version"].toInt(); - QJsonArray resourceArray = json["resources"].toArray(); - // initially mark ALL existing resource for deletion - QList toDelete = m_resources; - - for (auto resourceDoc : resourceArray) - { - auto pNewResource = new Resource(resourceDoc.toObject()); - // find local resource with the same id as new resource - auto pOldResource = FindById(pNewResource->GetId(), m_resources); - // if resource with the same id already exists then check its version - if (pOldResource) - { - // local resource is outdated, keep it in delete list, and download new one instead - if (pNewResource->GetVersion() > pOldResource->GetVersion()) - { - m_toDownload.push(pNewResource); - } - // local resource is newer or same version, keep it (remove from toDelete list) - // and don't need to download new one - else - { - delete pNewResource; - toDelete.removeAll(pOldResource); - } - } - // resource with same id not found - else - { - m_toDownload.push(pNewResource); - } - } - - // delete everything that's not in s3 - for (auto pResource : toDelete) - { - RemoveResource(pResource); - delete pResource; - } - - // parse order of articles - m_order.clear(); - QJsonArray orderArray = json["order"].toArray(); - for (auto idObject : orderArray) - { - m_order.append(idObject.toString()); - } - return ErrorCode::None; - } - - void ResourceManifest::PrepareForSync() - { - if (m_aborted) - { - m_syncLeft = 0; - } - - m_syncLeft = m_toDownload.count(); - } - - void ResourceManifest::SyncResources() - { - DownloadResources(); - } - - void ResourceManifest::DownloadResources() - { - while (m_toDownload.count() > 0) - { - m_syncUpdateCallback( - QString("Downloading: %1 resources left").arg(m_toDownload.count()), - LogInfo); - - auto pResource = m_toDownload.pop(); - - m_downloader->Download(QString(m_url).append(pResource->GetId()), - //download success - [&, pResource](QByteArray data) - { - pResource->SetData(data); - AppendResource(pResource); - UpdateSync(); - }, - //download fail - [&, pResource]() - { - m_failed = true; - delete pResource; - m_syncUpdateCallback("Failed to download resource", LogError); - UpdateSync(); - }); - } - } - - void ResourceManifest::ReadConfig() - { - QFile file(QCoreApplication::applicationDirPath() + "/newsConfig.txt"); - if (file.exists()) - { - if (file.open(QIODevice::ReadOnly)) - { - QTextStream in(&file); - m_url = in.readAll().trimmed(); - file.close(); - } - } - } - - void ResourceManifest::DeleteResources() - { - for (auto pResource : m_toDownload) - { - delete pResource; - } - m_toDownload.clear(); - - for (auto pResource : m_resources) - { - delete pResource; - } - m_resources.clear(); - } - - void ResourceManifest::UpdateSync() - { - m_syncLeft--; - if (m_syncLeft == 0) - { - if (!m_failed) - { - FinishSync(); - } - else - { - FailSync(ErrorCode::FailedToSync); - } - } - } - - void ResourceManifest::FinishSync() - { - if (!m_failed) - { - m_syncSuccessCallback(); - } - else - { - m_syncFailCallback(m_errorCode); - } - s_syncing = false; - } - - void ResourceManifest::FailSync(ErrorCode error) - { - m_failed = true; - m_errorCode = error; - FinishSync(); - } - - void ResourceManifest::AppendResource(Resource* pResource) - { - m_resources.append(pResource); - } - - void ResourceManifest::RemoveResource(Resource* pResource) - { - m_resources.removeAll(pResource); - } - -} diff --git a/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.h b/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.h deleted file mode 100644 index 3a0f31de8f..0000000000 --- a/Code/Tools/News/NewsShared/ResourceManagement/ResourceManifest.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 - * - */ - -#pragma once - -#include -#include -#include - -#include "NewsShared/LogType.h" -#include "NewsShared/ErrorCodes.h" - -class QJsonObject; - -namespace News -{ - class ArticleDescriptor; - class UidGenerator; - class S3Connector; - class QtDownloadManager; - class Descriptor; - class DownloadDescriptor; - class Resource; - - //! ResourceManifest manages resources. - /*! - Manifest contains information on resources, it handles syncing resources with s3 - */ - class ResourceManifest - { - public: - //! ResourceManifest ctor - /*! - \param syncSuccessCallback - called once when everything is synced - \param syncFailCallback - called once when sync failed - \param syncUpdateCallback - called multiple times to update information on sync process - */ - explicit ResourceManifest( - std::function syncSuccessCallback, - std::function syncFailCallback, - std::function syncUpdateCallback); - virtual ~ResourceManifest(); - - //! Find a resource that matches id - /*! - \retval Resource * - a pointer to a Resource with matching id, if none found return nullptr - */ - Resource* FindById(const QString& id) const; - static Resource* FindById(const QString& id, const QList& resources); - static Resource* FindById(const QString& id, const QStack& resources); - - //! Sync resources with s3 - /* - 1) First download resource manifest file - 2) Parse manifest - 3) Determine which resources need to be downloaded, updated, or deleted - 4) Download missing resources or resource that are out of date - 5) Call m_syncSuccessCallback - */ - virtual void Sync(); - - //! Gracegully stop sync process - /*! - Aborting works differently depending at what point during sync porocess it is called - If called before resources started to download, then skip download altogether - Otherwise gracefully abort all downloads and call m_syncFailCallback - */ - void Abort(); - - //! Called when switching endpoints to reset resource manifest to a clean state - virtual void Reset(); - - QList::const_iterator begin() const; - QList::const_iterator end() const; - - //! Get order of article resources, so they can be displayed properly in ArticleViewContainer - QList GetOrder() const; - - protected: - //! The root location of cloudfront resources - QString m_url = "https://lumberyard-data.amazon.com/"; - //! Name of resourceManifest file that links all other resources - static const QString MANIFEST_NAME; - //! Identifies whether syncing is in progress - static bool s_syncing; - //! Manifest Version - int m_version = -1; - //! Number of resources left to sync - int m_syncLeft = 0; - //! Identifies whether sync process was aborted - bool m_aborted = false; - //! Indentifies whether sync process has failed - bool m_failed = false; - ErrorCode m_errorCode = ErrorCode::None; - - QtDownloadManager* m_downloader = nullptr; - - QList m_resources; - QList m_order; - QStack m_toDownload; - - std::function m_syncSuccessCallback; - std::function m_syncFailCallback; - std::function m_syncUpdateCallback; - - //! Parse resource manifest json, and figure out which resources need to be downloaded - virtual ErrorCode Read(const QJsonObject& json); - - //! Executed before sync to figure out how many resources need to be synced - virtual void PrepareForSync(); - //! Actual sync function - virtual void SyncResources(); - //! Check whether everything is synced, if so call ResourceManifest::FinishSync - void UpdateSync(); - //! Notify that everything is synced - virtual void FinishSync(); - void FailSync(ErrorCode error); - - virtual void AppendResource(Resource* pResource); - virtual void RemoveResource(Resource* pResource); - - virtual void OnDownloadSuccess(QByteArray data); - virtual void OnDownloadFail(); - virtual void DownloadResources(); - - private: - void ReadConfig(); - void DeleteResources(); - }; -} // namespace News diff --git a/Code/Tools/News/NewsShared/Resources/ErrorImage.jpg b/Code/Tools/News/NewsShared/Resources/ErrorImage.jpg deleted file mode 100644 index 216fe14bd5..0000000000 --- a/Code/Tools/News/NewsShared/Resources/ErrorImage.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a7430d63820b3b00e03b4a8ec73b5e8e3946659031e3aeeb355b632acca4122 -size 8857 diff --git a/Code/Tools/News/NewsShared/Resources/KeepInTouchBanner.jpg b/Code/Tools/News/NewsShared/Resources/KeepInTouchBanner.jpg deleted file mode 100644 index b47040b717..0000000000 --- a/Code/Tools/News/NewsShared/Resources/KeepInTouchBanner.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:09c1733f116c11b56c54f7c3b6b4462884116db06605ca3cdfa23c45a3695385 -size 68024 diff --git a/Code/Tools/News/NewsShared/Resources/icon_facebook.png b/Code/Tools/News/NewsShared/Resources/icon_facebook.png deleted file mode 100644 index 0fb823969b..0000000000 --- a/Code/Tools/News/NewsShared/Resources/icon_facebook.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8b5493c81354b6757a21bea6baedd5665b8cb9ca19a6ff4fbd40afef534f35f -size 1257 diff --git a/Code/Tools/News/NewsShared/Resources/icon_twitch.png b/Code/Tools/News/NewsShared/Resources/icon_twitch.png deleted file mode 100644 index 50d7436b0d..0000000000 --- a/Code/Tools/News/NewsShared/Resources/icon_twitch.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2882aad73e2ecf310934ec3eacd0c1fa0a6ff012a4c3c9cf4ca96a72cef2fb8c -size 514 diff --git a/Code/Tools/News/NewsShared/Resources/icon_twitter.png b/Code/Tools/News/NewsShared/Resources/icon_twitter.png deleted file mode 100644 index d1cf7eb3dd..0000000000 --- a/Code/Tools/News/NewsShared/Resources/icon_twitter.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:046e14f1d90f77bb6ea0fe700bb10049748b46bb84c8ac3620642d4bca9df533 -size 954 diff --git a/Code/Tools/News/NewsShared/Resources/icon_youtube.png b/Code/Tools/News/NewsShared/Resources/icon_youtube.png deleted file mode 100644 index d3e7869387..0000000000 --- a/Code/Tools/News/NewsShared/Resources/icon_youtube.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3abaf8b178763441ac6812ae518c2f8cbea9b228aa1f84052a65836b33dc980c -size 976 diff --git a/Code/Tools/News/news_shared_files.cmake b/Code/Tools/News/news_shared_files.cmake deleted file mode 100644 index 2f20029068..0000000000 --- a/Code/Tools/News/news_shared_files.cmake +++ /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 -# -# - -set(FILES - NewsShared/LogType.h - NewsShared/ErrorCodes.h - NewsShared/Qt/ArticleErrorView.cpp - NewsShared/Qt/ArticleErrorView.h - NewsShared/Qt/ArticleErrorView.ui - NewsShared/Qt/ArticleView.cpp - NewsShared/Qt/ArticleView.h - NewsShared/Qt/ArticleView.ui - NewsShared/Qt/PinnedArticleView.ui - NewsShared/Qt/ArticleViewContainer.cpp - NewsShared/Qt/ArticleViewContainer.h - NewsShared/Qt/ArticleViewContainer.ui - NewsShared/Qt/KeepInTouchView.cpp - NewsShared/Qt/KeepInTouchView.h - NewsShared/Qt/KeepInTouchView.ui - NewsShared/Qt/NewsShared.qrc - NewsShared/ResourceManagement/ArticleDescriptor.cpp - NewsShared/ResourceManagement/ArticleDescriptor.h - NewsShared/ResourceManagement/Descriptor.cpp - NewsShared/ResourceManagement/Descriptor.h - NewsShared/ResourceManagement/JsonDescriptor.cpp - NewsShared/ResourceManagement/JsonDescriptor.h - NewsShared/ResourceManagement/QtDownloader.cpp - NewsShared/ResourceManagement/QtDownloader.h - NewsShared/ResourceManagement/QtDownloadManager.cpp - NewsShared/ResourceManagement/QtDownloadManager.h - NewsShared/ResourceManagement/Resource.cpp - NewsShared/ResourceManagement/Resource.h - NewsShared/ResourceManagement/ResourceManifest.cpp - NewsShared/ResourceManagement/ResourceManifest.h - NewsShared/Resources/ErrorImage.jpg - NewsShared/Resources/KeepInTouchBanner.jpg - NewsShared/Resources/icon_facebook.png - NewsShared/Resources/icon_twitch.png - NewsShared/Resources/icon_twitter.png - NewsShared/Resources/icon_youtube.png -) From 45b024bed1e10a1f4d4698e5ebff6f519a30804d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:12:45 -0700 Subject: [PATCH 127/156] Remove dead backend code Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 16 -------- .../Code/Asset/EditorAssetSystemComponent.h | 19 +--------- .../Builder/ScriptCanvasBuilderComponent.cpp | 15 -------- .../Builder/ScriptCanvasBuilderComponent.h | 17 --------- .../Code/Include/ScriptCanvas/Core/Node.cpp | 2 - .../Include/ScriptCanvas/Core/Nodeable.cpp | 2 - .../ScriptCanvas/Core/NodeableNode.cpp | 2 - .../Core/NodeableNodeOverloaded.cpp | 2 - .../Grammar/AbstractCodeModel.cpp | 1 - .../Grammar/ExecutionTraversalListeners.cpp | 1 - .../ScriptCanvas/Grammar/GrammarContext.cpp | 25 ------------ .../ScriptCanvas/Grammar/GrammarContext.h | 37 ------------------ .../ScriptCanvas/Grammar/GrammarContextBus.h | 35 ----------------- .../ScriptCanvas/Translation/GraphToLua.cpp | 10 ++--- .../ScriptCanvas/Translation/GraphToLua.h | 3 +- .../Translation/TranslationContext.h | 1 - .../Translation/TranslationContextBus.h | 38 ------------------- .../Code/scriptcanvasgem_common_files.cmake | 4 -- .../Framework/ScriptCanvasTestNodes.cpp | 2 - .../Tests/ScriptCanvas_RuntimeInterpreted.cpp | 2 - .../Code/Tests/ScriptCanvas_VM.cpp | 2 - 21 files changed, 6 insertions(+), 230 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContextBus.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContextBus.h diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index e698fcc298..2bc3a91a96 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -58,16 +58,6 @@ namespace ScriptCanvasEditor required.push_back(AZ_CRC("ScriptCanvasService", 0x41fd58f3)); } - ScriptCanvas::Grammar::Context* EditorAssetSystemComponent::GetGrammarContext() - { - return &m_grammarContext; - } - - ScriptCanvas::Translation::Context* EditorAssetSystemComponent::GetTranslationContext() - { - return &m_translationContext; - } - void EditorAssetSystemComponent::Init() { } @@ -79,16 +69,10 @@ namespace ScriptCanvasEditor AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); EditorAssetConversionBus::Handler::BusConnect(); - - ScriptCanvas::Translation::RequestBus::Handler::BusConnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusConnect(); } void EditorAssetSystemComponent::Deactivate() { - ScriptCanvas::Translation::RequestBus::Handler::BusDisconnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); - EditorAssetConversionBus::Handler::BusDisconnect(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusDisconnect(); m_editorAssetRegistry.Unregister(); diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h index 4a55a35908..84b10ff17c 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h @@ -12,11 +12,6 @@ #include "EditorAssetConversionBus.h" #include #include - -#include -#include -#include -#include #include namespace ScriptCanvasEditor @@ -26,8 +21,6 @@ namespace ScriptCanvasEditor class EditorAssetSystemComponent : public AZ::Component , public EditorAssetConversionBus::Handler - , public ScriptCanvas::Grammar::RequestBus::Handler - , public ScriptCanvas::Translation::RequestBus::Handler , private AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler { public: @@ -60,20 +53,10 @@ namespace ScriptCanvasEditor AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) override; ////////////////////////////////////////////////////////////////////////// - // ScriptCanvas::Grammar::RequestBus::Handler... - ScriptCanvas::Grammar::Context* GetGrammarContext() override; - - // ScriptCanvas::Translation::RequestBus::Handler... - ScriptCanvas::Translation::Context* GetTranslationContext() override; - - ScriptCanvas::AssetRegistry& GetAssetRegistry(); private: - ScriptCanvas::AssetRegistry m_editorAssetRegistry; - ScriptCanvas::Translation::Context m_translationContext; - ScriptCanvas::Grammar::Context m_grammarContext; - + ScriptCanvas::AssetRegistry m_editorAssetRegistry; EditorAssetSystemComponent(const EditorAssetSystemComponent&) = delete; }; } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index 2f30106707..b37d5c1da4 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -104,9 +104,6 @@ namespace ScriptCanvasBuilder m_sharedHandlers = HandleAssetTypes(); AssetHandlers workerHandlers(m_sharedHandlers); m_scriptCanvasBuilder.Activate(workerHandlers); - - ScriptCanvas::Translation::RequestBus::Handler::BusConnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusConnect(); } void PluginComponent::Deactivate() @@ -116,18 +113,6 @@ namespace ScriptCanvasBuilder AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::UnregisterSourceAssetType, azrtti_typeid()); m_scriptCanvasBuilder.BusDisconnect(); m_sharedHandlers.DeleteOwnedHandlers(); - ScriptCanvas::Translation::RequestBus::Handler::BusDisconnect(); - ScriptCanvas::Grammar::RequestBus::Handler::BusDisconnect(); - } - - ScriptCanvas::Grammar::Context* PluginComponent::GetGrammarContext() - { - return &m_grammarContext; - } - - ScriptCanvas::Translation::Context* PluginComponent::GetTranslationContext() - { - return &m_translationContext; } void PluginComponent::Reflect(AZ::ReflectContext* context) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h index 5d57863ec3..ff904d195a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.h @@ -12,18 +12,11 @@ #include #include "ScriptCanvasBuilderWorker.h" -#include -#include -#include -#include - namespace ScriptCanvasBuilder { //! ScriptCanvasBuilder is responsible for turning editor ScriptCanvas Assets into runtime script canvas assets class PluginComponent : public AZ::Component - , public ScriptCanvas::Grammar::RequestBus::Handler - , public ScriptCanvas::Translation::RequestBus::Handler { public: AZ_COMPONENT(PluginComponent, "{F8286B21-E751-4745-8BC4-512F190215FF}") @@ -42,19 +35,9 @@ namespace ScriptCanvasBuilder void Deactivate() override; ////////////////////////////////////////////////////////////////////////// - // ScriptCanvas::Grammar::RequestBus::Handler - ScriptCanvas::Grammar::Context* GetGrammarContext() override; - - // ScriptCanvas::Translation::RequestBus::Handler - ScriptCanvas::Translation::Context* GetTranslationContext() override; - private: PluginComponent(const PluginComponent&) = delete; - SharedHandlers m_sharedHandlers; - Worker m_scriptCanvasBuilder; - ScriptCanvas::Translation::Context m_translationContext; - ScriptCanvas::Grammar::Context m_grammarContext; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index c6c9330e51..3f9c5cc8a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -28,8 +28,6 @@ #include #include #include -#include -#include #include // Version Conversion includes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index f3d6070ac6..01b754506c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -9,8 +9,6 @@ #include #include -#include -#include namespace NodeableOutCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp index 5ec40d8e5f..db0cf8e589 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp index c9e2e3acc6..882804de36 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 80d2977c6d..4ccb462a5d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -32,7 +32,6 @@ #include "AbstractCodeModel.h" #include "ExecutionTraversalListeners.h" -#include "GrammarContextBus.h" #include "ParsingUtilities.h" #include "Primitives.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp index 1ac9303082..6ac80de542 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp @@ -27,7 +27,6 @@ #include #include "ExecutionTraversalListeners.h" -#include "GrammarContextBus.h" #include "ParsingUtilities.h" #include "Primitives.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.cpp deleted file mode 100644 index b8eb5f5ad5..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.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 "GrammarContext.h" - -namespace ScriptCanvas -{ - namespace Grammar - { - const SubgraphInterfaceSystem& Context::GetExecutionMapSystem() const - { - return m_executionMapSystem; - } - - SubgraphInterfaceSystem& Context::ModExecutionMapSystem() - { - return m_executionMapSystem; - } - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.h deleted file mode 100644 index 7a9d2eaec9..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContext.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 -#include - -#include - -namespace ScriptCanvas -{ - namespace Grammar - { - class Context - { - public: - AZ_CLASS_ALLOCATOR(Context, AZ::SystemAllocator, 0); - - Context() = default; - ~Context() = default; - - const SubgraphInterfaceSystem& GetExecutionMapSystem() const; - SubgraphInterfaceSystem& ModExecutionMapSystem(); - - private: - SubgraphInterfaceSystem m_executionMapSystem; - - // put grammatical state globals in here, things that can be useful across several parses of graphs - }; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContextBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContextBus.h deleted file mode 100644 index 1630d0b99e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/GrammarContextBus.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 - * - */ - -#pragma once - -namespace ScriptCanvas -{ - namespace Grammar - { - class Context; - - struct RequestTraits : public AZ::EBusTraits - { - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - virtual Context* GetGrammarContext() = 0; - }; - - using RequestBus = AZ::EBus; - - struct EventTraits : public AZ::EBusTraits - { - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - // add stuff here to speed up parsing across separate graphs - }; - - using EventBus = AZ::EBus; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp index f945110674..085a0928bc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.cpp @@ -24,8 +24,6 @@ #include #include "GraphToLuaUtility.h" -#include "TranslationContext.h" -#include "TranslationContextBus.h" namespace GraphToLuaCpp { @@ -92,9 +90,7 @@ namespace ScriptCanvas { SystemRequestBus::BroadcastResult(m_systemConfiguration, &SystemRequests::GetSystemComponentConfiguration); MarkTranslationStart(); - RequestBus::BroadcastResult(m_context, &RequestTraits::GetTranslationContext); - AZ_Assert(m_context, "Nothing is possible without the context"); - + m_tableName = GraphToLuaCpp::FileNameToTableName(m_model.GetSource().m_name); m_tableName += m_configuration.m_suffix; @@ -138,12 +134,12 @@ namespace ScriptCanvas const AZStd::string& GraphToLua::FindAbbreviation(AZStd::string_view dependency) const { - return m_context->FindAbbreviation(dependency); + return m_context.FindAbbreviation(dependency); } const AZStd::string& GraphToLua::FindLibrary(AZStd::string_view dependency) const { - return m_context->FindLibrary(dependency); + return m_context.FindLibrary(dependency); } AZStd::string_view GraphToLua::GetOperatorString(Grammar::ExecutionTreeConstPtr execution) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.h index ba46b21c65..347cb764e9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToLua.h @@ -16,6 +16,7 @@ #include #include "GraphToX.h" +#include "TranslationContext.h" #include "TranslationResult.h" #include "TranslationUtilities.h" @@ -60,7 +61,7 @@ namespace ScriptCanvas RuntimeInputs m_runtimeInputs; BuildConfiguration m_executionConfig = BuildConfiguration::Release; FunctionBlockConfig m_functionBlockConfig = FunctionBlockConfig::Ignored; - const Context* m_context = nullptr; + Context m_context; AZStd::string m_tableName; Writer m_dotLua; SystemComponentConfiguration m_systemConfiguration; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContext.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContext.h index ea49f90bde..40f04f2f47 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContext.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContext.h @@ -10,7 +10,6 @@ #include #include #include "Translation.h" -#include "TranslationContextBus.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContextBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContextBus.h deleted file mode 100644 index 0edac2afe3..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/TranslationContextBus.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 - -#include "Translation.h" - -namespace ScriptCanvas -{ - namespace Translation - { - class Context; - - struct RequestTraits : public AZ::EBusTraits - { - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - virtual Context* GetTranslationContext() = 0; - }; - - using RequestBus = AZ::EBus; - - struct EventTraits : public AZ::EBusTraits - { - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - }; - - using EventBus = AZ::EBus; - - } - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 40b5786303..17273b7ae0 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -101,7 +101,6 @@ set(FILES Include/ScriptCanvas/Translation/Translation.cpp Include/ScriptCanvas/Translation/TranslationContext.h Include/ScriptCanvas/Translation/TranslationContext.cpp - Include/ScriptCanvas/Translation/TranslationContextBus.h Include/ScriptCanvas/Translation/TranslationResult.h Include/ScriptCanvas/Translation/TranslationResult.cpp Include/ScriptCanvas/Translation/TranslationUtilities.h @@ -196,9 +195,6 @@ set(FILES Include/ScriptCanvas/Grammar/DebugMap.cpp Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.h Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.cpp - Include/ScriptCanvas/Grammar/GrammarContext.h - Include/ScriptCanvas/Grammar/GrammarContext.cpp - Include/ScriptCanvas/Grammar/GrammarContextBus.h Include/ScriptCanvas/Grammar/ParsingMetaData.h Include/ScriptCanvas/Grammar/ParsingMetaData.cpp Include/ScriptCanvas/Grammar/ParsingUtilities.h diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp index 727f73be39..e54c83c5d3 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestNodes.cpp @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index 3946057780..fedb1fc4d1 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -14,8 +14,6 @@ #include #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 0733101743..8c4983da0f 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp @@ -14,8 +14,6 @@ #include #include #include -#include -#include #include #include #include From c8e932652628c302ea6b2ec8524fbf6855d27642 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:16:25 -0700 Subject: [PATCH 128/156] add deliberately failing check again Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index fedb1fc4d1..db3d2223d6 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -83,6 +83,11 @@ public: } }; +TEST_F(ScriptCanvasTestFixture, ProveError) +{ + EXPECT_TRUE(false); +} + TEST_F(ScriptCanvasTestFixture, ParseErrorOnKnownNull) { ExpectParseError("LY_SC_UnitTest_ParseErrorOnKnownNull"); From d7c8c0192ffe008b4a3960de943997cf05ec6130 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:20:20 -0700 Subject: [PATCH 129/156] SPEC-7503 Mac nightly run asset profile failed to process "Translation/scriptcanvas_en_us.ts" (#1742) * copy frameworks to output for loose file case Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * patching lrelease Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fix for python in loose files and bundles Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * found what the problem is, setting a version just in case Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * fixup_bundle working with Python.framework and codesigning on AssetProcessor.app Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Trying to ignore other files to solve Jenkins Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fix some qt stuff for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * removal of cstemp files to prevent signature failures Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Updating Qt with fixes to solve some qt framework issues with include paths Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CMakeLists.txt | 1 + .../Outliner/OutlinerDisplayOptionsMenu.cpp | 2 + .../Plugins/FFMPEGPlugin/CMakeLists.txt | 1 + .../FFMPEGPlugin/FFMPEGPlugin_precompiled.h | 11 - .../Plugins/PerforcePlugin/CMakeLists.txt | 2 + .../Code/Platform/Mac/lrelease_mac.cmake | 9 + .../Platform/Mac/BuiltInPackages_mac.cmake | 2 +- .../Common/RuntimeDependencies_common.cmake | 3 +- .../runtime_dependencies_common.cmake.in | 1 + .../Mac/runtime_dependencies_mac.cmake.in | 195 ++++++++++++------ 10 files changed, 154 insertions(+), 73 deletions(-) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt b/Code/Editor/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt index 4744b4e174..5aab2a2056 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt @@ -27,6 +27,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE 3rdParty::Qt::Core + 3rdParty::Qt::Widgets AZ::AzCore AZ::AzToolsFramework Legacy::CryCommon diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp index c1af8d76d7..a6c1ed6598 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp @@ -66,3 +66,5 @@ namespace EntityOutliner emit OnOptionToggled(DisplayOption::AutoExpand, checked); } } + +#include diff --git a/Code/Editor/Plugins/FFMPEGPlugin/CMakeLists.txt b/Code/Editor/Plugins/FFMPEGPlugin/CMakeLists.txt index 342151f24a..909ec193f3 100644 --- a/Code/Editor/Plugins/FFMPEGPlugin/CMakeLists.txt +++ b/Code/Editor/Plugins/FFMPEGPlugin/CMakeLists.txt @@ -23,6 +23,7 @@ ly_add_target( . BUILD_DEPENDENCIES PRIVATE + 3rdParty::Qt::Core AZ::AzCore Legacy::CryCommon Legacy::EditorLib diff --git a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h b/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h index 3b015dd9a5..33ca3390f1 100644 --- a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h +++ b/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h @@ -17,19 +17,8 @@ ///////////////////////////////////////////////////////////////////////////// #include - -///////////////////////////////////////////////////////////////////////////// -// STL -///////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include - ///////////////////////////////////////////////////////////////////////////// // CRY Stuff //////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// #include -#include "Util/EditorUtils.h" #include "EditorCoreAPI.h" diff --git a/Code/Editor/Plugins/PerforcePlugin/CMakeLists.txt b/Code/Editor/Plugins/PerforcePlugin/CMakeLists.txt index 15a1147166..bd4661fa0f 100644 --- a/Code/Editor/Plugins/PerforcePlugin/CMakeLists.txt +++ b/Code/Editor/Plugins/PerforcePlugin/CMakeLists.txt @@ -31,6 +31,8 @@ ly_add_target( . BUILD_DEPENDENCIES PRIVATE + 3rdParty::Qt::Core + 3rdParty::Qt::Widgets AZ::AzCore Legacy::CryCommon Legacy::EditorLib diff --git a/Gems/LmbrCentral/Code/Platform/Mac/lrelease_mac.cmake b/Gems/LmbrCentral/Code/Platform/Mac/lrelease_mac.cmake index af355b0a51..34f67ccedd 100644 --- a/Gems/LmbrCentral/Code/Platform/Mac/lrelease_mac.cmake +++ b/Gems/LmbrCentral/Code/Platform/Mac/lrelease_mac.cmake @@ -5,6 +5,15 @@ # # +add_custom_command(TARGET LmbrCentral.Editor POST_BUILD + COMMAND "${CMAKE_COMMAND}" -P "${LY_ROOT_FOLDER}/cmake/Platform/Mac/RPathChange.cmake" + "$/lrelease" + @executable_path/../Frameworks + @executable_path + COMMENT "Patching lrelease..." + VERBATIM +) + set(lrelease_files ${QT_LRELEASE_EXECUTABLE} ) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 59da804e82..b261f18035 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -42,5 +42,5 @@ ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-mac ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-mac TARGETS googletest PACKAGE_HASH cbf020d5ef976c5db8b6e894c6c63151ade85ed98e7c502729dd20172acae5a8) ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-mac TARGETS GoogleBenchmark PACKAGE_HASH ad25de0146769c91e179953d845de2bec8ed4a691f973f47e3eb37639381f665) ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-mac TARGETS OpenSSL PACKAGE_HASH 28adc1c0616ac0482b2a9d7b4a3a3635a1020e87b163f8aba687c501cf35f96c) -ly_associate_package(PACKAGE_NAME qt-5.15.2-rev4-mac TARGETS Qt PACKAGE_HASH 08790d03a0e6ad808ad64cf25c3d75abd69a343f3d224fc39927e5c6e8738b98) +ly_associate_package(PACKAGE_NAME qt-5.15.2-rev5-mac TARGETS Qt PACKAGE_HASH 9d25918351898b308ded3e9e571fff6f26311b2071aeafd00dd5b249fdf53f7e) ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-mac TARGETS libsamplerate PACKAGE_HASH b912af40c0ac197af9c43d85004395ba92a6a859a24b7eacd920fed5854a97fe) diff --git a/cmake/Platform/Common/RuntimeDependencies_common.cmake b/cmake/Platform/Common/RuntimeDependencies_common.cmake index 734dd94203..31c8191a57 100644 --- a/cmake/Platform/Common/RuntimeDependencies_common.cmake +++ b/cmake/Platform/Common/RuntimeDependencies_common.cmake @@ -254,7 +254,8 @@ function(ly_delayed_generate_runtime_dependencies) # Generate the output file set(target_file_dir "$") - file(READ ${LY_RUNTIME_DEPENDENCIES_TEMPLATE} template_file) + set(target_file "$") + ly_file_read(${LY_RUNTIME_DEPENDENCIES_TEMPLATE} template_file) string(CONFIGURE "${LY_COPY_COMMANDS}" LY_COPY_COMMANDS @ONLY) string(CONFIGURE "${template_file}" configured_template_file @ONLY) file(GENERATE diff --git a/cmake/Platform/Common/runtime_dependencies_common.cmake.in b/cmake/Platform/Common/runtime_dependencies_common.cmake.in index e2a85374b8..9d23a73a26 100644 --- a/cmake/Platform/Common/runtime_dependencies_common.cmake.in +++ b/cmake/Platform/Common/runtime_dependencies_common.cmake.in @@ -13,6 +13,7 @@ function(ly_copy source_file target_directory) if(NOT ${same_location}) file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300) if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}") + message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) endif() endif() diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 92ad3514d4..9f9006c4c0 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -19,56 +19,96 @@ endfunction() include(BundleUtilities) cmake_policy(SET CMP0012 NEW) # new policy for the if that evaluates a boolean out of the LY_BUILD_FIXUP_BUNDLE expansion +cmake_policy(SET CMP0009 NEW) # do not traverse symlinks on GLOB_RECURSE set(anything_new FALSE) set(plugin_libs) set(plugin_dirs) +set(depends_on_python FALSE) + +find_program(LY_INSTALL_NAME_TOOL install_name_tool) +if (NOT LY_INSTALL_NAME_TOOL) + message(FATAL_ERROR "Unable to locate 'install_name_tool'") +endif() function(ly_copy source_file target_directory) get_filename_component(target_filename "${source_file}" NAME) - # If source_file is a Framework and target_directory is a bundle - if("${source_file}" MATCHES "\\.[Ff]ramework[^\\.]" AND "${target_directory}" MATCHES "\\.app/Contents/MacOS") + # If target_directory is a bundle + if("${target_directory}" MATCHES "\\.app/Contents/MacOS") - if(NOT @LY_BUILD_FIXUP_BUNDLE@) - return() - endif() + set(target_is_bundle TRUE) + if("${source_file}" MATCHES "\\.[Ff]ramework[^\\.]") - # fixup origin to copy the whole Framework folder and change destination to Contents/Frameworks - string(REGEX REPLACE "(.*\\.[Ff]ramework).*" "\\1" source_file "${source_file}") - get_filename_component(source_file_folder "${source_file}" DIRECTORY) - - set(local_plugin_dirs ${plugin_dirs}) - list(APPEND local_plugin_dirs "${source_file_folder}") - set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) - return() + if(NOT @LY_BUILD_FIXUP_BUNDLE@) + return() + endif() - elseif("${source_file}" MATCHES "qt/plugins" AND "${target_directory}" MATCHES "\\.app/Contents/MacOS") + # fixup origin to copy the whole Framework folder and change destination to Contents/Frameworks + string(REGEX REPLACE "(.*\\.[Ff]ramework).*" "\\1" source_file "${source_file}") + get_filename_component(source_file_folder "${source_file}" DIRECTORY) + + # Python.framework produces a bug in BundleUtilities so it needs manual handling + # https://gitlab.kitware.com/cmake/cmake/-/issues/20165 + if("${source_file}" MATCHES "Python.framework") + # fixup the destination so it ends up in Contents/Frameworks + string(REGEX REPLACE "(.*\\.app/Contents)/MacOS" "\\1/Frameworks" target_directory "${target_directory}") + set(local_plugin_dirs ${plugin_dirs}) + list(APPEND local_plugin_dirs "${target_directory}/Python.framework") + set(target_filename Python.framework) + set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) + set(depends_on_python TRUE PARENT_SCOPE) + else() + set(local_plugin_dirs ${plugin_dirs}) + list(APPEND local_plugin_dirs "${source_file_folder}") + set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) + return() + endif() - if(NOT @LY_BUILD_FIXUP_BUNDLE@) - return() - endif() + elseif("${source_file}" MATCHES "qt/plugins") - # fixup the destination so it ends up in Contents/Plugins - string(REGEX REPLACE "(.*\\.app/Contents)/MacOS" "\\1/plugins" target_directory "${target_directory}") + if(NOT @LY_BUILD_FIXUP_BUNDLE@) + return() + endif() - set(local_plugin_dirs ${plugin_dirs}) - list(APPEND local_plugin_dirs "${target_directory}") - set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) - set(local_plugin_libs ${plugin_libs}) - list(APPEND local_plugin_libs "${target_directory}/${target_filename}") - set(plugin_libs ${local_plugin_libs} PARENT_SCOPE) + # fixup the destination so it ends up in Contents/Plugins + string(REGEX REPLACE "(.*\\.app/Contents)/MacOS" "\\1/plugins" target_directory "${target_directory}") - elseif("${source_file}" MATCHES "qt/translations" AND "${target_directory}" MATCHES "\\.app/Contents/MacOS") + set(local_plugin_dirs ${plugin_dirs}) + list(APPEND local_plugin_dirs "${target_directory}") + set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) + set(local_plugin_libs ${plugin_libs}) + list(APPEND local_plugin_libs "${target_directory}/${target_filename}") + set(plugin_libs ${local_plugin_libs} PARENT_SCOPE) - return() # skip, is this used? + elseif("${source_file}" MATCHES "qt/translations") + + return() # skip, is this used? + + elseif("${source_file}" MATCHES ".dylib") + + set(local_plugin_dirs ${plugin_dirs}) + list(APPEND local_plugin_dirs "${target_directory}") + set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) + + endif() - elseif("${source_file}" MATCHES ".dylib") + else() + + # target is not a bundle + set(target_is_bundle FALSE) + if("${source_file}" MATCHES "\\.[Ff]ramework[^\\.]") + + # fixup origin to copy the whole Framework folder + string(REGEX REPLACE "(.*\\.[Ff]ramework).*" "\\1" source_file "${source_file}") + get_filename_component(target_filename "${source_file}" NAME) + + if("${source_file}" MATCHES "Python.framework") + set(depends_on_python TRUE PARENT_SCOPE) + endif() - set(local_plugin_dirs ${plugin_dirs}) - list(APPEND local_plugin_dirs "${target_directory}") - set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) + endif() endif() @@ -79,6 +119,11 @@ function(ly_copy source_file target_directory) endif() if(NOT EXISTS "${target_directory}/${target_filename}" OR "${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}") message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") + if(NOT target_is_bundle) + # if it is a bundle, there is no contention about the files in the destination, each bundle target will copy everything + # we dont want these files to invalidate the bundle and cause a new signature + file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300) + endif() file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) file(TOUCH ${target_directory}/${target_filename}) set(anything_new TRUE PARENT_SCOPE) @@ -93,6 +138,7 @@ if(NOT @LY_BUILD_FIXUP_BUNDLE@) endif() if(@target_file_dir@ MATCHES ".app/Contents/MacOS") + string(REGEX REPLACE "(.*\\.app)/Contents/MacOS.*" "\\1" bundle_path "@target_file_dir@") set(fixup_timestamp_file "${bundle_path}.fixup.stamp") if(NOT anything_new) @@ -106,31 +152,44 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") if(EXISTS ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) list(APPEND fixup_bundle_ignore dxc-3.7) endif() - # Python.framework being copied by fixup_bundle - #if(EXISTS ${bundle_path}/Contents/Frameworks/Python.framework) - # # LYN-4502: Patch python bundle, it contains some windows executables, some files that fixup_bundle doesnt like and has - # # duplicated binaries between Versions/3.7 and Versions/Current. - # file(GLOB exe_files - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/*.exe - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/*.exe - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/*.exe - # ) - # foreach(exe_file ${exe_files}) - # file(REMOVE ${exe_file}) - # endforeach() - # file(REMOVE_RECURSE - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Resources - # ${bundle_path}/Contents/Frameworks/Python.framework/Python - # ${bundle_path}/Contents/Frameworks/Python.framework/Resources/Python.app - # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Python - # ) - # file(REMOVE_RECURSE ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current) - # execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current - # WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ - # ) - #endif() + # LYN-4502: Patch python bundle, it contains some windows executables, some files that fixup_bundle doesnt like and has + # other issues that produce signature problems + if(depends_on_python) + message(STATUS "Fixing ${bundle_path}/Contents/Frameworks/Python.framework...") + list(APPEND fixup_bundle_ignore Python python3.7m python3.7) + file(REMOVE_RECURSE + ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current + ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Headers + ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/Python + ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test + ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests + ${bundle_path}/Contents/Frameworks/Python.framework/Python + ${bundle_path}/Contents/Frameworks/Python.framework/Resources + ${bundle_path}/Contents/Frameworks/Python.framework/Headers + ) + file(GLOB_RECURSE exe_file_list "${bundle_path}/Contents/Frameworks/Python.framework/**/*.exe") + if(exe_file_list) + file(REMOVE_RECURSE ${exe_file_list}) + endif() + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink include/python3.7m Headers + WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7 + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current + WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Python Python + WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers Headers + WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources Resources + WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + ) + file(CHMOD ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current/Python + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + endif() list(REMOVE_DUPLICATES plugin_libs) list(REMOVE_DUPLICATES plugin_dirs) fixup_bundle("${bundle_path}" "${plugin_libs}" "${plugin_dirs}" IGNORE_ITEM ${fixup_bundle_ignore}) @@ -139,11 +198,27 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") # fixup bundle ends up removing the rpath of dxc (despite we exclude it) if(EXISTS ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) - find_program(LY_INSTALL_NAME_TOOL install_name_tool) - if (NOT LY_INSTALL_NAME_TOOL) - message(FATAL_ERROR "Unable to locate 'install_name_tool'") - endif() execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) endif() + + # misplaced .DS_Store files can cause signing to fail + # Interrupted signatures can leave cstemp files behind that fail next signature + file(GLOB_RECURSE remove_file_list + "${bundle_path}/**/.DS_Store" + "${bundle_path/}**/*.cstemp" + ) + if(remove_file_list) + file(REMOVE_RECURSE ${remove_file_list}) + endif() + + endif() + +else() # Non-bundle case + + if(depends_on_python) + # RPATH fix python + execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -change @rpath/Python @rpath/Python.framework/Versions/Current/Python @target_file@) + endif() + endif() From 92ff99c6a0766e72df7b969c86273a20af4035ee Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:11:08 -0700 Subject: [PATCH 130/156] Remove NewsShared includes in the WelcomeDialog class Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp | 4 ---- Code/Editor/WelcomeScreen/WelcomeScreenDialog.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp index f9560aef55..49d9c58159 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp @@ -40,10 +40,6 @@ #include "CryEdit.h" #include "LevelFileDialog.h" -// NewsShared -#include // for News::ResourceManifest -#include // for News::ArticleViewContainer - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h index 4338a8250f..0a96836eb4 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h @@ -8,8 +8,6 @@ #if !defined(Q_MOC_RUN) #include -#include "NewsShared/LogType.h" -#include "NewsShared/ErrorCodes.h" #endif namespace News { From 2cc909570211e885748b2d525876dcea76f8faac Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Thu, 8 Jul 2021 21:35:17 -0700 Subject: [PATCH 131/156] Remove unused functions referencing the News ErrorCode class Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- Code/Editor/WelcomeScreen/WelcomeScreenDialog.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h index 0a96836eb4..39c0ad6316 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.h @@ -60,9 +60,6 @@ private: void OnRecentLevelTableItemClicked(const QModelIndex& index); void OnCloseBtnClicked(bool checked); - void SyncFail(News::ErrorCode error); - void SyncSuccess(); - private Q_SLOTS: void previewAreaScrolled(); }; From 097dc25424cbca90243ba86df06e522340c1a2e5 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 9 Jul 2021 00:41:25 -0500 Subject: [PATCH 132/156] Fixed the discovery of the dependencies of gem variant aliases which (#2013) alias INTERFACE LIBRARY targets. This was causing the dependent Atom_AtomBridge sub gems from not being found when generating the cmake_dependencies.*.setreg file containing the list of gem modules to load Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- AutomatedTesting/Gem/Code/enabled_gems.cmake | 2 +- cmake/SettingsRegistry.cmake | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake index 0d4d4b116f..dd68e379dd 100644 --- a/AutomatedTesting/Gem/Code/enabled_gems.cmake +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -47,7 +47,7 @@ set(ENABLED_GEMS LmbrCentral LyShine HttpRequestor - Atom_AtomBridge + Atom AWSCore AWSClientAuth AWSMetrics diff --git a/cmake/SettingsRegistry.cmake b/cmake/SettingsRegistry.cmake index 0eae244c4f..934bae4e30 100644 --- a/cmake/SettingsRegistry.cmake +++ b/cmake/SettingsRegistry.cmake @@ -160,12 +160,6 @@ function(ly_delayed_generate_settings_registry) get_property(has_manually_added_dependencies TARGET ${gem_target} PROPERTY MANUALLY_ADDED_DEPENDENCIES SET) get_target_property(target_type ${gem_target} TYPE) - if (target_type STREQUAL "INTERFACE_LIBRARY" AND has_manually_added_dependencies) - # don't use interface libraries here, we only want ones which produce actual binaries unless the target - # is empty. We have still already recursed into their dependencies - they'll show up later. - # When the target has no dependencies however we want to add the gem root path to the generated setreg - continue() - endif() ly_get_gem_module_root(gem_module_root ${gem_target}) From 9794182842213ae2131d9ef0a096927cc53cace6 Mon Sep 17 00:00:00 2001 From: dmcdiar Date: Fri, 9 Jul 2021 01:36:58 -0700 Subject: [PATCH 133/156] Notified the MeshFeatureProcessor when a ReflectionProbe is baked. Signed-off-by: dmcdiar --- .../ReflectionProbe/ReflectionProbeFeatureProcessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp index 39c0d0592e..ac7b4b94b9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp @@ -256,6 +256,10 @@ namespace AZ { AZ_Assert(probe.get(), "SetProbeCubeMap called with an invalid handle"); probe->SetCubeMapImage(cubeMapImage, relativePath); + + // notify the MeshFeatureProcessor that the reflection probe changed + MeshFeatureProcessor* meshFeatureProcessor = GetParentScene()->GetFeatureProcessor(); + meshFeatureProcessor->UpdateMeshReflectionProbes(); } void ReflectionProbeFeatureProcessor::SetProbeTransform(const ReflectionProbeHandle& probe, const AZ::Transform& transform) From 2555c88fe73628c3f2e02bb6ad620f5bf0d3942c Mon Sep 17 00:00:00 2001 From: jromnoa Date: Fri, 9 Jul 2021 07:42:57 -0700 Subject: [PATCH 134/156] this test needs to be disabled in main, it was supposed to be merged to development before break but got merged to stabilization and then main Signed-off-by: jromnoa --- .../Gem/PythonTests/smoke/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index af9fc142e2..9951b448d8 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -51,4 +51,17 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AutomatedTesting.GameLauncher AutomatedTesting.Assets ) + +# ly_add_pytest( +# NAME AutomatedTesting::GameLauncherWithGPU +# TEST_REQUIRES gpu +# PATH ${CMAKE_CURRENT_LIST_DIR}/test_GameLauncher_EnterExitGameMode_Works.py +# TIMEOUT 100 +# RUNTIME_DEPENDENCIES +# AZ::AssetProcessor +# AZ::PythonBindingsExample +# Legacy::Editor +# AutomatedTesting.GameLauncher +# AutomatedTesting.Assets +# ) endif() From 5b44ea9b9ab99b5f285158afe88fca35219c33c5 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Fri, 9 Jul 2021 08:15:34 -0700 Subject: [PATCH 135/156] Project Manager: Added Per Project Template Previews and Icon Overlays (#1994) * Project Manager: Added Per Project Template Previews and Icon Overlays Signed-off-by: nggieber * Remove template icon overlays and bake them into template preview Signed-off-by: nggieber * Remove unused variables and headers Signed-off-by: nggieber --- .../ProjectManager/Source/NewProjectSettingsScreen.cpp | 3 ++- Code/Tools/ProjectManager/Source/ProjectManagerDefs.h | 1 + Code/Tools/ProjectManager/Source/TemplateButtonWidget.cpp | 6 +++--- Code/Tools/ProjectManager/Source/TemplateButtonWidget.h | 4 ---- Templates/DefaultProject/preview.png | 3 +++ Templates/MinimalProject/preview.png | 3 +++ 6 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 Templates/DefaultProject/preview.png create mode 100644 Templates/MinimalProject/preview.png diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp index c0c96d8281..508b7256d1 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -117,7 +118,7 @@ namespace O3DE::ProjectManager for (int index = 0; index < m_templates.size(); ++index) { ProjectTemplateInfo projectTemplate = m_templates.at(index); - QString projectPreviewPath = projectTemplate.m_path + "/Template/preview.png"; + QString projectPreviewPath = QDir(projectTemplate.m_path).filePath(ProjectPreviewImagePath); QFileInfo doesPreviewExist(projectPreviewPath); if (!doesPreviewExist.exists() || !doesPreviewExist.isFile()) { diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h index f74233db51..79ad04c43a 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h +++ b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h @@ -12,6 +12,7 @@ namespace O3DE::ProjectManager { inline constexpr static int ProjectPreviewImageWidth = 210; inline constexpr static int ProjectPreviewImageHeight = 280; + inline constexpr static int ProjectTemplateImageWidth = 92; static const QString ProjectBuildPathPostfix = "build/windows_vs2019"; static const QString ProjectBuildPathCmakeFiles = "CMakeFiles"; diff --git a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.cpp b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.cpp index d20b91ac8e..638b821e5d 100644 --- a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.cpp +++ b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include @@ -16,7 +17,6 @@ namespace O3DE::ProjectManager { - TemplateButton::TemplateButton(const QString& imagePath, const QString& labelText, QWidget* parent) : QPushButton(parent) { @@ -31,8 +31,8 @@ namespace O3DE::ProjectManager QLabel* image = new QLabel(this); image->setObjectName("templateImage"); - image->setPixmap( - QPixmap(imagePath).scaled(QSize(s_templateImageWidth,s_templateImageHeight) , Qt::KeepAspectRatio, Qt::SmoothTransformation)); + image->setPixmap(QPixmap(imagePath).scaled( + QSize(ProjectTemplateImageWidth, ProjectTemplateImageWidth), Qt::KeepAspectRatio, Qt::SmoothTransformation)); vLayout->addWidget(image); QLabel* label = new QLabel(labelText, this); diff --git a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h index 2b2b3474c2..0607b8fbfe 100644 --- a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h @@ -24,9 +24,5 @@ namespace O3DE::ProjectManager protected slots: void onToggled(); - - private: - inline constexpr static int s_templateImageWidth = 92; - inline constexpr static int s_templateImageHeight = 122; }; } // namespace O3DE::ProjectManager diff --git a/Templates/DefaultProject/preview.png b/Templates/DefaultProject/preview.png new file mode 100644 index 0000000000..78a2a735d2 --- /dev/null +++ b/Templates/DefaultProject/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ae503ec99c8358991dc3c6e50737844d3602b81a49abbbed7d697d7238547c0 +size 28026 diff --git a/Templates/MinimalProject/preview.png b/Templates/MinimalProject/preview.png new file mode 100644 index 0000000000..b94e84a348 --- /dev/null +++ b/Templates/MinimalProject/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c14254e4c822fb50bfec42691c49f1089ab020a873c366f71168390d3705c6e +size 17522 From 595ac3fb0881cdc397f729fe5211ffa35cfb9791 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Fri, 9 Jul 2021 08:18:35 -0700 Subject: [PATCH 136/156] Project Manager: Feature tag filtering for header of the gem catalog (#1956) * [LYN-4440] Added new feature tag remove icon Signed-off-by: Benjamin Jillich * [LYN-4440] Added new gem filter tag widget Signed-off-by: Benjamin Jillich * [LYN-4440] Added feature tag widget used for showing the filtered tags in the gem catalog header Signed-off-by: Benjamin Jillich * [LYN-4440] Added filter tag widget container to the gem catalog header and connected it to the gem model Signed-off-by: Benjamin Jillich * [LYN-4440] Syncing the feature tag filters on the left panel with the tag widgets in the header and styling the item delegates Signed-off-by: Benjamin Jillich --- .../Resources/FeatureTagClose.svg | 4 + .../Resources/ProjectManager.qrc | 1 + .../Resources/ProjectManager.qss | 7 ++ .../Source/GemCatalog/GemFilterTagWidget.cpp | 96 +++++++++++++++++++ .../Source/GemCatalog/GemFilterTagWidget.h | 57 +++++++++++ .../Source/GemCatalog/GemFilterWidget.cpp | 11 +++ .../Source/GemCatalog/GemItemDelegate.cpp | 6 +- .../Source/GemCatalog/GemListHeaderWidget.cpp | 34 ++++++- .../Source/GemCatalog/GemListHeaderWidget.h | 3 +- .../project_manager_files.cmake | 2 + 10 files changed, 213 insertions(+), 8 deletions(-) create mode 100644 Code/Tools/ProjectManager/Resources/FeatureTagClose.svg create mode 100644 Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp create mode 100644 Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.h diff --git a/Code/Tools/ProjectManager/Resources/FeatureTagClose.svg b/Code/Tools/ProjectManager/Resources/FeatureTagClose.svg new file mode 100644 index 0000000000..9ab30acd65 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/FeatureTagClose.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc index cfe4b37fbc..2e93e9eca9 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc @@ -34,5 +34,6 @@ Warning.svg Backgrounds/DefaultBackground.jpg Backgrounds/FtueBackground.jpg + FeatureTagClose.svg diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss index d6a2476e83..0684ec1310 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qss +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qss @@ -478,6 +478,13 @@ QProgressBar::chunk { background-color: #333333; } +/************** Filter tag widget **************/ + +#FilterTagWidgetTextLabel { + color: #94D2FF; + font-size: 10px; +} + /************** Gem Catalog (Inspector) **************/ #GemCatalogInspector { diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp new file mode 100644 index 0000000000..c4612debc8 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp @@ -0,0 +1,96 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. 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 O3DE::ProjectManager +{ + FilterTagWidget::FilterTagWidget(const QString& text, QWidget* parent) + : QFrame(parent) + { + setFrameShape(QFrame::NoFrame); + + auto* layout = new QHBoxLayout(); + layout->setContentsMargins(6, 5, 4, 4); + layout->setSpacing(2); + setLayout(layout); + + setStyleSheet("background-color: #555555;"); + + m_textLabel = new QLabel(); + m_textLabel->setObjectName("FilterTagWidgetTextLabel"); + m_textLabel->setText(text); + layout->addWidget(m_textLabel); + + m_closeButton = new QPushButton(); + m_closeButton->setFlat(true); + m_closeButton->setIcon(QIcon(":/FeatureTagClose.svg")); + m_closeButton->setIconSize(QSize(12, 12)); + m_closeButton->setStyleSheet("QPushButton { background-color: transparent; border: 0px }"); + layout->addWidget(m_closeButton); + connect(m_closeButton, &QPushButton::clicked, this, [=]{ emit RemoveClicked(); }); + } + + QString FilterTagWidget::text() const + { + return m_textLabel->text(); + } + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + FilterTagWidgetContainer::FilterTagWidgetContainer(QWidget* parent) + : QWidget(parent) + { + m_layout = new QHBoxLayout(); + m_layout->setMargin(0); + m_layout->setSpacing(0); + setLayout(m_layout); + } + + void FilterTagWidgetContainer::Reinit(const QVector& tags) + { + if (m_widget) + { + // Hide the old widget and request deletion. + m_widget->hide(); + m_widget->deleteLater(); + } + + m_widget = new QWidget(this); + + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->setAlignment(Qt::AlignLeft); + hLayout->setMargin(0); + hLayout->setSpacing(8); + + const int numTags = tags.count(); + for (int i = 0; i < numTags; ++i) + { + FilterTagWidget* tagWidget = new FilterTagWidget(tags[i]); + + // Add the tag widget to the current row. + hLayout->addWidget(tagWidget); + + // Connect the clicked event of the close button of the tag widget to the remove tag function in the container. + connect(tagWidget, &FilterTagWidget::RemoveClicked, this, [this, tagWidget]{ emit TagRemoved(tagWidget->text()); }); + } + + QWidget* spacerWidget = new QWidget(); + spacerWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); + hLayout->addWidget(spacerWidget); + + m_widget->setLayout(hLayout); + m_layout->addWidget(m_widget); + + setFixedHeight(30); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.h new file mode 100644 index 0000000000..0994618d4e --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. 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 + +QT_FORWARD_DECLARE_CLASS(QHBoxLayout) +QT_FORWARD_DECLARE_CLASS(QLabel) +QT_FORWARD_DECLARE_CLASS(QPushButton) +QT_FORWARD_DECLARE_CLASS(QWidget) + +namespace O3DE::ProjectManager +{ + class FilterTagWidget + : public QFrame + { + Q_OBJECT + + public: + FilterTagWidget(const QString& text, QWidget* parent = nullptr); + QString text() const; + + signals: + void RemoveClicked(); + + private: + QLabel* m_textLabel = nullptr; + QPushButton* m_closeButton = nullptr; + }; + + // Horizontally expanding filter tag container widget + class FilterTagWidgetContainer + : public QWidget + { + Q_OBJECT + + public: + FilterTagWidgetContainer(QWidget* parent = nullptr); + void Reinit(const QVector& tags); + + signals: + void TagRemoved(QString tagName); + + private: + QWidget* m_widget = nullptr; + QHBoxLayout* m_layout = nullptr; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp index 753371ba52..268e793ee8 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -485,6 +486,7 @@ namespace O3DE::ProjectManager const QString& feature = elementNames[i]; QAbstractButton* button = buttons[i]; + // Adjust the proxy model and enable or disable the clicked feature used for filtering. connect(button, &QAbstractButton::toggled, this, [=](bool checked) { QSet features = m_filterProxyModel->GetFeatures(); @@ -498,6 +500,15 @@ namespace O3DE::ProjectManager } m_filterProxyModel->SetFeatures(features); }); + + // Sync the UI state with the proxy model filtering. + connect(m_filterProxyModel, &GemSortFilterProxyModel::OnInvalidated, this, [=] + { + const QSet& filteredFeatureTags = m_filterProxyModel->GetFeatures(); + const bool isChecked = filteredFeatureTags.contains(button->text()); + QSignalBlocker signalsBlocker(button); + button->setChecked(isChecked); + }); } } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index b9dc3e9fcc..f5bedb79eb 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -102,9 +102,11 @@ namespace O3DE::ProjectManager // In case there are feature tags displayed at the bottom, decrease the size of the summary text field. const QStringList featureTags = GemModel::GetFeatures(modelIndex); - const int summaryHeight = contentRect.height() - (!featureTags.empty() * 30); + const int featureTagAreaHeight = 30; + const int summaryHeight = contentRect.height() - (!featureTags.empty() * featureTagAreaHeight); - const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, + const int additionalSummarySpacing = s_itemMargins.right() * 3; + const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - additionalSummarySpacing, summaryHeight); const QRect summaryRect = QRect(/*topLeft=*/QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp index 5e2f93c2fc..3d6fd1947c 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp @@ -7,10 +7,13 @@ #include #include -#include +#include +#include +#include #include -#include #include +#include +#include namespace O3DE::ProjectManager { @@ -23,11 +26,34 @@ namespace O3DE::ProjectManager setStyleSheet("background-color: #333333;"); - vLayout->addSpacing(20); + vLayout->addSpacing(13); // Top section QHBoxLayout* topLayout = new QHBoxLayout(); + topLayout->addSpacing(16); topLayout->setMargin(0); + + auto* tagWidget = new FilterTagWidgetContainer(); + + // Adjust the proxy model and disable the given feature used for filtering. + connect(tagWidget, &FilterTagWidgetContainer::TagRemoved, this, [=](QString tagName) + { + QSet filteredFeatureTags = proxyModel->GetFeatures(); + filteredFeatureTags.remove(tagName); + proxyModel->SetFeatures(filteredFeatureTags); + }); + + // Reinitialize the tag widget in case the filter in the proxy model got invalided. + connect(proxyModel, &GemSortFilterProxyModel::OnInvalidated, this, [=] + { + const QSet& tagSet = proxyModel->GetFeatures(); + QVector sortedTags(tagSet.begin(), tagSet.end()); + std::sort(sortedTags.begin(), sortedTags.end()); + tagWidget->Reinit(sortedTags); + }); + + topLayout->addWidget(tagWidget); + topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); QLabel* showCountLabel = new QLabel(); @@ -43,7 +69,7 @@ namespace O3DE::ProjectManager vLayout->addLayout(topLayout); - vLayout->addSpacing(20); + vLayout->addSpacing(13); // Separating line QFrame* hLine = new QFrame(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h index a9b3b3aa36..fcad58a321 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h @@ -8,9 +8,8 @@ #pragma once #if !defined(Q_MOC_RUN) +#include #include -#include -#include #include #endif diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake index a5632f082c..07c649624e 100644 --- a/Code/Tools/ProjectManager/project_manager_files.cmake +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -71,6 +71,8 @@ set(FILES Source/GemCatalog/GemCatalogHeaderWidget.cpp Source/GemCatalog/GemCatalogScreen.h Source/GemCatalog/GemCatalogScreen.cpp + Source/GemCatalog/GemFilterTagWidget.h + Source/GemCatalog/GemFilterTagWidget.cpp Source/GemCatalog/GemFilterWidget.h Source/GemCatalog/GemFilterWidget.cpp Source/GemCatalog/GemInfo.h From e3be8b4c467ded8670c338479af9715287f8c5f8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 9 Jul 2021 09:01:35 -0700 Subject: [PATCH 137/156] Enable AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER for Mac/Linux (#2017) Validated it opens the project manager in Mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Linux/AzFramework/AzFramework_Traits_Linux.h | 2 +- .../Platform/Mac/AzFramework/AzFramework_Traits_Mac.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/Platform/Linux/AzFramework/AzFramework_Traits_Linux.h b/Code/Framework/AzFramework/Platform/Linux/AzFramework/AzFramework_Traits_Linux.h index 98893e2d01..2cf5b3f87e 100644 --- a/Code/Framework/AzFramework/Platform/Linux/AzFramework/AzFramework_Traits_Linux.h +++ b/Code/Framework/AzFramework/Platform/Linux/AzFramework/AzFramework_Traits_Linux.h @@ -12,5 +12,5 @@ #define AZ_TRAIT_AZFRAMEWORK_USE_ERRNO_T_TYPEDEF 1 #define AZ_TRAIT_AZFRAMEWORK_USE_POSIX_LOCALTIME_R 0 #define AZ_TRAIT_AZFRAMEWORK_PYTHON_SHELL "python.sh" -#define AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER 0 +#define AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER 1 #define AZ_TRAIT_AZFRAMEWORK_PROCESSLAUNCH_DEFAULT 0 diff --git a/Code/Framework/AzFramework/Platform/Mac/AzFramework/AzFramework_Traits_Mac.h b/Code/Framework/AzFramework/Platform/Mac/AzFramework/AzFramework_Traits_Mac.h index 6af4294a5c..73f6d212d4 100644 --- a/Code/Framework/AzFramework/Platform/Mac/AzFramework/AzFramework_Traits_Mac.h +++ b/Code/Framework/AzFramework/Platform/Mac/AzFramework/AzFramework_Traits_Mac.h @@ -12,5 +12,5 @@ #define AZ_TRAIT_AZFRAMEWORK_USE_ERRNO_T_TYPEDEF 0 #define AZ_TRAIT_AZFRAMEWORK_USE_POSIX_LOCALTIME_R 1 #define AZ_TRAIT_AZFRAMEWORK_PYTHON_SHELL "python.sh" -#define AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER 0 +#define AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER 1 #define AZ_TRAIT_AZFRAMEWORK_PROCESSLAUNCH_DEFAULT 0 From 76cef6e91fb90f406674eefaf81ac24d55b8ab9b Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Fri, 9 Jul 2021 09:38:11 -0700 Subject: [PATCH 138/156] Project Manager: Showing a progress bar when copying projects (#2025) Signed-off-by: Benjamin Jillich --- .../Resources/ProjectManager.qss | 2 - .../ProjectManager/Source/ProjectUtils.cpp | 167 ++++++++++++++++-- .../ProjectManager/Source/ProjectUtils.h | 2 +- 3 files changed, 152 insertions(+), 19 deletions(-) diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss index 0684ec1310..74acc1c7ef 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qss +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qss @@ -435,8 +435,6 @@ QProgressBar { border: none; background-color: transparent; padding: 0px; - min-height: 14px; - font-size: 2px; } QProgressBar::chunk { diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp index f7a90f5e0c..82944aa41a 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp @@ -10,11 +10,13 @@ #include #include +#include #include #include #include #include #include +#include namespace O3DE::ProjectManager { @@ -55,7 +57,42 @@ namespace O3DE::ProjectManager return false; } - static bool CopyDirectory(const QString& origPath, const QString& newPath) + typedef AZStd::function StatusFunction; + static void RecursiveGetAllFiles(const QDir& directory, QStringList& outFileList, qint64& outTotalSizeInBytes, StatusFunction statusCallback) + { + const QStringList entries = directory.entryList(QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot); + for (const QString& entryPath : entries) + { + const QString filePath = QDir::toNativeSeparators(QString("%1/%2").arg(directory.path()).arg(entryPath)); + QFileInfo fileInfo(filePath); + + if (fileInfo.isDir()) + { + QDir subDirectory(filePath); + RecursiveGetAllFiles(subDirectory, outFileList, outTotalSizeInBytes, statusCallback); + } + else + { + outFileList.push_back(filePath); + outTotalSizeInBytes += fileInfo.size(); + + const int updateStatusEvery = 64; + if (outFileList.size() % updateStatusEvery == 0) + { + statusCallback(outFileList.size(), outTotalSizeInBytes); + } + } + } + } + + static bool CopyDirectory(QProgressDialog* progressDialog, + const QString& origPath, + const QString& newPath, + QStringList& filesToCopy, + int& outNumCopiedFiles, + qint64 totalSizeToCopy, + qint64& outCopiedFileSize, + bool& showIgnoreFileDialog) { QDir original(origPath); if (!original.exists()) @@ -65,19 +102,91 @@ namespace O3DE::ProjectManager for (QString directory : original.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (progressDialog->wasCanceled()) + { + return false; + } + QString newDirectoryPath = newPath + QDir::separator() + directory; original.mkpath(newDirectoryPath); - if (!CopyDirectory(origPath + QDir::separator() + directory, newDirectoryPath)) + if (!CopyDirectory(progressDialog, origPath + QDir::separator() + directory, + newDirectoryPath, filesToCopy, outNumCopiedFiles, totalSizeToCopy, outCopiedFileSize, showIgnoreFileDialog)) { return false; } } + QLocale locale; + const float progressDialogRangeHalf = qFabs(progressDialog->maximum() - progressDialog->minimum()) * 0.5f; for (QString file : original.entryList(QDir::Files)) { - if (!QFile::copy(origPath + QDir::separator() + file, newPath + QDir::separator() + file)) + if (progressDialog->wasCanceled()) + { return false; + } + + // Progress window update + { + // Weight in the number of already copied files as well as the copied bytes to get a better progress indication + // for cases combining many small files and some really large files. + const float normalizedNumFiles = static_cast(outNumCopiedFiles) / filesToCopy.count(); + const float normalizedFileSize = static_cast(outCopiedFileSize) / totalSizeToCopy; + const int progress = normalizedNumFiles * progressDialogRangeHalf + normalizedFileSize * progressDialogRangeHalf; + progressDialog->setValue(progress); + + const QString copiedFileSizeString = locale.formattedDataSize(outCopiedFileSize); + const QString totalFileSizeString = locale.formattedDataSize(totalSizeToCopy); + progressDialog->setLabelText(QString("Coping file %1 of %2 (%3 of %4) ...").arg(QString::number(outNumCopiedFiles), + QString::number(filesToCopy.count()), + copiedFileSizeString, + totalFileSizeString)); + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); + } + + const QString toBeCopiedFilePath = origPath + QDir::separator() + file; + const QString copyToFilePath = newPath + QDir::separator() + file; + if (!QFile::copy(toBeCopiedFilePath, copyToFilePath)) + { + // Let the user decide to ignore files that failed to copy or cancel the whole operation. + if (showIgnoreFileDialog) + { + QMessageBox ignoreFileMessageBox; + const QString text = QString("Cannot copy %1.

" + "Source: %2
" + "Destination: %3

" + "Press Yes to ignore the file, YesToAll to ignore all upcoming non-copyable files or " + "Cancel to abort duplicating the project.").arg(file, toBeCopiedFilePath, copyToFilePath); + + ignoreFileMessageBox.setModal(true); + ignoreFileMessageBox.setWindowTitle("Cannot copy file"); + ignoreFileMessageBox.setText(text); + ignoreFileMessageBox.setIcon(QMessageBox::Question); + ignoreFileMessageBox.setStandardButtons(QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::Cancel); + + int ignoreFile = ignoreFileMessageBox.exec(); + if (ignoreFile == QMessageBox::YesToAll) + { + showIgnoreFileDialog = false; + continue; + } + else if (ignoreFile == QMessageBox::Yes) + { + continue; + } + else + { + return false; + } + } + } + else + { + outNumCopiedFiles++; + + QFileInfo fileInfo(toBeCopiedFilePath); + outCopiedFileSize += fileInfo.size(); + } } return true; @@ -119,16 +228,13 @@ namespace O3DE::ProjectManager return false; } - QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - copyResult = CopyProject(origPath, newPath); - QGuiApplication::restoreOverrideCursor(); - + copyResult = CopyProject(origPath, newPath, parent); } return copyResult; } - bool CopyProject(const QString& origPath, const QString& newPath) + bool CopyProject(const QString& origPath, const QString& newPath, QWidget* parent) { // Disallow copying from or into subdirectory if (IsDirectoryDescedent(origPath, newPath) || IsDirectoryDescedent(newPath, origPath)) @@ -136,19 +242,49 @@ namespace O3DE::ProjectManager return false; } - if (!CopyDirectory(origPath, newPath)) + QStringList filesToCopy; + qint64 totalSizeInBytes = 0; + + QProgressDialog* progressDialog = new QProgressDialog(parent); + progressDialog->setAutoClose(true); + progressDialog->setValue(0); + progressDialog->setRange(0, 1000); + progressDialog->setModal(true); + progressDialog->setWindowTitle("Copying project ..."); + progressDialog->show(); + + QLocale locale; + RecursiveGetAllFiles(origPath, filesToCopy, totalSizeInBytes, [=](int fileCount, int sizeInBytes) + { + // Create a human-readable version of the file size. + const QString fileSizeString = locale.formattedDataSize(sizeInBytes); + + progressDialog->setLabelText(QString("Indexing files ... %1 files found, %2 to copy.").arg(fileCount).arg(fileSizeString)); + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); + }); + + int numFilesCopied = 0; + qint64 copiedFileSize = 0; + + // Phase 1: Copy files + bool showIgnoreFileDialog = true; + bool success = CopyDirectory(progressDialog, origPath, newPath, filesToCopy, numFilesCopied, totalSizeInBytes, copiedFileSize, showIgnoreFileDialog); + if (success) { - // Cleanup whatever mess was made - DeleteProjectFiles(newPath, true); - return false; + // Phase 2: Register project + success = RegisterProject(newPath); } - if (!RegisterProject(newPath)) + if (!success) { + progressDialog->setLabelText("Duplicating project failed/cancelled, removing already copied files ..."); + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); + DeleteProjectFiles(newPath, true); } - return true; + progressDialog->deleteLater(); + return success; } bool DeleteProjectFiles(const QString& path, bool force) @@ -184,7 +320,7 @@ namespace O3DE::ProjectManager if (!newDirectory.rename(origPath, newPath)) { // Likely failed because trying to move to another partition, try copying - if (!CopyProject(origPath, newPath)) + if (!CopyProject(origPath, newPath, parent)) { return false; } @@ -272,7 +408,6 @@ namespace O3DE::ProjectManager bool IsVS2019Installed() { static bool vs2019Installed = IsVS2019Installed_internal(); - return vs2019Installed; } diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.h b/Code/Tools/ProjectManager/Source/ProjectUtils.h index 786ff34b88..2829a45180 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.h +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.h @@ -17,7 +17,7 @@ namespace O3DE::ProjectManager bool RegisterProject(const QString& path); bool UnregisterProject(const QString& path); bool CopyProjectDialog(const QString& origPath, QWidget* parent = nullptr); - bool CopyProject(const QString& origPath, const QString& newPath); + bool CopyProject(const QString& origPath, const QString& newPath, QWidget* parent); bool DeleteProjectFiles(const QString& path, bool force = false); bool MoveProject(QString origPath, QString newPath, QWidget* parent = nullptr, bool ignoreRegister = false); From 1b530195fc0bd6e34272a5258230b6ad725acb56 Mon Sep 17 00:00:00 2001 From: jjjoness <82226755+jjjoness@users.noreply.github.com> Date: Fri, 9 Jul 2021 18:03:20 +0100 Subject: [PATCH 139/156] Clarify ImGui activation in Editor viewport (#1765) * Clarify ImGui activation in Editor viewport Signed-off-by: John Jones-Steele * All working following changes from comments in PR Signed-off-by: John Jones-Steele * One more change Signed-off-by: John Jones-Steele * fixes from comments in PR. Signed-off-by: John Jones-Steele * Fixed git merge error Signed-off-by: John Jones-Steele * Added header to ImGuiBus.h Signed-off-by: John Jones-Steele * Fix for Jenkins error Signed-off-by: John Jones-Steele * Minor typo fix Signed-off-by: John Jones-Steele --- Code/Editor/MainWindow.cpp | 13 ++++++ Code/Editor/MainWindow.h | 1 + .../UI/Outliner/OutlinerWidget.cpp | 19 +++++++-- .../UI/Outliner/OutlinerWidget.hxx | 6 +++ Code/Editor/QtViewPaneManager.cpp | 14 +++++++ Code/Editor/QtViewPaneManager.h | 9 +++- .../API/EditorWindowRequestBus.h | 41 ++++++++++++++++++- .../UI/Outliner/EntityOutlinerWidget.cpp | 19 +++++++-- .../UI/Outliner/EntityOutlinerWidget.hxx | 6 +++ .../PropertyEditor/EntityPropertyEditor.cpp | 23 +++++++++++ .../PropertyEditor/EntityPropertyEditor.hxx | 5 +++ Gems/ImGui/Code/Include/ImGuiBus.h | 30 ++++++++++++-- Gems/ImGui/Code/Source/ImGuiManager.cpp | 7 ++++ Gems/ImGui/Code/Source/ImGuiManager.h | 1 + .../LYCommonMenu/ImGuiLYAssetExplorer.cpp | 2 +- .../Source/LYCommonMenu/ImGuiLYCommonMenu.cpp | 19 +++++++++ .../LYCommonMenu/ImGuiLYEntityOutliner.cpp | 2 +- 17 files changed, 200 insertions(+), 17 deletions(-) diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index 10dfddbf8c..b2cb2fc8b6 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -41,6 +41,7 @@ AZ_POP_DISABLE_WARNING // AzToolsFramework #include +#include #include #include #include @@ -93,6 +94,8 @@ AZ_POP_DISABLE_WARNING #include "AssetEditor/AssetEditorWindow.h" #include "ActionManager.h" +#include + using namespace AZ; using namespace AzQtComponents; using namespace AzToolsFramework; @@ -489,6 +492,16 @@ void MainWindow::Initialize() ActionOverrideRequestBus::Event( GetEntityContextId(), &ActionOverrideRequests::SetupActionOverrideHandler, this); + if (auto imGuiManager = AZ::Interface::Get()) + { + auto handleImGuiStateChangeFn = [](bool enabled) + { + EditorWindowUIRequestBus::Broadcast(&EditorWindowUIRequests::SetEditorUiEnabled, enabled); + }; + m_handleImGuiStateChangeHandler = ImGui::IImGuiManager::ImGuiSetEnabledEvent::Handler(handleImGuiStateChangeFn); + imGuiManager->ConnectImGuiSetEnabledChangedHandler(m_handleImGuiStateChangeHandler); + } + AzToolsFramework::EditorEventsBus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, this); } diff --git a/Code/Editor/MainWindow.h b/Code/Editor/MainWindow.h index 34b121537d..99af2ea326 100644 --- a/Code/Editor/MainWindow.h +++ b/Code/Editor/MainWindow.h @@ -249,6 +249,7 @@ private: QPointer m_toolbarCustomizationDialog; QScopedPointer m_sourceControlNotifHandler; + AZ::Event::Handler m_handleImGuiStateChangeHandler; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING static MainWindow* m_instance; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp index d69480b169..02dabb8b20 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp @@ -269,10 +269,12 @@ OutlinerWidget::OutlinerWidget(QWidget* pParent, Qt::WindowFlags flags) AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusConnect( AzToolsFramework::GetEntityContextId()); AzToolsFramework::EditorEntityInfoNotificationBus::Handler::BusConnect(); + AzToolsFramework::EditorWindowUIRequestBus::Handler::BusConnect(); } OutlinerWidget::~OutlinerWidget() { + AzToolsFramework::EditorWindowUIRequestBus::Handler::BusDisconnect(); AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorEntityInfoNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorPickModeNotificationBus::Handler::BusDisconnect(); @@ -1321,16 +1323,25 @@ static void SetEntityOutlinerState(Ui::OutlinerWidgetUI* entityOutlinerUi, const AzQtComponents::SetWidgetInteractEnabled(entityOutlinerUi->m_searchWidget, on); } +void OutlinerWidget::EnableUi(bool enable) +{ + SetEntityOutlinerState(m_gui, enable); + setEnabled(enable); +} + +void OutlinerWidget::SetEditorUiEnabled(bool enable) +{ + EnableUi(enable); +} + void OutlinerWidget::EnteredComponentMode([[maybe_unused]] const AZStd::vector& componentModeTypes) { - SetEntityOutlinerState(m_gui, false); - setEnabled(false); + EnableUi(false); } void OutlinerWidget::LeftComponentMode([[maybe_unused]] const AZStd::vector& componentModeTypes) { - setEnabled(true); - SetEntityOutlinerState(m_gui, true); + EnableUi(true); } void OutlinerWidget::OnSliceInstantiated(const AZ::Data::AssetId& /*sliceAssetId*/, AZ::SliceComponent::SliceInstanceAddress& sliceAddress, const AzFramework::SliceInstantiationTicket& /*ticket*/) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.hxx b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.hxx index 75991424bb..aff305e0fe 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.hxx +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.hxx @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -57,6 +58,7 @@ class OutlinerWidget , private AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler , private AzToolsFramework::EditorEntityInfoNotificationBus::Handler , private AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBus::Handler + , private AzToolsFramework::EditorWindowUIRequestBus::Handler { Q_OBJECT; public: @@ -106,6 +108,9 @@ private: void EnteredComponentMode(const AZStd::vector& componentModeTypes) override; void LeftComponentMode(const AZStd::vector& componentModeTypes) override; + // EditorWindowUIRequestBus overrides + void SetEditorUiEnabled(bool enable) override; + // Build a selection object from the given entities. Entities already in the Widget's selection buffers are ignored. template QItemSelection BuildSelectionFromEntities(const EntityIdCollection& entityIds); @@ -171,6 +176,7 @@ private: AZ::EntityId GetEntityIdFromIndex(const QModelIndex& index) const; QModelIndex GetIndexFromEntityId(const AZ::EntityId& entityId) const; void ExtractEntityIdsFromSelection(const QItemSelection& selection, AzToolsFramework::EntityIdList& entityIdList) const; + void EnableUi(bool enable); // AzToolsFramework::OutlinerModelNotificationBus::Handler // Receive notification from the outliner model that we should scroll diff --git a/Code/Editor/QtViewPaneManager.cpp b/Code/Editor/QtViewPaneManager.cpp index 35b2160a1f..9f2b9f9cf8 100644 --- a/Code/Editor/QtViewPaneManager.cpp +++ b/Code/Editor/QtViewPaneManager.cpp @@ -525,6 +525,7 @@ QtViewPaneManager::QtViewPaneManager(QObject* parent) // view pane manager is interested when we enter/exit ComponentMode m_componentModeNotifications.BusConnect(AzToolsFramework::GetEntityContextId()); + m_windowRequest.BusConnect(); m_componentModeNotifications.SetEnteredComponentModeFunc( [this](const AZStd::vector& /*componentModeTypes*/) @@ -545,10 +546,23 @@ QtViewPaneManager::QtViewPaneManager(QObject* parent) AzQtComponents::SetWidgetInteractEnabled(widget, on); }); }); + + m_windowRequest.SetEnableEditorUiFunc( + [this](bool enable) + { + // gray out panels when entering ImGui mode + SetDefaultActionsEnabled( + enable, m_registeredPanes, + [](QWidget* widget, bool on) + { + AzQtComponents::SetWidgetInteractEnabled(widget, on); + }); + }); } QtViewPaneManager::~QtViewPaneManager() { + m_windowRequest.BusDisconnect(); m_componentModeNotifications.BusDisconnect(); } diff --git a/Code/Editor/QtViewPaneManager.h b/Code/Editor/QtViewPaneManager.h index aa382c41c0..2b3412aad6 100644 --- a/Code/Editor/QtViewPaneManager.h +++ b/Code/Editor/QtViewPaneManager.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -249,8 +250,12 @@ private: QPointer m_advancedDockManager; using EditorComponentModeNotificationBusImpl = AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBusImpl; - EditorComponentModeNotificationBusImpl m_componentModeNotifications; /**< Helper for EditorComponentModeNotificationBus so - * QtViewPaneManager does not need to inherit directly from it. */ + EditorComponentModeNotificationBusImpl m_componentModeNotifications; //!< Helper for EditorComponentModeNotificationBus so + //!< QtViewPaneManager does not need to inherit directly from it. */ + + using EditorWindowRequestBusImpl = AzToolsFramework::EditorWindowRequestBusImpl; + EditorWindowRequestBusImpl m_windowRequest; //!< Helper for EditorWindowRequestBus so + //!< QtViewPaneManager does not need to inherit directly from it. */ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorWindowRequestBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorWindowRequestBus.h index 03bb76b03a..ef4d2deb5e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorWindowRequestBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorWindowRequestBus.h @@ -36,8 +36,47 @@ namespace AzToolsFramework /// Retrieve the main application window. virtual QWidget* GetAppMainWindow() { return nullptr; } }; - using EditorWindowRequestBus = AZ::EBus; + + class EditorWindowUIRequests : public AZ::EBusTraits + { + public: + using Bus = AZ::EBus; + + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; + ////////////////////////////////////////////////////////////////////////// + + /// Enable/Disable the Editor UI. + virtual void SetEditorUiEnabled([[maybe_unused]] bool enable) {} + }; + using EditorWindowUIRequestBus = AZ::EBus; + + using EnableUiFunction = AZStd::function; + + /// Helper for EditorWindowRequests to be used as a + /// member instead of inheriting from EBus directly. + class EditorWindowRequestBusImpl + : public EditorWindowUIRequestBus::Handler + { + public: + /// Set the function to be called when entering ImGui Mode. + void SetEnableEditorUiFunc(const EnableUiFunction enableEditorUiFunc) + { + m_enableEditorUiFunc = AZStd::move(enableEditorUiFunc); + } + + private: + // EditorWindowRequestBus + void SetEditorUiEnabled( [[maybe_unused]] bool enable) override + { + m_enableEditorUiFunc(enable); + } + + EnableUiFunction m_enableEditorUiFunc; ///< Function to call when entering ImGui Mode. + }; + } // namespace AzToolsFramework #endif // AZTOOLSFRAMEWORK_EDITORWINDOWREQUESTBUS_H diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index 96479bb54c..03784343f5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -291,10 +291,12 @@ namespace AzToolsFramework GetEntityContextId()); EditorEntityInfoNotificationBus::Handler::BusConnect(); Prefab::PrefabPublicNotificationBus::Handler::BusConnect(); + EditorWindowUIRequestBus::Handler::BusConnect(); } EntityOutlinerWidget::~EntityOutlinerWidget() { + EditorWindowUIRequestBus::Handler::BusDisconnect(); Prefab::PrefabPublicNotificationBus::Handler::BusDisconnect(); ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusDisconnect(); EditorEntityInfoNotificationBus::Handler::BusDisconnect(); @@ -1106,16 +1108,25 @@ namespace AzToolsFramework AzQtComponents::SetWidgetInteractEnabled(entityOutlinerUi->m_searchWidget, on); } + void EntityOutlinerWidget::EnableUi(bool enable) + { + SetEntityOutlinerState(m_gui, enable); + setEnabled(enable); + } + + void EntityOutlinerWidget::SetEditorUiEnabled(bool enable) + { + EnableUi(enable); + } + void EntityOutlinerWidget::EnteredComponentMode([[maybe_unused]] const AZStd::vector& componentModeTypes) { - SetEntityOutlinerState(m_gui, false); - setEnabled(false); + EnableUi(false); } void EntityOutlinerWidget::LeftComponentMode([[maybe_unused]] const AZStd::vector& componentModeTypes) { - setEnabled(true); - SetEntityOutlinerState(m_gui, true); + EnableUi(true); } void EntityOutlinerWidget::OnPrefabInstancePropagationBegin() diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx index 68f538c3ff..e3f9ad2135 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -58,6 +59,7 @@ namespace AzToolsFramework , private EditorEntityInfoNotificationBus::Handler , private ComponentModeFramework::EditorComponentModeNotificationBus::Handler , private Prefab::PrefabPublicNotificationBus::Handler + , private EditorWindowUIRequestBus::Handler { Q_OBJECT; public: @@ -105,6 +107,9 @@ namespace AzToolsFramework void OnPrefabInstancePropagationBegin() override; void OnPrefabInstancePropagationEnd() override; + // EditorWindowUIRequestBus overrides + void SetEditorUiEnabled(bool enable) override; + // Build a selection object from the given entities. Entities already in the Widget's selection buffers are ignored. template QItemSelection BuildSelectionFromEntities(const EntityIdCollection& entityIds); @@ -155,6 +160,7 @@ namespace AzToolsFramework AZ::EntityId GetEntityIdFromIndex(const QModelIndex& index) const; QModelIndex GetIndexFromEntityId(const AZ::EntityId& entityId) const; void ExtractEntityIdsFromSelection(const QItemSelection& selection, EntityIdList& entityIdList) const; + void EnableUi(bool enable); // OutlinerModelNotificationBus::Handler // Receive notification from the outliner model that we should scroll diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp index 6a399ad816..5d1ec93fda 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp @@ -376,6 +376,7 @@ namespace AzToolsFramework ToolsApplicationEvents::Bus::Handler::BusConnect(); AZ::EntitySystemBus::Handler::BusConnect(); EntityPropertyEditorRequestBus::Handler::BusConnect(); + EditorWindowUIRequestBus::Handler::BusConnect(); m_spacer = nullptr; m_emptyIcon = QIcon(); @@ -421,6 +422,7 @@ namespace AzToolsFramework { qApp->removeEventFilter(this); + EditorWindowUIRequestBus::Handler::BusDisconnect(); EntityPropertyEditorRequestBus::Handler::BusDisconnect(); ToolsApplicationEvents::Bus::Handler::BusDisconnect(); AZ::EntitySystemBus::Handler::BusDisconnect(); @@ -4961,6 +4963,27 @@ namespace AzToolsFramework EnableDisableComponentActions(widget, actions, false); } + void EntityPropertyEditor::SetEditorUiEnabled(bool enable) + { + if (enable) + { + EnableComponentActions(this, m_entityComponentActions); + } + else + { + DisableComponentActions(this, m_entityComponentActions); + } + m_disabled = !enable; + SetPropertyEditorState(m_gui, enable); + + for (auto componentEditor : m_componentEditors) + { + AzQtComponents::SetWidgetInteractEnabled(componentEditor, enable); + } + // record the selected state after entering/leaving component mode + SaveComponentEditorState(); + } + void EntityPropertyEditor::EnteredComponentMode(const AZStd::vector& componentModeTypes) { DisableComponentActions(this, m_entityComponentActions); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx index b15e27e41a..f2ff4eb927 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -108,6 +109,7 @@ namespace AzToolsFramework , public EditorInspectorComponentNotificationBus::MultiHandler , private AzToolsFramework::ComponentModeFramework::EditorComponentModeNotificationBus::Handler , public AZ::EntitySystemBus::Handler + , private EditorWindowUIRequestBus::Handler { Q_OBJECT; public: @@ -208,6 +210,9 @@ namespace AzToolsFramework void GetSelectedEntities(EntityIdList& selectedEntityIds) override; void SetNewComponentId(AZ::ComponentId componentId) override; + // EditorWindowRequestBus overrides + void SetEditorUiEnabled(bool enable) override; + bool IsEntitySelected(const AZ::EntityId& id) const; bool IsSingleEntitySelected(const AZ::EntityId& id) const; diff --git a/Gems/ImGui/Code/Include/ImGuiBus.h b/Gems/ImGui/Code/Include/ImGuiBus.h index ea7fe1631e..06a3b472da 100644 --- a/Gems/ImGui/Code/Include/ImGuiBus.h +++ b/Gems/ImGui/Code/Include/ImGuiBus.h @@ -8,6 +8,7 @@ #pragma once #include +#include // Forward Declares struct ImVec2; @@ -86,9 +87,19 @@ namespace ImGui virtual void SetImGuiRenderResolution(const ImVec2& res) = 0; virtual void OverrideRenderWindowSize(uint32_t width, uint32_t height) = 0; virtual void RestoreRenderWindowSizeToDefault() = 0; + virtual void ToggleThroughImGuiVisibleState() = 0; virtual void SetDpiScalingFactor(float dpiScalingFactor) = 0; virtual float GetDpiScalingFactor() const = 0; virtual void Render() = 0; + + using ImGuiSetEnabledEvent = AZ::Event; + ImGuiSetEnabledEvent m_setEnabledEvent; + + // interface + void ConnectImGuiSetEnabledChangedHandler(ImGuiSetEnabledEvent::Handler& handler) + { + handler.Connect(m_setEnabledEvent); + } }; class IImGuiManagerRequests @@ -101,19 +112,30 @@ namespace ImGui }; using ImGuiManagerBus = AZ::EBus; + class IImGuiManagerNotifications : public AZ::EBusTraits + { + public: + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + using Bus = AZ::EBus; + + virtual void ImGuiSetEnabled( [[maybe_unused]] bool enabled) {} + }; + using ImGuiManagerNotificationBus = AZ::EBus; + // Bus for getting notifications from the IMGUI Entity Outliner - class IImGuiEntityOutlinerNotifcations : public AZ::EBusTraits + class IImGuiEntityOutlinerNotifications : public AZ::EBusTraits { public: - static const char* GetUniqueName() { return "IImGuiEntityOutlinerNotifcations"; } + static const char* GetUniqueName() { return "IImGuiEntityOutlinerNotifications"; } static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - using Bus = AZ::EBus; + using Bus = AZ::EBus; // Callback for game code to handle targetting an IMGUI entity virtual void OnImGuiEntityOutlinerTarget(AZ::EntityId target) { (void)target; } }; - typedef AZ::EBus ImGuiEntityOutlinerNotifcationBus; + typedef AZ::EBus ImGuiEntityOutlinerNotificationBus; // a pair of an entity id, and a typeid, used to represent component rtti type info typedef AZStd::pair ImGuiEntComponentId; diff --git a/Gems/ImGui/Code/Source/ImGuiManager.cpp b/Gems/ImGui/Code/Source/ImGuiManager.cpp index 42c8d3929c..7b2506fbcb 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.cpp +++ b/Gems/ImGui/Code/Source/ImGuiManager.cpp @@ -738,8 +738,15 @@ void ImGuiManager::ToggleThroughImGuiVisibleState(int controllerIndex) } m_menuBarStatusChanged = true; + m_setEnabledEvent.Signal(m_clientMenuBarState == DisplayState::Hidden); } +void ImGuiManager::ToggleThroughImGuiVisibleState() +{ + ToggleThroughImGuiVisibleState(-1); +} + + void ImGuiManager::RenderImGuiBuffers(const ImVec2& scaleRects) { ImGui::ImGuiContextScope contextScope(m_imguiContext); diff --git a/Gems/ImGui/Code/Source/ImGuiManager.h b/Gems/ImGui/Code/Source/ImGuiManager.h index 1509f27c57..02af3d0c09 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.h +++ b/Gems/ImGui/Code/Source/ImGuiManager.h @@ -60,6 +60,7 @@ namespace ImGui void SetDpiScalingFactor(float dpiScalingFactor) override; float GetDpiScalingFactor() const override; void Render() override; + void ToggleThroughImGuiVisibleState() override; // -- ImGuiManagerBus Interface ------------------------------------------------------------------- // -- AzFramework::InputChannelEventListener and AzFramework::InputTextEventListener Interface ------------ diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp index 2f996f5768..d9d81c24f2 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp @@ -465,7 +465,7 @@ namespace ImGui ImGui::BeginGroup(); if (ImGui::SmallButton(AZStd::string::format("-View #%03d-##%s", ++instanceCount, meshInstance.first.ToString().c_str()).c_str())) { - ImGuiEntityOutlinerNotifcationBus::Broadcast(&IImGuiEntityOutlinerNotifcations::OnImGuiEntityOutlinerTarget, meshInstance.first); + ImGuiEntityOutlinerNotificationBus::Broadcast(&IImGuiEntityOutlinerNotifications::OnImGuiEntityOutlinerTarget, meshInstance.first); } // Build the Label String. ImGui::SameLine(); diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp index 9994851faa..eb918041f7 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp @@ -571,7 +571,26 @@ namespace ImGui // End LY Common Tools menu ImGui::EndMenu(); } + const int labelSize{ 100 }; + const int buttonSize{ 40 }; ImGuiUpdateListenerBus::Broadcast(&IImGuiUpdateListener::OnImGuiMainMenuUpdate); + ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - labelSize); + float backgroundHeight = ImGui::GetTextLineHeight() + 3; + ImVec2 cursorPos = ImGui::GetCursorScreenPos(); + ImGui::GetWindowDrawList()->AddRectFilled( + cursorPos, ImVec2(cursorPos.x + labelSize, cursorPos.y + backgroundHeight), IM_COL32(0, 115, 187, 255)); + ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - labelSize); + ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 1); + ImGui::Text("ImGui:ON"); + ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - buttonSize); + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 0, 0, 255)); + ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32(255, 255, 255, 255)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32(128, 128, 128, 255)); + if (ImGui::SmallButton("home")) + { + ImGuiManagerBus::Broadcast(&IImGuiManager::ToggleThroughImGuiVisibleState); + } + ImGui::PopStyleColor(3); ImGui::EndMainMenuBar(); } diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp index aca52af238..57502296ae 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp @@ -590,7 +590,7 @@ namespace ImGui if (ImGui::SmallButton(targetLabel.c_str())) { // Send EBUS event out to Target an Entity. Up to game code to implement. - ImGuiEntityOutlinerNotifcationBus::Broadcast(&IImGuiEntityOutlinerNotifcations::OnImGuiEntityOutlinerTarget, node->m_entityId); + ImGuiEntityOutlinerNotificationBus::Broadcast(&IImGuiEntityOutlinerNotifications::OnImGuiEntityOutlinerTarget, node->m_entityId); } } From e06ec2caa903260f9ce2de90e0be9bfba90ed747 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 9 Jul 2021 12:19:42 -0500 Subject: [PATCH 140/156] Fixed cmake configuring when using an External Gem (#2020) The ly_get_absolute_pal_filename method has been refactored to no longer use regular expressions to determine how to split a PAL directory, but instead Path operations are used Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Templates/DefaultGem/Template/CMakeLists.txt | 8 +- cmake/PAL.cmake | 138 ++++++++++--------- 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/Templates/DefaultGem/Template/CMakeLists.txt b/Templates/DefaultGem/Template/CMakeLists.txt index d00a5f0128..5ea435a790 100644 --- a/Templates/DefaultGem/Template/CMakeLists.txt +++ b/Templates/DefaultGem/Template/CMakeLists.txt @@ -10,13 +10,7 @@ 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) -# Currently we are in the DefaultProjectSource folder: ${CMAKE_CURRENT_LIST_DIR} -# Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform -# in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here: DefaultProjectSource/Platform/ or -# //DefaultProjectSource -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) +ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${o3de_gem_restricted_path}" ${o3de_gem_path} ${o3de_gem_name}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # project cmake for this platform. diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index 11541d395a..c51b39482f 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -29,7 +29,8 @@ function(o3de_restricted_id o3de_json_file restricted) ly_file_read(${o3de_json_file} json_data) string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name") if(json_error) - message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}") + # Restricted fields can never be a requirement so no warning is issued + return() endif() if(restricted_entry) set(${restricted} ${restricted_entry} PARENT_SCOPE) @@ -148,86 +149,89 @@ function(ly_get_absolute_pal_filename out_name in_name) set(full_name ${in_name}) if(${ARGC} GREATER 4) - # The user has supplied an object restricted path, the object path and the object name for consideration - set(object_restricted_path ${ARGV2}) - set(object_path ${ARGV3}) + # The object name is used to resolve ambiguities when a PAL directory is requested from + # two different external subdirectory root paths + # Such as if a PAL directory for two root object paths with same relative structure was requested to be Palified + # i.e /Platform//IO and /Platform//IO + # Normally the restricted PAL path for both gems would be "//IO". + # The object name can be used to make this path unique + # "///IO" for gem 1 and + # "///IO" for gem 2 set(object_name ${ARGV4}) + endif() - # if the file is not in the object path then we cannot determine a PAL file for it - file(RELATIVE_PATH relative_path ${object_path} ${full_name}) - if (NOT (IS_ABSOLUTE relative_path OR relative_path MATCHES [[^(\.\./)+(.*)]])) - if (NOT EXISTS ${full_name}) - string(REGEX MATCH "${object_path}/(.*)/Platform/([^/]*)/?(.*)$" match ${full_name}) - if(NOT CMAKE_MATCH_1) - string(REGEX MATCH "${object_path}/Platform/([^/]*)/?(.*)$" match ${full_name}) - set(full_name ${object_restricted_path}/${CMAKE_MATCH_1}/${object_name}) - if(CMAKE_MATCH_2) - string(APPEND full_name "/" ${CMAKE_MATCH_2}) - endif() - elseif("${CMAKE_MATCH_2}" IN_LIST PAL_RESTRICTED_PLATFORMS) - set(full_name ${object_restricted_path}/${CMAKE_MATCH_2}/${object_name}/${CMAKE_MATCH_1}) - if(CMAKE_MATCH_3) - string(APPEND full_name "/" ${CMAKE_MATCH_3}) - endif() - endif() - endif() - endif() - set(${out_name} ${full_name} PARENT_SCOPE) - - elseif(${ARGC} GREATER 3) + # The Default object path for path is the LY_ROOT_FOLDER + cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") + if(${ARGC} GREATER 3) # The user has supplied an object restricted path, the object path for consideration - set(object_restricted_path ${ARGV2}) - set(object_path ${ARGV3}) + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() + + # The Default restricted object path is the result of the read_engine_restricted_path function + cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") + if(${ARGC} GREATER 2) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() + # The input path must exist in order to form a PAL path + if (NOT EXISTS ${full_name}) # if the file is not in the object path then we cannot determine a PAL file for it - file(RELATIVE_PATH relative_path ${object_path} ${full_name}) - if (NOT (IS_ABSOLUTE relative_path OR relative_path MATCHES [[^(\.\./)+(.*)]])) - if (NOT EXISTS ${full_name}) - string(REGEX MATCH "${object_path}/(.*)/Platform/([^/]*)/?(.*)$" match ${full_name}) - if(NOT CMAKE_MATCH_1) - string(REGEX MATCH "${object_path}/Platform/([^/]*)/?(.*)$" match ${full_name}) - set(full_name ${object_restricted_path}/${CMAKE_MATCH_1}) - if(CMAKE_MATCH_2) - string(APPEND full_name "/" ${CMAKE_MATCH_2}) - endif() - elseif("${CMAKE_MATCH_2}" IN_LIST PAL_RESTRICTED_PLATFORMS) - set(full_name ${object_restricted_path}/${CMAKE_MATCH_2}/${CMAKE_MATCH_1}) - if(CMAKE_MATCH_3) - string(APPEND full_name "/" ${CMAKE_MATCH_3}) - endif() + cmake_path(IS_PREFIX object_path ${full_name} is_input_path_in_root) + if(is_input_path_in_root) + cmake_path(RELATIVE_PATH full_name BASE_DIRECTORY ${object_path} OUTPUT_VARIABLE relative_object_path) + cmake_path(SET current_object_path ${relative_object_path}) + + # Remove one path segment from the end of the current_object_path and prepend it to the list path_segments + cmake_path(GET current_object_path PARENT_PATH parent_path) + cmake_path(GET current_object_path FILENAME path_segment) + list(PREPEND path_segments_visited path_segment) + cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment) + cmake_path(SET current_object_path "${parent_path}") + + while(is_prev_path_segment) + # The Path is in a PAL structure + # Decompose the path into sections before "Platform" and after "Platform" + if(path_segment STREQUAL "Platform") + # The first path segment after the "/Platform/" + # is a potential platform name. Store it off for later checks + list(GET path_segments_visited 0 candidate_platform_name) + + # Store off all the path segments iterated from the end in the post-"Platform" path + cmake_path(APPEND post_platform_paths ${path_segments_visited}) + # The parent path is just the pre-"Platform" section of the path + cmake_path(SET pre_platform_paths "${parent_path}") + break() endif() - endif() - endif() - set(${out_name} ${full_name} PARENT_SCOPE) - - else() - # The user has not supplied any path so we must assume it is the o3de engine restricted and o3de engine path - # if the file is not in the o3de engine path then we cannot determine a PAL file for it - file(RELATIVE_PATH relative_path ${LY_ROOT_FOLDER} ${full_name}) - if (NOT (IS_ABSOLUTE relative_path OR relative_path MATCHES [[^(\.\./)+(.*)]])) - if (NOT EXISTS ${full_name}) - string(REGEX MATCH "${LY_ROOT_FOLDER}/(.*)/Platform/([^/]*)/?(.*)$" match ${full_name}) - if(NOT CMAKE_MATCH_1) - string(REGEX MATCH "${LY_ROOT_FOLDER}/Platform/([^/]*)/?(.*)$" match ${full_name}) - set(full_name ${O3DE_ENGINE_RESTRICTED_PATH}/${CMAKE_MATCH_1}) - if(CMAKE_MATCH_2) - string(APPEND full_name "/" ${CMAKE_MATCH_2}) - endif() - elseif("${CMAKE_MATCH_2}" IN_LIST PAL_RESTRICTED_PLATFORMS) - set(full_name ${O3DE_ENGINE_RESTRICTED_PATH}/${CMAKE_MATCH_2}/${CMAKE_MATCH_1}) - if(CMAKE_MATCH_3) - string(APPEND full_name "/" ${CMAKE_MATCH_3}) - endif() + + # Remove one path segment from the end of the current_object_path and prepend it to the list path_segments + cmake_path(GET current_object_path PARENT_PATH parent_path) + cmake_path(GET current_object_path FILENAME path_segment) + list(PREPEND path_segments_visited path_segment) + cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment) + cmake_path(SET current_object_path "${parent_path}") + endwhile() + + # Compose a candidate restricted path and examine if it exists + cmake_path(APPEND object_restricted_path ${pre_platform_paths} "Platform" ${post_platform_paths} + OUTPUT_VARIABLE candidate_PAL_path) + if(NOT EXISTS ${candidate_PAL_path}) + if("${candidate_platform_name}" IN_LIST PAL_RESTRICTED_PLATFORMS) + cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${object_name} + ${pre_platform_paths} ${post_platform_paths} OUTPUT_VARIABLE candidate_PAL_path) endif() endif() + if(EXISTS ${candidate_PAL_path}) + cmake_path(SET full_name ${candidate_PAL_path}) + endif() endif() - set(${out_name} ${full_name} PARENT_SCOPE) endif() + set(${out_name} ${full_name} PARENT_SCOPE) endfunction() function(ly_get_list_relative_pal_filename out_name in_name) ly_get_absolute_pal_filename(abs_name ${in_name} ${ARGN}) - file(RELATIVE_PATH relative_name ${CMAKE_CURRENT_LIST_DIR} ${abs_name}) + cmake_path(RELATIVE_PATH abs_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE relative_name) set(${out_name} ${relative_name} PARENT_SCOPE) endfunction() From a40c979baa570a07e705e006eba4bda6638d01b1 Mon Sep 17 00:00:00 2001 From: jromnoa Date: Fri, 9 Jul 2021 10:24:07 -0700 Subject: [PATCH 141/156] move test to sandbox instead of disabling it Signed-off-by: jromnoa --- .../Gem/PythonTests/smoke/CMakeLists.txt | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 9951b448d8..73af69b93a 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -52,16 +52,17 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) AutomatedTesting.Assets ) -# ly_add_pytest( -# NAME AutomatedTesting::GameLauncherWithGPU -# TEST_REQUIRES gpu -# PATH ${CMAKE_CURRENT_LIST_DIR}/test_GameLauncher_EnterExitGameMode_Works.py -# TIMEOUT 100 -# RUNTIME_DEPENDENCIES -# AZ::AssetProcessor -# AZ::PythonBindingsExample -# Legacy::Editor -# AutomatedTesting.GameLauncher -# AutomatedTesting.Assets -# ) + ly_add_pytest( + NAME AutomatedTesting::GameLauncherWithGPU + TEST_SUITE sandbox + TEST_REQUIRES gpu + PATH ${CMAKE_CURRENT_LIST_DIR}/test_GameLauncher_EnterExitGameMode_Works.py + TIMEOUT 100 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + AZ::PythonBindingsExample + Legacy::Editor + AutomatedTesting.GameLauncher + AutomatedTesting.Assets + ) endif() From 8a76ec713efeaa5196fec21e60c473993f132f42 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 9 Jul 2021 12:41:43 -0500 Subject: [PATCH 142/156] Updated the SettingsRegistry Specialization tag name max size to 64 (#2016) The tag name max size should match the maximum size of a project name, since the project name is automatically added as a specialization tag in the settings registry when loading .setreg files from within the /Registry directory Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../AzCore/AzCore/Settings/SettingsRegistry.cpp | 9 +++++++++ Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.cpp index efbc0eaa1f..5a709f9324 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.cpp +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.cpp @@ -32,6 +32,15 @@ namespace AZ { if (m_hashes.size() < m_hashes.max_size()) { + constexpr size_t MaxTagSize = TagName{}.max_size(); + if (specialization.size() > MaxTagSize) + { + AZ_Error("Settings Registry", false, R"(Cannot append Specialization tag of "%.*s.")" + " It is longer than the MaxTagNameSize of %zu", AZ_STRING_ARG(specialization), + MaxTagSize); + return false; + } + m_names.push_back(TagName{ specialization }); TagName& tag = m_names.back(); AZStd::to_lower(tag.begin(), tag.end()); diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.h b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.h index baeca89636..f0077db2ca 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.h +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistry.h @@ -49,7 +49,7 @@ namespace AZ class Specializations { public: - static constexpr size_t MaxTagNameSize = 32; + static constexpr size_t MaxTagNameSize = 64; static constexpr size_t MaxCount = 15; static constexpr size_t NotFound = static_cast(-1); using TagName = AZStd::fixed_string; From 6ebf3a93d19cf78117a61edf52cb6db9f1b848b4 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 9 Jul 2021 12:56:29 -0500 Subject: [PATCH 143/156] Added protection in the register python script queries of the default folders against a non-existent key causing a KeyError in python (#1946) Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../ProjectManager/Source/PythonBindings.cpp | 17 +++++++---- scripts/o3de/o3de/register.py | 29 ++++++++++--------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 167cf6d10e..f8e90b0a59 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -394,13 +394,20 @@ namespace O3DE::ProjectManager if (pybind11::isinstance(o3deData)) { engineInfo.m_path = Py_To_String(enginePath); - engineInfo.m_defaultGemsFolder = Py_To_String(o3deData["default_gems_folder"]); - engineInfo.m_defaultProjectsFolder = Py_To_String(o3deData["default_projects_folder"]); - engineInfo.m_defaultRestrictedFolder = Py_To_String(o3deData["default_restricted_folder"]); - engineInfo.m_defaultTemplatesFolder = Py_To_String(o3deData["default_templates_folder"]); + auto defaultGemsFolder = m_manifest.attr("get_o3de_gems_folder")(); + engineInfo.m_defaultGemsFolder = Py_To_String_Optional(o3deData, "default_gems_folder", Py_To_String(defaultGemsFolder)); + + auto defaultProjectsFolder = m_manifest.attr("get_o3de_projects_folder")(); + engineInfo.m_defaultProjectsFolder = Py_To_String_Optional(o3deData, "default_projects_folder", Py_To_String(defaultProjectsFolder)); + + auto defaultRestrictedFolder = m_manifest.attr("get_o3de_restricted_folder")(); + engineInfo.m_defaultRestrictedFolder = Py_To_String_Optional(o3deData, "default_restricted_folder", Py_To_String(defaultRestrictedFolder)); + + auto defaultTemplatesFolder = m_manifest.attr("get_o3de_templates_folder")(); + engineInfo.m_defaultTemplatesFolder = Py_To_String_Optional(o3deData, "default_templates_folder", Py_To_String(defaultTemplatesFolder)); auto defaultThirdPartyFolder = m_manifest.attr("get_o3de_third_party_folder")(); - engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData,"default_third_party_folder", Py_To_String(defaultThirdPartyFolder)); + engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData, "default_third_party_folder", Py_To_String(defaultThirdPartyFolder)); } auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index ff4ccdc0a6..9d1d6e3122 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -253,7 +253,8 @@ def add_engine_name_to_path(json_data: dict, engine_path: pathlib.Path, force: b logger.error( f'Attempting to register existing engine "{engine_name}" with a new path of {engine_path.as_posix()}.' f' The current path is {pathlib.Path(engines_path_json[engine_name]).as_posix()}.' - f' To force registration of a new engine path, specify the -f/--force option.') + f' To force registration of a new engine path, specify the -f/--force option.' + f'\nAlternatively the engine can be registered with a different name by changing the "engine_name" field in the engine.json.') return 1 engines_path_json[engine_name] = engine_path.as_posix() return 0 @@ -665,7 +666,7 @@ def remove_invalid_o3de_projects(manifest_path: pathlib.Path = None) -> int: result = 0 - for project in json_data['projects']: + for project in json_data.get('projects', []): if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): logger.warn(f"Project path {project} is invalid.") # Attempt to unregister all invalid projects even if previous projects failed to unregister @@ -677,36 +678,36 @@ def remove_invalid_o3de_projects(manifest_path: pathlib.Path = None) -> int: def remove_invalid_o3de_objects() -> None: json_data = manifest.load_o3de_manifest() - for engine_object in json_data['engines']: - engine_path = engine_object['path'] + for engine_object in json_data.get('engines', []): + engine_path = engine_object.get('path', '') if not validation.valid_o3de_engine_json(pathlib.Path(engine_path).resolve() / 'engine.json'): logger.warn(f"Engine path {engine_path} is invalid.") register(engine_path=engine_path, remove=True) remove_invalid_o3de_projects() - for gem in json_data['gems']: + for gem in json_data.get('gems', []): if not validation.valid_o3de_gem_json(pathlib.Path(gem).resolve() / 'gem.json'): logger.warn(f"Gem path {gem} is invalid.") register(gem_path=gem, remove=True) - for external in json_data['external_subdirectories']: + for external in json_data.get('external_subdirectories', []): external = pathlib.Path(external).resolve() if not external.is_dir(): logger.warn(f"External subdirectory {external} is invalid.") register(engine_path=engine_path, external_subdir_path=external, remove=True) - for template in json_data['templates']: + for template in json_data.get('templates', []): if not validation.valid_o3de_template_json(pathlib.Path(template).resolve() / 'template.json'): logger.warn(f"Template path {template} is invalid.") register(template_path=template, remove=True) - for restricted in json_data['restricted']: + for restricted in json_data.get('restricted', []): if not validation.valid_o3de_restricted_json(pathlib.Path(restricted).resolve() / 'restricted.json'): logger.warn(f"Restricted path {restricted} is invalid.") register(restricted_path=restricted, remove=True) - default_engines_folder = pathlib.Path(json_data['default_engines_folder']).resolve() + default_engines_folder = pathlib.Path(json_data.get('default_engines_folder', manifest.get_o3de_engines_folder())).resolve() if not default_engines_folder.is_dir(): new_default_engines_folder = manifest.get_o3de_folder() / 'Engines' new_default_engines_folder.mkdir(parents=True, exist_ok=True) @@ -714,7 +715,7 @@ def remove_invalid_o3de_objects() -> None: f"Default engines folder {default_engines_folder} is invalid. Set default {new_default_engines_folder}") register(default_engines_folder=new_default_engines_folder.as_posix()) - default_projects_folder = pathlib.Path(json_data['default_projects_folder']).resolve() + default_projects_folder = pathlib.Path(json_data.get('default_projects_folder', manifest.get_o3de_projects_folder())).resolve() if not default_projects_folder.is_dir(): new_default_projects_folder = manifest.get_o3de_folder() / 'Projects' new_default_projects_folder.mkdir(parents=True, exist_ok=True) @@ -722,7 +723,7 @@ def remove_invalid_o3de_objects() -> None: f"Default projects folder {default_projects_folder} is invalid. Set default {new_default_projects_folder}") register(default_projects_folder=new_default_projects_folder.as_posix()) - default_gems_folder = pathlib.Path(json_data['default_gems_folder']).resolve() + default_gems_folder = pathlib.Path(json_data.get('default_gems_folder', manifest.get_o3de_gems_folder())).resolve() if not default_gems_folder.is_dir(): new_default_gems_folder = manifest.get_o3de_folder() / 'Gems' new_default_gems_folder.mkdir(parents=True, exist_ok=True) @@ -730,7 +731,7 @@ def remove_invalid_o3de_objects() -> None: f" Set default {new_default_gems_folder}") register(default_gems_folder=new_default_gems_folder.as_posix()) - default_templates_folder = pathlib.Path(json_data['default_templates_folder']).resolve() + default_templates_folder = pathlib.Path(json_data.get('default_templates_folder', manifest.get_o3de_templates_folder())).resolve() if not default_templates_folder.is_dir(): new_default_templates_folder = manifest.get_o3de_folder() / 'Templates' new_default_templates_folder.mkdir(parents=True, exist_ok=True) @@ -739,7 +740,7 @@ def remove_invalid_o3de_objects() -> None: f" Set default {new_default_templates_folder}") register(default_templates_folder=new_default_templates_folder.as_posix()) - default_restricted_folder = pathlib.Path(json_data['default_restricted_folder']).resolve() + default_restricted_folder = pathlib.Path(json_data.get('default_restricted_folder', manifest.get_o3de_restricted_folder())).resolve() if not default_restricted_folder.is_dir(): default_restricted_folder = manifest.get_o3de_folder() / 'Restricted' default_restricted_folder.mkdir(parents=True, exist_ok=True) @@ -748,7 +749,7 @@ def remove_invalid_o3de_objects() -> None: f" Set default {default_restricted_folder}") register(default_restricted_folder=default_restricted_folder.as_posix()) - default_third_party_folder = pathlib.Path(json_data['default_third_party_folder']).resolve() + default_third_party_folder = pathlib.Path(json_data.get('default_third_party_folder', manifest.get_o3de_third_party_folder())).resolve() if not default_third_party_folder.is_dir(): default_third_party_folder = manifest.get_o3de_folder() / '3rdParty' default_third_party_folder.mkdir(parents=True, exist_ok=True) From 7ce6eec39e77035aac2ac7b4ada41ae478c70a82 Mon Sep 17 00:00:00 2001 From: jackalbe <23512001+jackalbe@users.noreply.github.com> Date: Fri, 9 Jul 2021 13:36:33 -0500 Subject: [PATCH 144/156] {SPEC-7645} Disabling FileWatcherUnitTests for Linux (#2012) * Disabling FileWatcherUnitTests for Linux Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com> * added comments to explain the update Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com> --- .../native/unittests/FileWatcherUnitTests.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp index 2ffe6a7996..dd39283b22 100644 --- a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * + * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ @@ -277,7 +277,7 @@ void FileWatcherUnitTestRunner::StartTest() UNIT_TEST_EXPECT_TRUE(QDir::toNativeSeparators(fileAddName).toLower() == QDir::toNativeSeparators(newName3).toLower()); #if !defined(AZ_PLATFORM_LINUX) - // final test... make sure that renaming a DIRECTORY works too. + // final test... make sure that renaming a DIRECTORY works too. // Note that linux does not get any callbacks if just the directory is renamed (from inotify) QDir renamer; fileAddCalled = false; @@ -312,6 +312,9 @@ void FileWatcherUnitTestRunner::StartTest() Q_EMIT UnitTestPassed(); } -#if !AZ_TRAIT_DISABLE_FAILED_ASSET_PROCESSOR_TESTS +// File operations on Linux behave differently on Linux than Windows. +// The system under test doesn't yet handle Linux's file operations, which surfaced as this test arbitrarily passing and failing. +// This test is disabled on Linux until the system under test can handle Linux file system behavior correctly. +#if !AZ_TRAIT_DISABLE_FAILED_ASSET_PROCESSOR_TESTS && !defined(AZ_PLATFORM_LINUX) REGISTER_UNIT_TEST(FileWatcherUnitTestRunner) #endif // !AZ_TRAIT_DISABLE_FAILED_ASSET_PROCESSOR_TESTS From 4475528df236fe0340431c16b2af4d8ac955e6d1 Mon Sep 17 00:00:00 2001 From: moraaar Date: Fri, 9 Jul 2021 19:48:04 +0100 Subject: [PATCH 145/156] Fixed Event Hander's copy constructor and copy assignments It was missing to save the event before connecting to it. (#2026) Signed-off-by: moraaar --- Code/Framework/AzCore/AzCore/EBus/Event.inl | 23 ++++++++--- Code/Framework/AzCore/Tests/EventTests.cpp | 42 +++++++++++++++++++++ 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/EBus/Event.inl b/Code/Framework/AzCore/AzCore/EBus/Event.inl index 006ff81e34..493dea4a3f 100644 --- a/Code/Framework/AzCore/AzCore/EBus/Event.inl +++ b/Code/Framework/AzCore/AzCore/EBus/Event.inl @@ -27,11 +27,17 @@ namespace AZ template EventHandler::EventHandler(const EventHandler& rhs) : m_callback(rhs.m_callback) + , m_event(rhs.m_event) { - // Copy the callback function, then perform a Connect with the new event - if (rhs.m_event) + // Copy the callback and event, then perform a Connect to the event + if (m_callback && m_event) + { + m_event->Connect(*this); + } + else { - rhs.m_event->Connect(*this); + // It was not possible to connect to the event, set it to nullptr + m_event = nullptr; } } @@ -65,9 +71,16 @@ namespace AZ { Disconnect(); m_callback = rhs.m_callback; - if (rhs.m_event) + m_event = rhs.m_event; + // Copy the callback and event, then perform a Connect to the event + if (m_callback && m_event) + { + m_event->Connect(*this); + } + else { - rhs.m_event->Connect(*this); + // It was not possible to connect to the event, set it to nullptr + m_event = nullptr; } } diff --git a/Code/Framework/AzCore/Tests/EventTests.cpp b/Code/Framework/AzCore/Tests/EventTests.cpp index 7640201e0d..571bdd5345 100644 --- a/Code/Framework/AzCore/Tests/EventTests.cpp +++ b/Code/Framework/AzCore/Tests/EventTests.cpp @@ -257,6 +257,48 @@ namespace UnitTest EXPECT_FALSE(testEvent1.HasHandlerConnected()); EXPECT_TRUE(testEvent2.HasHandlerConnected()); } + + TEST_F(EventTests, TestHandlerCopyConstructorOperator) + { + int32_t invokedCounter = 0; + + AZ::Event<> testEvent; + AZ::Event<>::Handler testHandler([&invokedCounter]() { invokedCounter++; }); + + testHandler.Connect(testEvent); + + AZ::Event<>::Handler testHandler2(testHandler); + + EXPECT_TRUE(testHandler.IsConnected()); + EXPECT_TRUE(testHandler2.IsConnected()); + + EXPECT_TRUE(invokedCounter == 0); + testEvent.Signal(); + EXPECT_TRUE(invokedCounter == 2); + } + + TEST_F(EventTests, TestHandlerCopyAssignmentOperator) + { + int32_t invokedCounter = 0; + + AZ::Event<> testEvent; + AZ::Event<>::Handler testHandler([&invokedCounter]() { invokedCounter++; }); + + testHandler.Connect(testEvent); + + AZ::Event<>::Handler testHandler2; + + EXPECT_TRUE(testHandler.IsConnected()); + EXPECT_FALSE(testHandler2.IsConnected()); + + testHandler2 = testHandler; + + EXPECT_TRUE(testHandler2.IsConnected()); + + EXPECT_TRUE(invokedCounter == 0); + testEvent.Signal(); + EXPECT_TRUE(invokedCounter == 2); + } } #if defined(HAVE_BENCHMARK) From 3e7f99812adc48d920e1e240bdd24298ceb2555e Mon Sep 17 00:00:00 2001 From: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 9 Jul 2021 11:57:51 -0700 Subject: [PATCH 146/156] [installer/2106-desktop-shortcuts] update desktop shortcuts created by the installer Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- cmake/Platform/Windows/Packaging/Shortcuts.wxs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/Platform/Windows/Packaging/Shortcuts.wxs b/cmake/Platform/Windows/Packaging/Shortcuts.wxs index 283a3c08ea..fefd15294a 100644 --- a/cmake/Platform/Windows/Packaging/Shortcuts.wxs +++ b/cmake/Platform/Windows/Packaging/Shortcuts.wxs @@ -26,10 +26,15 @@ - + + + Name="$(var.CPACK_PACKAGE_NAME) Project Manager" /> From b187407e65e0f48f65837c4e208b00ad9657b717 Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Fri, 9 Jul 2021 13:56:13 -0700 Subject: [PATCH 147/156] fix for lightculling / pdo artifacts (#2033) Signed-off-by: mrieggeramzn --- .../Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli index 2c2f956f8f..c979cff128 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli @@ -427,7 +427,7 @@ PixelDepthOffset CalcPixelDepthOffset( float depthFactor, float4 clipOffsetPosition = mul(viewProjectionMatrix, float4(worldOffsetPosition, 1.0)); PixelDepthOffset pdo; - pdo.m_depthCS = clipOffsetPosition.z; + pdo.m_depthCS = clipOffsetPosition.w; pdo.m_depthNDC = clipOffsetPosition.z / clipOffsetPosition.w; pdo.m_worldPosition = worldOffsetPosition; return pdo; From ed33b429aa0370f45637e4e128bcb3c4737fbfc8 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Fri, 9 Jul 2021 15:56:46 -0500 Subject: [PATCH 148/156] =?UTF-8?q?Updating=20some=20labels=20in=20the=20d?= =?UTF-8?q?irectional=20light=20and=20light=20components=E2=80=A6=20(#1996?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updating some labels in the directional light and light components to make them more readable and consistent with standards. Removed hard caps on directional light intensity. Signed-off-by: Ken Pruiksma --- .../DirectionalLightComponentConfig.cpp | 13 +-- .../CoreLights/EditorAreaLightComponent.cpp | 10 +-- .../EditorDirectionalLightComponent.cpp | 90 +++++++++---------- 3 files changed, 54 insertions(+), 59 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp index 3923136bcc..5325ba911d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace AZ { @@ -55,21 +56,15 @@ namespace AZ case PhotometricUnit::Lux: return 0.0f; case PhotometricUnit::Ev100Illuminance: - return -10.0f; + return AZStd::numeric_limits::lowest(); } return 0.0f; } float DirectionalLightComponentConfig::GetIntensityMax() const { - switch (m_intensityMode) - { - case PhotometricUnit::Lux: - return 1'000'000.0f; - case PhotometricUnit::Ev100Illuminance: - return 20.0f; - } - return 0.0f; + // While there is no hard-max, a max must be included when there is a hard min. + return AZStd::numeric_limits::max(); } float DirectionalLightComponentConfig::GetIntensitySoftMin() const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index 81e87f3cb5..c27faa2241 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -154,19 +154,19 @@ namespace AZ ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsPcfBoundarySearchDisabled) ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_predictionSampleCount, "Prediction sample count", - "Sample Count for prediction of whether the pixel is on the boundary. Specific to PCF and ESM+PCF.") + "Sample count for prediction of whether the pixel is on the boundary. Specific to PCF and ESM+PCF.") ->Attribute(Edit::Attributes::Min, 4) ->Attribute(Edit::Attributes::Max, 16) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsPcfBoundarySearchDisabled) ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_filteringSampleCount, "Filtering sample count", - "It is used only when the pixel is predicted to be on the boundary. Specific to PCF and ESM+PCF.") + "This is only used when the pixel is predicted to be on the boundary. Specific to PCF and ESM+PCF.") ->Attribute(Edit::Attributes::Min, 4) ->Attribute(Edit::Attributes::Max, 64) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled) ->DataElement( - Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_pcfMethod, "Pcf method", + Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_pcfMethod, "PCF method", "Type of PCF to use.\n" " Bicubic: a smooth, fixed-size kernel \n" " Boundary search: do several taps to first determine if we are on a shadow boundary\n") @@ -176,8 +176,8 @@ namespace AZ ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled) ->DataElement( - Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_esmExponent, "Esm Exponent", - "Exponent used by Esm shadows. " + Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_esmExponent, "ESM exponent", + "Exponent used by ESM shadows. " "Larger values increase the sharpness of the border between lit and unlit areas.") ->Attribute(Edit::Attributes::Min, 50.0f) ->Attribute(Edit::Attributes::Max, 5000.0f) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 8163dcfe20..4d43c23e25 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -57,74 +57,74 @@ namespace AZ editContext->Class("DirectionalLightComponentConfig", "") ->ClassElement(Edit::ClassElements::EditorData, "") ->DataElement(Edit::UIHandlers::Color, &DirectionalLightComponentConfig::m_color, "Color", "Color of the light") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) - ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_intensityMode, "Intensity Mode", "Allows specifying light values in lux or Ev100") - ->EnumAttribute(PhotometricUnit::Lux, "Lux") - ->EnumAttribute(PhotometricUnit::Ev100Illuminance, "Ev100") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_intensityMode, "Intensity mode", "Allows specifying light values in lux or Ev100") + ->EnumAttribute(PhotometricUnit::Lux, "Lux") + ->EnumAttribute(PhotometricUnit::Ev100Illuminance, "Ev100") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_intensity, "Intensity", "Intensity of the light in the set photometric unit.") - ->Attribute(Edit::Attributes::Min, &DirectionalLightComponentConfig::GetIntensityMin) - ->Attribute(Edit::Attributes::Max, &DirectionalLightComponentConfig::GetIntensityMax) - ->Attribute(Edit::Attributes::SoftMin, &DirectionalLightComponentConfig::GetIntensitySoftMin) - ->Attribute(Edit::Attributes::SoftMax, &DirectionalLightComponentConfig::GetIntensitySoftMax) - ->Attribute(Edit::Attributes::Suffix, &DirectionalLightComponentConfig::GetIntensitySuffix) - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_angularDiameter, "Angular Diameter", "Angular Diameter of the directional light in degrees. The sun is about 0.5.") - ->Attribute(Edit::Attributes::Min, 0.0f) - ->Attribute(Edit::Attributes::Max, 5.0f) - ->Attribute(Edit::Attributes::SoftMax, 1.0f) - ->Attribute(Edit::Attributes::Suffix, " deg") + ->Attribute(Edit::Attributes::Min, &DirectionalLightComponentConfig::GetIntensityMin) + ->Attribute(Edit::Attributes::Max, &DirectionalLightComponentConfig::GetIntensityMax) + ->Attribute(Edit::Attributes::SoftMin, &DirectionalLightComponentConfig::GetIntensitySoftMin) + ->Attribute(Edit::Attributes::SoftMax, &DirectionalLightComponentConfig::GetIntensitySoftMax) + ->Attribute(Edit::Attributes::Suffix, &DirectionalLightComponentConfig::GetIntensitySuffix) + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_angularDiameter, "Angular diameter", "Angular diameter of the directional light in degrees. The sun is about 0.5.") + ->Attribute(Edit::Attributes::Min, 0.0f) + ->Attribute(Edit::Attributes::Max, 5.0f) + ->Attribute(Edit::Attributes::SoftMax, 1.0f) + ->Attribute(Edit::Attributes::Suffix, " deg") ->ClassElement(AZ::Edit::ClassElements::Group, "Shadow") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(Edit::UIHandlers::EntityId, &DirectionalLightComponentConfig::m_cameraEntityId, "Camera", "Entity of the camera for cascaded shadowmap view frustum.") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_shadowFarClipDistance, "Shadow Far Clip", "Shadow sepcific far clip distance.") + ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_shadowFarClipDistance, "Shadow far clip", "Shadow specific far clip distance.") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_shadowmapSize, "Shadowmap Size", "Width/Height of shadowmap") + ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_shadowmapSize, "Shadowmap size", "Width/Height of shadowmap") ->EnumAttribute(ShadowmapSize::Size256, " 256") ->EnumAttribute(ShadowmapSize::Size512, " 512") ->EnumAttribute(ShadowmapSize::Size1024, "1024") ->EnumAttribute(ShadowmapSize::Size2048, "2048") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_cascadeCount, "Cascade Count", "Number of cascades") + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_cascadeCount, "Cascade count", "Number of cascades") ->Attribute(Edit::Attributes::Min, 1) ->Attribute(Edit::Attributes::Max, Shadow::MaxNumberOfCascades) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_isShadowmapFrustumSplitAutomatic, "Split Automatic", + ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_isShadowmapFrustumSplitAutomatic, "Automatic splitting", "Switch splitting of shadowmap frustum to cascades automatically or not.") - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_shadowmapFrustumSplitSchemeRatio, "Split Ratio", + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_shadowmapFrustumSplitSchemeRatio, "Split ratio", "Ratio to lerp between the two types of frustum splitting scheme.\n" - "0 = Uniform scheme which will split the Frustum evenly across all cascades.\n" + "0 = Uniform scheme which will split the frustum evenly across all cascades.\n" "1 = Logarithmic scheme which is designed to split the frustum in a logarithmic fashion " "in order to enable us to produce a more optimal perspective aliasing across the frustum.") ->Attribute(Edit::Attributes::Min, 0.f) ->Attribute(Edit::Attributes::Max, 1.f) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsSplitManual) - ->DataElement(Edit::UIHandlers::Vector4, &DirectionalLightComponentConfig::m_cascadeFarDepths, "Far Depth Cascade", - "Far Depth of each cascade. The value of the index greater than or equal to cascade count is ignored.") + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsSplitManual) + ->DataElement(Edit::UIHandlers::Vector4, &DirectionalLightComponentConfig::m_cascadeFarDepths, "Far depth cascade", + "Far depth of each cascade. The value of the index greater than or equal to cascade count is ignored.") ->Attribute(Edit::Attributes::Min, 0.01f) ->Attribute(Edit::Attributes::Max, &DirectionalLightComponentConfig::m_shadowFarClipDistance) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsSplitAutomatic) - ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_groundHeight, "Ground Height", + ->DataElement(Edit::UIHandlers::Default, &DirectionalLightComponentConfig::m_groundHeight, "Ground height", "Height of the ground. Used to correct position of cascades.") ->Attribute(Edit::Attributes::Suffix, " m") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsCascadeCorrectionDisabled) + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsCascadeCorrectionDisabled) ->DataElement(Edit::UIHandlers::CheckBox, - &DirectionalLightComponentConfig::m_isCascadeCorrectionEnabled, "Enable Cascade Correction?", + &DirectionalLightComponentConfig::m_isCascadeCorrectionEnabled, "Cascade correction", "Enable position correction of cascades to optimize the appearance for certain camera positions.") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->DataElement(Edit::UIHandlers::CheckBox, - &DirectionalLightComponentConfig::m_isDebugColoringEnabled, "Enable Debug Coloring?", + &DirectionalLightComponentConfig::m_isDebugColoringEnabled, "Debug coloring", "Enable coloring to see how cascades places 0:red, 1:green, 2:blue, 3:yellow.") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_shadowFilterMethod, "Shadow Filter Method", + ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_shadowFilterMethod, "Shadow filter method", "Filtering method of edge-softening of shadows.\n" - " None: no filtering\n" - " PCF: Percentage-Closer Filtering\n" - " ESM: Exponential Shadow Maps\n" + " None: No filtering\n" + " PCF: Percentage-closer filtering\n" + " ESM: Exponential shadow maps\n" " ESM+PCF: ESM with a PCF fallback\n" "For BehaviorContext (or TrackView), None=0, PCF=1, ESM=2, ESM+PCF=3") ->EnumAttribute(ShadowFilterMethod::None, "None") @@ -132,7 +132,7 @@ namespace AZ ->EnumAttribute(ShadowFilterMethod::Esm, "ESM") ->EnumAttribute(ShadowFilterMethod::EsmPcf, "ESM+PCF") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_boundaryWidth, "Softening Boundary Width", + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_boundaryWidth, "Softening boundary width", "Width of the boundary between shadowed area and lit one. " "Units are in meters. " "If this is 0, softening edge is disabled.") @@ -141,29 +141,29 @@ namespace AZ ->Attribute(Edit::Attributes::Suffix, " m") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled) - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_predictionSampleCount, "Prediction Sample Count", - "Sample Count for prediction of whether the pixel is on the boundary. " + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_predictionSampleCount, "Prediction sample count", + "Sample count for prediction of whether the pixel is on the boundary. " "Specific to PCF and ESM+PCF.") ->Attribute(Edit::Attributes::Min, 4) ->Attribute(Edit::Attributes::Max, 16) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled) - ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_filteringSampleCount, "Filtering Sample Count", - "It is used only when the pixel is predicted as on the boundary. " + ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_filteringSampleCount, "Filtering sample count", + "This is used only when the pixel is predicted as on the boundary. " "Specific to PCF and ESM+PCF.") ->Attribute(Edit::Attributes::Min, 4) ->Attribute(Edit::Attributes::Max, 64) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled) ->DataElement( - Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_pcfMethod, "Pcf Method", - "Type of Pcf to use.\n" + Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_pcfMethod, "Pcf method", + "Type of PCF to use.\n" " Bicubic: a smooth, fixed-size kernel \n" " Boundary search: do several taps to first determine if we are on a shadow boundary\n") - ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") - ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled); + ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") + ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary search") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled); ; } From 4f628cfb77f5d36dd2dc5b918773672f6f81ca5b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 9 Jul 2021 14:25:23 -0700 Subject: [PATCH 149/156] Fix for alias not understood in generation expressions that query properties (#2034) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/LYWrappers.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index b6daf8b6d7..40bf6ef541 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -380,12 +380,14 @@ function(ly_delayed_target_link_libraries) cmake_parse_arguments(ly_delayed_target_link_libraries "" "" "${visibilities}" ${delayed_link}) foreach(visibility ${visibilities}) - foreach(item ${ly_delayed_target_link_libraries_${visibility}}) + foreach(alias_item ${ly_delayed_target_link_libraries_${visibility}}) - if(TARGET ${item}) - get_target_property(item_type ${item} TYPE) + if(TARGET ${alias_item}) + get_target_property(item_type ${alias_item} TYPE) + ly_de_alias_target(${alias_item} item) else() unset(item_type) + set(item ${alias_item}) endif() if(item_type STREQUAL MODULE_LIBRARY) From 9b72b71aa08c87d0fc6ff5b3d7c272a8c4da8a2f Mon Sep 17 00:00:00 2001 From: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 9 Jul 2021 14:58:32 -0700 Subject: [PATCH 150/156] [installer/2106-latest-upload] also upload a copy of the boostrapper to the 'latest' folder for tagged builds Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- .../Platform/Windows/PackagingPostBuild.cmake | 119 +++++++++++++----- 1 file changed, 87 insertions(+), 32 deletions(-) diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index 2d003d6062..70f8834207 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -105,39 +105,94 @@ file(TO_NATIVE_PATH "${_root_path}/python/python.cmd" _python_cmd) file(TO_NATIVE_PATH "${_root_path}/scripts/build/tools/upload_to_s3.py" _upload_script) file(TO_NATIVE_PATH "${_cpack_wix_out_dir}" _cpack_wix_out_dir) -# strip the scheme and extract the bucket/key prefix from the URL -string(REPLACE "s3://" "" _stripped_url ${CPACK_UPLOAD_URL}) -string(REPLACE "/" ";" _tokens ${_stripped_url}) - -list(POP_FRONT _tokens _bucket) -string(JOIN "/" _prefix ${_tokens}) - -set(_file_regex ".*(cab|exe|msi)$") -set(_extra_args [[{"ACL":"bucket-owner-full-control"}]]) - -set(_upload_command - ${_python_cmd} -s - -u ${_upload_script} - --base_dir ${_cpack_wix_out_dir} - --file_regex="${_file_regex}" - --bucket ${_bucket} - --key_prefix ${_prefix} - --extra_args ${_extra_args} -) - -if(CPACK_AWS_PROFILE) - list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE}) -endif() +function(upload_to_s3 in_url in_local_path in_file_regex) + + # strip the scheme and extract the bucket/key prefix from the URL + string(REPLACE "s3://" "" _stripped_url ${in_url}) + string(REPLACE "/" ";" _tokens ${_stripped_url}) + + list(POP_FRONT _tokens _bucket) + string(JOIN "/" _prefix ${_tokens}) + + set(_extra_args [[{"ACL":"bucket-owner-full-control"}]]) + + set(_upload_command + ${_python_cmd} -s + -u ${_upload_script} + --base_dir ${in_local_path} + --file_regex="${in_file_regex}" + --bucket ${_bucket} + --key_prefix ${_prefix} + --extra_args ${_extra_args} + ) + + if(CPACK_AWS_PROFILE) + list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE}) + endif() + + execute_process( + COMMAND ${_upload_command} + RESULT_VARIABLE _upload_result + OUTPUT_VARIABLE _upload_output + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if (NOT ${_upload_result} EQUAL 0) + message(FATAL_ERROR "An error occurred uploading to s3.\nOutput:\n${_upload_output}") + endif() +endfunction() message(STATUS "Uploading artifacts to ${CPACK_UPLOAD_URL}") -execute_process( - COMMAND ${_upload_command} - RESULT_VARIABLE _upload_result - ERROR_VARIABLE _upload_errors +upload_to_s3( + ${CPACK_UPLOAD_URL} + ${_cpack_wix_out_dir} + ".*(cab|exe|msi)$" ) - -if (${_upload_result} EQUAL 0) - message(STATUS "Artifact uploading complete!") -else() - message(FATAL_ERROR "An error occurred uploading artifacts. ${_upload_errors}") +message(STATUS "Artifact uploading complete!") + +# for auto tagged builds, we will also upload a second copy of just the boostrapper +# to a special "Latest" folder under the branch in place of the commit date/hash +if(CPACK_AUTO_GEN_TAG) + message(STATUS "Updating latest tagged build") + + # make sure we can extra the commit info from the URL first + string(REGEX MATCH "([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9a-zA-Z]+)" + _commit_info ${CPACK_UPLOAD_URL} + ) + if(NOT _commit_info) + message(FATAL_ERROR "Failed to extract the build tag") + endif() + + set(_temp_dir ${_cpack_wix_out_dir}/temp) + if(NOT EXISTS ${_temp_dir}) + file(MAKE_DIRECTORY ${_temp_dir}) + endif() + + # strip the version number form the exe name in the one uploaded to latest + string(TOLOWER "${CPACK_PACKAGE_NAME}_installer.exe" _non_versioned_exe) + set(_temp_exe_copy ${_temp_dir}/${_non_versioned_exe}) + + file(COPY ${_bootstrap_output_file} DESTINATION ${_temp_dir}) + file(RENAME "${_temp_dir}/${_bootstrap_filename}" ${_temp_exe_copy}) + + # include the commit info in a text file that will live next to the exe + set(_temp_info_file ${_temp_dir}/build_tag.txt) + file(WRITE ${_temp_info_file} ${_commit_info}) + + # update the URL and upload + string(REPLACE + ${_commit_info} "Latest" + _latest_upload_url ${CPACK_UPLOAD_URL} + ) + + upload_to_s3( + ${_latest_upload_url} + ${_temp_dir} + "(${_non_versioned_exe}|build_tag.txt)$" + ) + + # cleanup the temp files + file(REMOVE_RECURSE ${_temp_dir}) + + message(STATUS "Latest build update complete!") endif() From 0d82c1e670b15faaaa2c738eb628db7dc159225b Mon Sep 17 00:00:00 2001 From: Tommy Walton <82672795+amzn-tommy@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:54:46 -0700 Subject: [PATCH 151/156] Use float buffer for skinning (#2009) * Switching to Buffer instead of Buffer in the skinning shader because metal doesn't support float3 buffers Signed-off-by: amzn-tommy * Adding a comment to LinearSkinningPassSRG pointing out that positions, normals, and bitangents are using float buffers to work on Metal Signed-off-by: amzn-tommy --- .../Shaders/SkinnedMesh/LinearSkinningCS.azsl | 17 +++++++++--- .../SkinnedMesh/LinearSkinningPassSRG.azsli | 8 +++--- .../SkinnedMesh/SkinnedMeshInputBuffers.cpp | 26 +++++++++++++++++-- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl index fc5684fe7f..99d38463c7 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl @@ -14,6 +14,15 @@ option enum class SkinningMethod { LinearSkinning, DualQuaternion } o_skinningMe option bool o_applyMorphTargets = false; option bool o_applyColorMorphTargets = false; +float3 ReadFloat3FromFloatBuffer(Buffer buffer, uint index) +{ + float3 result; + result.x = buffer[index * 3]; + result.y = buffer[index * 3 + 1]; + result.z = buffer[index * 3 + 2]; + return result; +} + // Apply a morph target delta with three components void ApplyMorphTargetDelta(uint streamOffset, uint vertexIndex, inout float3 modifiedValue) { @@ -162,10 +171,10 @@ void MainCS(uint3 thread_id: SV_DispatchThreadID) return; } - float3 position = InstanceSrg::m_sourcePositions[i]; - float3 normal = InstanceSrg::m_sourceNormals[i]; - float4 tangent = InstanceSrg::m_sourceTangents[i]; - float3 bitangent = InstanceSrg::m_sourceBiTangents[i]; + float3 position = ReadFloat3FromFloatBuffer(InstanceSrg::m_sourcePositions, i); + float3 normal = ReadFloat3FromFloatBuffer(InstanceSrg::m_sourceNormals, i); + float4 tangent = InstanceSrg::m_sourceTangents[i]; + float3 bitangent = ReadFloat3FromFloatBuffer(InstanceSrg::m_sourceBiTangents, i); // Four indices, 16-bits each, stored in 2 32-bit uints uint2 rawIndices = InstanceSrg::m_sourceBlendIndices.Load2(i * 8); diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli index 95802ddbb7..066cefdc37 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli @@ -20,10 +20,12 @@ ShaderResourceGroup InstanceSrg : SRG_PerDraw uint m_totalNumberOfThreadsX; // Per-model input - Buffer m_sourcePositions; // POSITION 0 - Buffer m_sourceNormals; // NORMAL 0 + // Positions, normals, and bitangents are all 3-component per-vertex buffers, + // but Metal doesn't support float3 buffers so Buffer is used instead + Buffer m_sourcePositions; // POSITION 0 + Buffer m_sourceNormals; // NORMAL 0 Buffer m_sourceTangents; // TANGENT 0 - Buffer m_sourceBiTangents; // BITANGENT 0 + Buffer m_sourceBiTangents; // BITANGENT 0 ByteAddressBuffer m_sourceBlendIndices; // BLENDINDICES 0 Buffer m_sourceBlendWeights; // BLENDWEIGHTS 0 diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index 75d079c937..8ef82dfac4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -118,7 +118,29 @@ namespace AZ } m_inputBufferAssets[static_cast(inputStream)] = bufferAsset; - m_inputBuffers[static_cast(inputStream)] = RPI::Buffer::FindOrCreate(bufferAsset); + Data::Instance buffer = RPI::Buffer::FindOrCreate(bufferAsset); + m_inputBuffers[static_cast(inputStream)] = buffer; + + // Create a buffer view to use as input to the skinning shader + AZ::RHI::Ptr bufferView = RHI::Factory::Get().CreateBufferView(); + bufferView->SetName(Name{ AZStd::string(buffer->GetBufferView()->GetName().GetStringView()) + "_SkinningInputBufferView" }); + RHI::BufferViewDescriptor bufferViewDescriptor = bufferAsset->GetBufferViewDescriptor(); + + // 3-component float buffers are not supported on metal for non-input assembly buffer views, so use a float view instead + if (bufferViewDescriptor.m_elementFormat == RHI::Format::R32G32B32_FLOAT) + { + // Use one float per element, with 3x as many elements + bufferViewDescriptor = RHI::BufferViewDescriptor::CreateTyped( + bufferViewDescriptor.m_elementOffset * 3, bufferViewDescriptor.m_elementCount * 3, RHI::Format::R32_FLOAT); + } + + [[maybe_unused]] RHI::ResultCode resultCode = + bufferView->Init(*buffer->GetRHIBuffer(), bufferViewDescriptor); + AZ_Error( + "SkinnedMeshInputBuffers", resultCode == RHI::ResultCode::Success, + "Failed to initialize buffer view for skinned mesh input."); + + m_bufferViews[static_cast(inputStream)] = bufferView; } void SkinnedMeshInputLod::SetStaticBufferAsset(const Data::Asset bufferAsset, SkinnedMeshStaticVertexStreams staticStream) @@ -315,7 +337,7 @@ namespace AZ [[maybe_unused]] bool success = false; if (m_lods[lodIndex].m_inputBuffers[inputStream]) { - success = perInstanceSRG->SetBufferView(srgIndex, m_lods[lodIndex].m_inputBuffers[inputStream]->GetBufferView()); + success = perInstanceSRG->SetBufferView(srgIndex, m_lods[lodIndex].m_bufferViews[inputStream].get()); } AZ_Error("SkinnedMeshInputBuffers", success, "Failed to bind buffer view for %s", streamInfo.m_bufferName.GetCStr()); From 8eb8088a3606ba190e6778eb53707e5d19049155 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 9 Jul 2021 16:25:13 -0700 Subject: [PATCH 152/156] Remove Cry -> Atom camera sync. (#2047) Signed-off-by: nvsickle --- Code/Editor/EditorViewportWidget.cpp | 44 ++++++++++------------------ Code/Editor/EditorViewportWidget.h | 1 - 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index fca698e88a..0f911878c3 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -463,25 +463,7 @@ void EditorViewportWidget::Update() SetFOV(cameraState.m_fovOrZoom); m_Camera.SetZRange(cameraState.m_nearClip, cameraState.m_farClip); } - else if (!ed_useNewCameraSystem) - { - m_renderViewport->GetViewportContext()->SetCameraTransform(LYTransformToAZTransform(m_Camera.GetMatrix())); - } - // Don't override the game mode FOV - if (!GetIEditor()->IsInGameMode()) - { - AZ::Matrix4x4 clipMatrix; - AZ::MakePerspectiveFovMatrixRH( - clipMatrix, - GetFOV(), - aznumeric_cast(width()) / aznumeric_cast(height()), - m_Camera.GetNearPlane(), - m_Camera.GetFarPlane(), - true - ); - m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix); - } // Reset the camera update flag now that we're finished updating our viewport context m_updateCameraPositionNextTick = false; @@ -637,7 +619,6 @@ void EditorViewportWidget::SetViewEntity(const AZ::EntityId& viewEntityId, bool void EditorViewportWidget::ResetToViewSourceType(const ViewSourceType& viewSourceType) { LockCameraMovement(true); - m_pCameraFOVVariable = nullptr; m_viewEntityId.SetInvalid(); m_cameraObjectId = GUID_NULL; m_viewSourceType = viewSourceType; @@ -2416,13 +2397,26 @@ void EditorViewportWidget::CenterOnSliceInstance() ////////////////////////////////////////////////////////////////////////// void EditorViewportWidget::SetFOV(float fov) { - if (m_pCameraFOVVariable) + if (m_viewEntityId.IsValid()) { - m_pCameraFOVVariable->Set(fov); + Camera::CameraRequestBus::Event(m_viewEntityId, &Camera::CameraComponentRequests::SetFov, AZ::RadToDeg(fov)); } else { m_camFOV = fov; + // Set the active camera's FOV + { + AZ::Matrix4x4 clipMatrix; + AZ::MakePerspectiveFovMatrixRH( + clipMatrix, + GetFOV(), + aznumeric_cast(width()) / aznumeric_cast(height()), + m_Camera.GetNearPlane(), + m_Camera.GetFarPlane(), + true + ); + m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix); + } } if (m_viewPane) @@ -2449,13 +2443,7 @@ float EditorViewportWidget::GetFOV() const } } - if (m_pCameraFOVVariable) - { - float fov; - m_pCameraFOVVariable->Get(fov); - return fov; - } - else if (m_viewEntityId.IsValid()) + if (m_viewEntityId.IsValid()) { float fov = AZ::RadToDeg(m_camFOV); Camera::CameraRequestBus::EventResult(fov, m_viewEntityId, &Camera::CameraComponentRequests::GetFov); diff --git a/Code/Editor/EditorViewportWidget.h b/Code/Editor/EditorViewportWidget.h index 682d37199c..e99c963b5a 100644 --- a/Code/Editor/EditorViewportWidget.h +++ b/Code/Editor/EditorViewportWidget.h @@ -505,7 +505,6 @@ protected: CPredefinedAspectRatios m_predefinedAspectRatios; - IVariable* m_pCameraFOVVariable = nullptr; bool m_bCursorHidden = false; void OnMenuResolutionCustom(); From 372ac2707fea95b31d34953a9be6e34cde28e089 Mon Sep 17 00:00:00 2001 From: Alex Montgomery Date: Fri, 9 Jul 2021 19:37:57 -0700 Subject: [PATCH 153/156] fix outliner sorting using incorrect types for comparisons (#2052) * fix outliner sorting using incorrect types for comparisons, fixes for [LY-122258] and [LYN-3666] Signed-off-by: Alex Montgomery * fix annoying but necessary Qt type cast Signed-off-by: Alex Montgomery --- .../Outliner/OutlinerSortFilterProxyModel.cpp | 19 ++++++++++++++++++- .../EntityOutlinerSortFilterProxyModel.cpp | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSortFilterProxyModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSortFilterProxyModel.cpp index 660ea137cf..89cd361fb6 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSortFilterProxyModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSortFilterProxyModel.cpp @@ -32,7 +32,24 @@ bool OutlinerSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelI bool OutlinerSortFilterProxyModel::lessThan(const QModelIndex& leftIndex, const QModelIndex& rightIndex) const { - return sourceModel()->data(leftIndex).toString() < sourceModel()->data(rightIndex).toString(); + if (leftIndex.isValid() && rightIndex.isValid()) + { + QVariant leftData = sourceModel()->data(leftIndex); + QVariant rightData = sourceModel()->data(rightIndex); + + // make sure to compare the correct data types for sorting the current column + AZ_Assert(leftData.type() == rightData.type(), "OutlinerSortFilterProxyModel::lessThan types do not agree!"); + if (static_cast(leftData.type()) == QMetaType::QString) + { + return leftData.toString() < rightData.toString(); + } + else if (static_cast(leftData.type()) == QMetaType::ULongLong) + { + return leftData.toULongLong() < rightData.toULongLong(); + } + AZ_Error("Editor", false, "Error! Unhandled type \"%s\" in OutlinerSortFilterProxyModel::lessThan", leftData.typeName()); + } + return false; } void OutlinerSortFilterProxyModel::sort(int /*column*/, Qt::SortOrder /*order*/) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.cpp index 73139b5a67..90274bc734 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSortFilterProxyModel.cpp @@ -34,7 +34,24 @@ namespace AzToolsFramework bool EntityOutlinerSortFilterProxyModel::lessThan(const QModelIndex& leftIndex, const QModelIndex& rightIndex) const { - return sourceModel()->data(leftIndex).toString() < sourceModel()->data(rightIndex).toString(); + if (leftIndex.isValid() && rightIndex.isValid()) + { + QVariant leftData = sourceModel()->data(leftIndex); + QVariant rightData = sourceModel()->data(rightIndex); + + // make sure to compare the correct data types for sorting the current column + AZ_Assert(leftData.type() == rightData.type(), "EntityOutlinerSortFilterProxyModel::lessThan types do not agree!"); + if (static_cast(leftData.type()) == QMetaType::QString) + { + return leftData.toString() < rightData.toString(); + } + else if (static_cast(leftData.type()) == QMetaType::ULongLong) + { + return leftData.toULongLong() < rightData.toULongLong(); + } + AZ_Error("Editor", false, "Error! Unhandled type \"%s\" in EntityOutlinerSortFilterProxyModel::lessThan", leftData.typeName()); + } + return false; } void EntityOutlinerSortFilterProxyModel::sort(int /*column*/, Qt::SortOrder /*order*/) From 2727f36621ed501fb725dd998e01c334b1844738 Mon Sep 17 00:00:00 2001 From: dmcdiar Date: Sun, 11 Jul 2021 17:31:51 -0700 Subject: [PATCH 154/156] Set DiffuseProbeGrids to visible when baking textures. Added an initialization delay before starting the DiffuseProbeGrid texture readbacks, to allow the textures to settle. Signed-off-by: dmcdiar --- .../DiffuseProbeGrid.cpp | 6 ++++++ .../DiffuseProbeGridTextureReadback.cpp | 17 ++++++++++++++++- .../DiffuseProbeGridTextureReadback.h | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index 888d7c57d8..baf71ca7f1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -259,6 +259,12 @@ namespace AZ return true; } + // if a bake is in progress we need to make this DiffuseProbeGrid visible + if (!m_textureReadback.IsIdle()) + { + return true; + } + return m_cullable.m_isVisible; } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp index 3e808a99c1..8931a4feb1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp @@ -22,7 +22,9 @@ namespace AZ AZ_Assert(m_readbackState == DiffuseProbeGridReadbackState::Idle, "DiffuseProbeGridTextureReadback is already processing a readback request"); m_callback = callback; - m_readbackState = DiffuseProbeGridReadbackState::Irradiance; + + m_remainingInitializationFrames = DefaultNumInitializationFrames; + m_readbackState = DiffuseProbeGridReadbackState::Initializing; } void DiffuseProbeGridTextureReadback::Update(const AZ::Name& passName) @@ -32,6 +34,19 @@ namespace AZ return; } + if (m_readbackState == DiffuseProbeGridReadbackState::Initializing) + { + if (m_remainingInitializationFrames > 0) + { + // still in the initialization state to allow the irradiance textures to settle, decrement the frame count + m_remainingInitializationFrames--; + return; + } + + // settling complete, move to the irradiance readback state to begin the readback process + m_readbackState = DiffuseProbeGridReadbackState::Irradiance; + } + if (m_attachmentReadback.get() && m_attachmentReadback->GetReadbackState() > RPI::AttachmentReadback::ReadbackState::Idle) { // still processing previous request diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h index c399fac534..b0d35069a7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h @@ -20,6 +20,7 @@ namespace AZ enum class DiffuseProbeGridReadbackState { Idle, + Initializing, Irradiance, Distance, Relocation, @@ -39,6 +40,8 @@ namespace AZ void Update(const AZ::Name& passName); void FrameBegin(AZ::RPI::Pass::FramePrepareParams& params); + bool IsIdle() const { return m_readbackState == DiffuseProbeGridReadbackState::Idle; } + private: DiffuseProbeGrid* m_diffuseProbeGrid = nullptr; @@ -50,6 +53,10 @@ namespace AZ AZ::RPI::AttachmentReadback::ReadbackResult m_distanceReadbackResult; AZ::RPI::AttachmentReadback::ReadbackResult m_relocationReadbackResult; AZ::RPI::AttachmentReadback::ReadbackResult m_classificationReadbackResult; + + // number of frames to delay before starting the texture readbacks, this allows the textures to settle + static constexpr int32_t DefaultNumInitializationFrames = 50; + int32_t m_remainingInitializationFrames = DefaultNumInitializationFrames; }; } // namespace Render } // namespace AZ From c9ff634080f5364d64fda7c1e8ff799cdd37b6ea Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Sun, 11 Jul 2021 23:30:07 -0700 Subject: [PATCH 155/156] Aftermath for PR-1956 and PR-2025 (#2035) Signed-off-by: Benjamin Jillich --- .../Source/GemCatalog/GemFilterTagWidget.cpp | 6 ++---- Code/Tools/ProjectManager/Source/ProjectUtils.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp index c4612debc8..c7925a2d6e 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterTagWidget.cpp @@ -10,7 +10,6 @@ #include #include #include -#include namespace O3DE::ProjectManager { @@ -72,10 +71,9 @@ namespace O3DE::ProjectManager hLayout->setMargin(0); hLayout->setSpacing(8); - const int numTags = tags.count(); - for (int i = 0; i < numTags; ++i) + for(const QString& tag : tags) { - FilterTagWidget* tagWidget = new FilterTagWidget(tags[i]); + FilterTagWidget* tagWidget = new FilterTagWidget(tag); // Add the tag widget to the current row. hLayout->addWidget(tagWidget); diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp index 82944aa41a..83e7546670 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp @@ -250,7 +250,7 @@ namespace O3DE::ProjectManager progressDialog->setValue(0); progressDialog->setRange(0, 1000); progressDialog->setModal(true); - progressDialog->setWindowTitle("Copying project ..."); + progressDialog->setWindowTitle(QObject::tr("Copying project ...")); progressDialog->show(); QLocale locale; @@ -259,7 +259,12 @@ namespace O3DE::ProjectManager // Create a human-readable version of the file size. const QString fileSizeString = locale.formattedDataSize(sizeInBytes); - progressDialog->setLabelText(QString("Indexing files ... %1 files found, %2 to copy.").arg(fileCount).arg(fileSizeString)); + progressDialog->setLabelText(QString("%1 ... %2 %3, %4 %5.") + .arg(QObject::tr("Indexing files")) + .arg(QString::number(fileCount)) + .arg(QObject::tr("files found")) + .arg(fileSizeString) + .arg(QObject::tr("to copy"))); qApp->processEvents(QEventLoop::ExcludeUserInputEvents); }); @@ -277,7 +282,7 @@ namespace O3DE::ProjectManager if (!success) { - progressDialog->setLabelText("Duplicating project failed/cancelled, removing already copied files ..."); + progressDialog->setLabelText(QObject::tr("Duplicating project failed/cancelled, removing already copied files ...")); qApp->processEvents(QEventLoop::ExcludeUserInputEvents); DeleteProjectFiles(newPath, true); From 7cfde884d9aa1a19e70793e563fb138b92d06ee2 Mon Sep 17 00:00:00 2001 From: moraaar Date: Mon, 12 Jul 2021 13:10:20 +0100 Subject: [PATCH 156/156] Fix unused variable warning in release configuration: DebugComponent::DrawInstanceDebug (#2085) Signed-off-by: moraaar --- Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp index 5fa2d6fd88..2f3c8d08be 100644 --- a/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp +++ b/Gems/Vegetation/Code/Source/Debugger/DebugComponent.cpp @@ -185,7 +185,7 @@ void DebugComponent::DisplayEntityViewport(const AzFramework::ViewportInfo& view } } -void DebugComponent::DrawInstanceDebug(AzFramework::DebugDisplayRequests& debugDisplay) +void DebugComponent::DrawInstanceDebug([[maybe_unused]] AzFramework::DebugDisplayRequests& debugDisplay) { #if defined(VEG_PROFILE_ENABLED) AZStd::unordered_map areaDebugDisplayDataMap;