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 01/75] 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 | 245 +++--------- .../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 | 125 +++--- .../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 | 15 +- .../Translation/TranslationResult.h | 18 +- .../Translation/TranslationUtilities.cpp | 2 +- .../Translation/TranslationUtilities.h | 2 +- .../ScriptCanvas/Variable/GraphVariable.cpp | 72 ++-- .../Code/Source/SystemComponent.cpp | 26 +- .../Code/scriptcanvasgem_common_files.cmake | 4 +- ...scriptcanvasgem_editor_builder_files.cmake | 4 +- 50 files changed, 1764 insertions(+), 1011 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::BuildGameEntityData() + { + using namespace ScriptCanvasBuilder; + + 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; + } + + EditorAssetTree& editorAssetTree = assetTreeOutcome.GetValue(); + + 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; + } + + auto& variableOverrides = parseOutcome.GetValue(); + + if (!m_variableOverrides.IsEmpty()) + { + variableOverrides.CopyPreviousOverriddenValues(m_variableOverrides); + } + + m_variableOverrides = parseOutcome.TakeValue(); + m_runtimeDataIsValid = true; + } + void EditorScriptCanvasComponent::BuildGameEntity(AZ::Entity* gameEntity) { - AZ::Data::AssetId editorAssetId = m_scriptCanvasAssetHolder.GetAssetId(); - - if (!editorAssetId.IsValid()) + if (!m_runtimeDataIsValid) { + // this is fine, there could have been no graph set, or set to a graph that failed to compile return; } - AZ::Data::AssetId runtimeAssetId(editorAssetId.m_guid, AZ_CRC("RuntimeData", 0x163310ae)); - AZ::Data::Asset runtimeAsset(runtimeAssetId, azrtti_typeid(), {}); + // build everything again as a sanity check against dependencies. All of the variable overrides that were valid will be copied over + BuildGameEntityData(); - /* - - 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. - - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, runtimeAssetId); - - if (assetInfo.m_assetType == AZ::Data::s_invalidAssetType) + if (!m_runtimeDataIsValid) { - 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()); + AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s", m_scriptCanvasAssetHolder.GetAssetId().ToString().c_str()); return; } - AzFramework::AssetSystem::AssetStatus statusResult = AzFramework::AssetSystem::AssetStatus_Unknown; - AzFramework::AssetSystemRequestBus::BroadcastResult(statusResult, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById, runtimeAssetId); - - if (statusResult != AzFramework::AssetSystem::AssetStatus_Compiled) - { - 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()); - return; - } - */ - - // #functions2 dependency-ctor-args make recursive - auto executionComponent = gameEntity->CreateComponent(runtimeAsset); - ScriptCanvas::VariableData varData; - - for (const auto& varConfig : m_editableData.GetVariables()) - { - 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); - } - } - - 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) - { - 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)) + for (auto& entityId : activationData.variableOverrides.m_entityIds) { - *entityIdValuePtr = *variableOverride->GetDatum()->GetAs(); + 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 + } + else + { + AZ::SliceComponent::EntityIdToEntityIdMap loadedEntityIdMap; + AzFramework::EntityContextId owningContextId = AzFramework::EntityContextId::CreateNull(); + AzFramework::EntityIdContextQueryBus::EventResult(owningContextId, forSliceSupportOnly, &AzFramework::EntityIdContextQueries::GetOwningContextId); + if (!owningContextId.IsNull()) { - auto iter = loadedEntityIdMap.find(idEntityPair.second); + 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; @@ -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 + const RuntimeData& RuntimeComponent::GetRuntimeAssetData() const { - return m_runtimeAsset; - } - - const RuntimeData& RuntimeComponent::GetAssetData() 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); - - } -} + 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,42 +104,42 @@ namespace ScriptCanvas } } else - if (classElement.GetVersion() < 3) - { - bool exposeAsInputField = false; - classElement.GetChildData(AZ_CRC("ExposeAsInput", 0x0f7879f0), exposeAsInputField); - - if (exposeAsInputField) + 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 + { + 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.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd)); - classElement.AddElementWithData(context, "Scope", VariableFlags::Scope::Graph); + classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0)); } - else - { - 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.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 02/75] 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) + const auto entityIdTypeId = azrtti_typeid(); + + for (auto& entityId : activationData.variableOverrides.m_entityIds) { - 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 - { - 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 03/75] 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 04/75] 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 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 05/75] 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 06/75] 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 07/75] 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 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 08/75] 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 cd3fad20b412188481bcdeda578f70713fb888c7 Mon Sep 17 00:00:00 2001 From: srikappa Date: Wed, 30 Jun 2021 17:05:35 -0700 Subject: [PATCH 09/75] Disable support to destroy game entities through behavior context when prefabs are enabled Signed-off-by: srikappa --- .../AzFramework/Entity/GameEntityContextBus.h | 18 +++++++++ .../Entity/GameEntityContextComponent.cpp | 40 ++++++++++++++++++- .../Entity/GameEntityContextComponent.h | 6 +++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h index ca2b9413b4..85eeb2c4c0 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h +++ b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h @@ -90,6 +90,15 @@ namespace AzFramework */ virtual void DestroyGameEntity(const AZ::EntityId& /*id*/) = 0; + /** + * Destroys an entity only in slice mode (when prefabs are disabled). This request is only added as a stop-gap solution to + * prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use 'DestroyGameEntity' if your + * intention is to destroy a game entity in slice mode. + * + * \param id The ID of the entity to destroy. + */ + virtual void DestroyGameEntityOnlyInSliceMode(const AZ::EntityId& /*id*/) = 0; + /** * Destroys an entity and all of its descendants. * The entity and its descendants are immediately deactivated and will be @@ -98,6 +107,15 @@ namespace AzFramework */ virtual void DestroyGameEntityAndDescendants(const AZ::EntityId& /*id*/) = 0; + /** + * Destroys an entity and its descendants only in slice mode (when prefabs are disabled). This request is only added as a stop-gap + * solution to prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use + * 'DestroyGameEntityAndDescendants' if your intention is to destroy a game entity and its descendants in slice mode. + * + * \param id The ID of the entity to destroy. + */ + virtual void DestroyGameEntityAndDescendantsOnlyInSliceMode(const AZ::EntityId& /*id*/) = 0; + /** * Activates the game entity. * @param id The ID of the entity to activate. diff --git a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.cpp b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.cpp index e48c9a43e1..0c4199b267 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.cpp @@ -46,8 +46,9 @@ namespace AzFramework ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) ->Event("CreateGameEntity", &GameEntityContextRequestBus::Events::CreateGameEntityForBehaviorContext) ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("DestroyGameEntity", &GameEntityContextRequestBus::Events::DestroyGameEntity) - ->Event("DestroyGameEntityAndDescendants", &GameEntityContextRequestBus::Events::DestroyGameEntityAndDescendants) + ->Event("DestroyGameEntity", &GameEntityContextRequestBus::Events::DestroyGameEntityOnlyInSliceMode) + ->Event( + "DestroyGameEntityAndDescendants", &GameEntityContextRequestBus::Events::DestroyGameEntityAndDescendantsOnlyInSliceMode) ->Event("ActivateGameEntity", &GameEntityContextRequestBus::Events::ActivateGameEntity) ->Event("DeactivateGameEntity", &GameEntityContextRequestBus::Events::DeactivateGameEntity) ->Attribute(AZ::ScriptCanvasAttributes::DeactivatesInputEntity, true) @@ -247,6 +248,23 @@ namespace AzFramework DestroyGameEntityInternal(id, false); } + void GameEntityContextComponent::DestroyGameEntityOnlyInSliceMode(const AZ::EntityId& id) + { + bool isPrefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult( + isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + if (!isPrefabSystemEnabled) + { + DestroyGameEntityInternal(id, false); + } + else + { + AZ_Error( + "GameEntityContextComponent", false, + "Destroying a game entity is temporarily disabled until the Spawnable system can support this."); + } + } + //========================================================================= // GameEntityContextComponent::DestroyGameEntityAndDescendantsById //========================================================================= @@ -255,6 +273,24 @@ namespace AzFramework DestroyGameEntityInternal(id, true); } + + void GameEntityContextComponent::DestroyGameEntityAndDescendantsOnlyInSliceMode(const AZ::EntityId& id) + { + bool isPrefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult( + isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + if (!isPrefabSystemEnabled) + { + DestroyGameEntityInternal(id, true); + } + else + { + AZ_Error( + "GameEntityContextComponent", false, + "Destroying a game entity and its descendants is temporarily disabled until the Spawnable system can support this."); + } + } + //========================================================================= // GameEntityContextComponent::DestroyGameEntityInternal //========================================================================= diff --git a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.h b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.h index 6e6d1c64c9..65a8ce53b4 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.h +++ b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextComponent.h @@ -89,6 +89,12 @@ namespace AzFramework } private: + ////////////////////////////////////////////////////////////////////////// + // GameEntityContextRequestBus + void DestroyGameEntityOnlyInSliceMode(const AZ::EntityId&) override; + void DestroyGameEntityAndDescendantsOnlyInSliceMode(const AZ::EntityId&) override; + ///////////////////////////////////////////////////////////////////////// + AzFramework::EntityVisibilityBoundsUnionSystem m_entityVisibilityBoundsUnionSystem; }; } // namespace AzFramework From c61e69d79433b682325eaa8039a06ffd6f3e398e Mon Sep 17 00:00:00 2001 From: srikappa Date: Wed, 30 Jun 2021 17:08:33 -0700 Subject: [PATCH 10/75] Add correct prefix for param tag Signed-off-by: srikappa --- .../AzFramework/AzFramework/Entity/GameEntityContextBus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h index 85eeb2c4c0..b70e933922 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h +++ b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h @@ -95,7 +95,7 @@ namespace AzFramework * prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use 'DestroyGameEntity' if your * intention is to destroy a game entity in slice mode. * - * \param id The ID of the entity to destroy. + * @param id The ID of the entity to destroy. */ virtual void DestroyGameEntityOnlyInSliceMode(const AZ::EntityId& /*id*/) = 0; @@ -112,7 +112,7 @@ namespace AzFramework * solution to prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use * 'DestroyGameEntityAndDescendants' if your intention is to destroy a game entity and its descendants in slice mode. * - * \param id The ID of the entity to destroy. + * @param id The ID of the entity to destroy. */ virtual void DestroyGameEntityAndDescendantsOnlyInSliceMode(const AZ::EntityId& /*id*/) = 0; 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 11/75] 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 12/75] 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 13/75] 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 14/75] 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 ca606a5e0858dec0cccd85c393f85e61e45ab362 Mon Sep 17 00:00:00 2001 From: dmcdiar Date: Wed, 30 Jun 2021 18:35:25 -0700 Subject: [PATCH 15/75] Set IBL exposure value to 0.0 while baking ReflectionProbe cubemaps Signed-off-by: dmcdiar --- .../ReflectionProbe/ReflectionProbe.cpp | 31 ++++++++++++++----- .../Source/ReflectionProbe/ReflectionProbe.h | 2 ++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp index 10e8f16b4c..95755fc509 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp @@ -96,16 +96,29 @@ namespace AZ void ReflectionProbe::Simulate(uint32_t probeIndex) { - if (m_buildingCubeMap && m_environmentCubeMapPass->IsFinished()) + if (m_buildingCubeMap) { - // all faces of the cubemap have been rendered, invoke the callback - m_callback(m_environmentCubeMapPass->GetTextureData(), m_environmentCubeMapPass->GetTextureFormat()); + Data::Instance sceneSrg = m_scene->GetShaderResourceGroup(); - // remove the pipeline - m_scene->RemoveRenderPipeline(m_environmentCubeMapPipelineId); - m_environmentCubeMapPass = nullptr; + if (m_environmentCubeMapPass->IsFinished()) + { + // all faces of the cubemap have been rendered, invoke the callback + m_callback(m_environmentCubeMapPass->GetTextureData(), m_environmentCubeMapPass->GetTextureFormat()); - m_buildingCubeMap = false; + // remove the pipeline + m_scene->RemoveRenderPipeline(m_environmentCubeMapPipelineId); + m_environmentCubeMapPass = nullptr; + + // restore exposure + sceneSrg->SetConstant(m_iblExposureConstantIndex, m_previousExposure); + + m_buildingCubeMap = false; + } + else + { + // set exposure to 0.0 while baking the cubemap + sceneSrg->SetConstant(m_iblExposureConstantIndex, 0.0f); + } } // track if we need to update culling based on changes to the draw packets or Srg @@ -283,6 +296,10 @@ namespace AZ const RPI::Ptr& rootPass = environmentCubeMapPipeline->GetRootPass(); rootPass->AddChild(m_environmentCubeMapPass); + // store the current IBL exposure value + Data::Instance sceneSrg = m_scene->GetShaderResourceGroup(); + m_previousExposure = sceneSrg->GetConstant(m_iblExposureConstantIndex); + m_scene->AddRenderPipeline(environmentCubeMapPipeline); } diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.h b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.h index c354d39d53..48add33260 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.h +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.h @@ -163,6 +163,8 @@ namespace AZ RPI::Ptr m_environmentCubeMapPass = nullptr; RPI::RenderPipelineId m_environmentCubeMapPipelineId; BuildCubeMapCallback m_callback; + RHI::ShaderInputNameIndex m_iblExposureConstantIndex = "m_iblExposure"; + float m_previousExposure = 0.0f; bool m_buildingCubeMap = false; }; 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 16/75] 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 17/75] 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 658c974db95675d6896c2c414f71ec9c3f186ddc Mon Sep 17 00:00:00 2001 From: dmcdiar Date: Wed, 30 Jun 2021 20:15:30 -0700 Subject: [PATCH 18/75] Properly handled reinitializing the cubemap asset when it is changed between Baked and Authored Signed-off-by: dmcdiar --- .../ReflectionProbeComponentController.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/ReflectionProbeComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/ReflectionProbeComponentController.cpp index b2d842c82b..b99613e923 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/ReflectionProbeComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/ReflectionProbeComponentController.cpp @@ -214,11 +214,25 @@ namespace AZ void ReflectionProbeComponentController::UpdateCubeMap() { + // disconnect the asset bus since we might reconnect with a different asset + Data::AssetBus::MultiHandler::BusDisconnect(); + Data::Asset& cubeMapAsset = m_configuration.m_useBakedCubemap ? m_configuration.m_bakedCubeMapAsset : m_configuration.m_authoredCubeMapAsset; - // this will invoke OnAssetReady() - Data::AssetBus::MultiHandler::BusConnect(cubeMapAsset.GetId()); + if (cubeMapAsset.GetId().IsValid()) + { + cubeMapAsset.QueueLoad(); + + // this will invoke OnAssetReady() + Data::AssetBus::MultiHandler::BusConnect(cubeMapAsset.GetId()); + } + else + { + // clear the current cubemap + Data::Instance image = nullptr; + m_featureProcessor->SetProbeCubeMap(m_handle, image, {}); + } } void ReflectionProbeComponentController::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world) 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 19/75] 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 20/75] 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 b93dd36c613cd858d8146b619b170e2cf2fcc383 Mon Sep 17 00:00:00 2001 From: Victor Huang Date: Thu, 1 Jul 2021 10:26:44 -0700 Subject: [PATCH 21/75] 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 22/75] 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 bab4e5eaf3721017cfa8c5b0a73d442683b1532b Mon Sep 17 00:00:00 2001 From: srikappa Date: Thu, 1 Jul 2021 12:11:27 -0700 Subject: [PATCH 23/75] Improved function comments Signed-off-by: srikappa --- .../AzFramework/Entity/GameEntityContextBus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h index b70e933922..e6fbbffd8b 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h +++ b/Code/Framework/AzFramework/AzFramework/Entity/GameEntityContextBus.h @@ -91,9 +91,9 @@ namespace AzFramework virtual void DestroyGameEntity(const AZ::EntityId& /*id*/) = 0; /** - * Destroys an entity only in slice mode (when prefabs are disabled). This request is only added as a stop-gap solution to - * prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use 'DestroyGameEntity' if your - * intention is to destroy a game entity in slice mode. + * Destroys an entity only in slice mode (when prefabs are disabled). This request is only added as a stop-gap solution + * to prevent the editor from crashing when prefabs are enabled and must only be called through the BehaviorContext binding + * for 'DestroyGameEntity'. No code should be written to directly call this method. This will be removed soon. * * @param id The ID of the entity to destroy. */ @@ -109,8 +109,8 @@ namespace AzFramework /** * Destroys an entity and its descendants only in slice mode (when prefabs are disabled). This request is only added as a stop-gap - * solution to prevent the editor from crashing when prefabs are enabled. This will be removed soon. Please use - * 'DestroyGameEntityAndDescendants' if your intention is to destroy a game entity and its descendants in slice mode. + * solution to prevent the editor from crashing when prefabs are enabled and must only be called through the BehaviorContext + * binding for 'DestroyGameEntityAndDescendants'.No code should be written to directly call this method. This will be removed soon. * * @param id The ID of the entity to destroy. */ From 9ef25cb5c47a6032e6ade9e91cc155e73a8e16d3 Mon Sep 17 00:00:00 2001 From: alexmontAmazon <85521892+alexmontAmazon@users.noreply.github.com> Date: Thu, 1 Jul 2021 13:59:10 -0700 Subject: [PATCH 24/75] rewrite of the filter code to fix [LYN-4156][LYN-4545] (#1640) (#1726) * rewrite of the filter code to fix [LYN-4156][LYN-4545] Signed-off-by: Alex Montgomery * improved onRowCountChanged() per comments Signed-off-by: Alex Montgomery --- .../UI/Outliner/OutlinerSearchWidget.cpp | 24 +- .../UI/Outliner/OutlinerSearchWidget.h | 4 +- .../Components/FilteredSearchWidget.cpp | 275 +++++++++--------- .../Components/FilteredSearchWidget.h | 44 ++- .../Components/Widgets/ColorPicker.cpp | 4 +- .../Outliner/EntityOutlinerSearchWidget.cpp | 23 +- .../UI/Outliner/EntityOutlinerSearchWidget.h | 4 +- 7 files changed, 217 insertions(+), 161 deletions(-) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.cpp index ed65d609c9..b76f0826b2 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.cpp @@ -32,21 +32,31 @@ namespace AzQtComponents { } - bool OutlinerSearchTypeSelector::filterItemOut(int unfilteredDataIndex, bool itemMatchesFilter, bool categoryMatchesFilter) + bool OutlinerSearchTypeSelector::filterItemOut(const QModelIndex& sourceIndex, bool filteredByBase) { - bool unfilteredIndexInvalid = (unfilteredDataIndex >= static_cast(OutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)); - return SearchTypeSelector::filterItemOut(unfilteredDataIndex, itemMatchesFilter, categoryMatchesFilter) && unfilteredIndexInvalid; + auto* currItem = m_model->itemFromIndex(sourceIndex); + if (currItem != nullptr) + { + int unfilteredIndex = getUnfilteredDataIndex(currItem); + if (unfilteredIndex >= 0 && unfilteredIndex < aznumeric_cast(OutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)) + { + // never filter out the categories before FirstRealFilter (unlocked/locked, visible/hidden, etc.) + return false; + } + } + // no special case, return the result of the base filter + return filteredByBase; } void OutlinerSearchTypeSelector::initItem(QStandardItem* item, const SearchTypeFilter& filter, int unfilteredDataIndex) { - if (filter.displayName != "--------") + SearchTypeSelector::initItem(item, filter, unfilteredDataIndex); + if (filter.displayName == "--------") { - item->setCheckable(true); - item->setCheckState(filter.enabled ? Qt::Checked : Qt::Unchecked); + item->setCheckable(false); } - if (unfilteredDataIndex < static_cast(OutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)) + if (unfilteredDataIndex >= 0 && unfilteredDataIndex < static_cast(OutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)) { item->setIcon(OutlinerIcons::GetInstance().GetIcon(unfilteredDataIndex)); } diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.h index f1c4ca227a..6b95068af5 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.h +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerSearchWidget.h @@ -37,8 +37,8 @@ namespace AzQtComponents OutlinerSearchTypeSelector(QWidget* parent = nullptr); protected: - // can be used to override the logic when adding items in RepopulateDataModel - bool filterItemOut(int unfilteredDataIndex, bool itemMatchesFilter, bool categoryMatchesFilter) override; + // override the logic of accepting filter categories + bool filterItemOut(const QModelIndex& sourceIndex, bool filteredByBase) override; void initItem(QStandardItem* item, const SearchTypeFilter& filter, int unfilteredDataIndex) override; int GetNumFixedItems() override; }; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp index db8b184c0a..15f371bdaf 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp @@ -135,7 +135,6 @@ namespace AzQtComponents SearchTypeSelector::SearchTypeSelector(QWidget* parent /* = nullptr */) : QMenu(parent) - , m_unfilteredData(nullptr) { Q_ASSERT(parent != nullptr); @@ -196,7 +195,17 @@ namespace AzQtComponents itemLayout->addWidget(m_tree); m_model = new QStandardItemModel(this); - m_tree->setModel(m_model); + m_filterModel = new SearchTypeSelectorFilterModel(this); + m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + m_filterModel->setRecursiveFilteringEnabled(true); + m_filterModel->setSourceModel(m_model); + + // make sure all entries enter the view expanded + connect(m_filterModel, &QAbstractItemModel::rowsInserted, this, [this]() + { + m_tree->expandAll(); + }); + m_tree->setModel(m_filterModel); m_tree->setHeaderHidden(true); connect(m_model, &QStandardItemModel::itemChanged, this, [this](QStandardItem* item) @@ -205,11 +214,6 @@ namespace AzQtComponents if (!m_settingUp) { int index = item->data().toInt(); - if (index < m_filteredItemIndices.size()) - { - index = m_filteredItemIndices[item->data().toInt()]; - } - bool enabled = item->checkState() == Qt::Checked; emit TypeToggled(index, enabled); } @@ -228,169 +232,116 @@ namespace AzQtComponents QMenu::showEvent(e); } - void SearchTypeSelector::resetData() - { - m_estimatedTableHeight = 0; - m_estimatedTableWidth = 0; - - m_filteredItemIndices.clear(); - m_model->clear(); - } - void SearchTypeSelector::initItem(QStandardItem* item, const SearchTypeFilter& filter, int unfilteredDataIndex) { Q_UNUSED(filter); - Q_UNUSED(unfilteredDataIndex); + item->setData(unfilteredDataIndex); + item->setEditable(false); item->setCheckable(true); item->setCheckState(filter.enabled ? Qt::Checked : Qt::Unchecked); } - bool SearchTypeSelector::filterItemOut(int unfilteredDataIndex, bool itemMatchesFilter, bool categoryMatchesFilter) + int SearchTypeSelector::getUnfilteredDataIndex(QStandardItem* item) { - Q_UNUSED(unfilteredDataIndex); - - return !itemMatchesFilter && !categoryMatchesFilter; + const QVariant itemData = item->data(); + if (itemData.isValid()) + { + return item->data().toInt(); + } + return -1; } - void SearchTypeSelector::RepopulateDataModel() + void SearchTypeSelector::RepopulateDataModel(const SearchTypeFilterList& unfilteredData) { - resetData(); - - if (!m_unfilteredData) - { - return; - } - - bool amFiltering = !m_filterString.isEmpty(); + m_estimatedTableHeight = 0; + m_estimatedTableWidth = 0; + m_model->clear(); + m_filterModel->setNoResultsMessageRow(-1); // reset the index for the "no results" message QScopedValueRollback setupGuard(m_settingUp, true); - QMap categories; - QStandardItem* firstCategory = nullptr; - QStandardItem* firstItem = nullptr; - int numCategories = 0; - int numItems = 0; - int numItemsAdded = 0; + QVector categoriesInOrder; // categories in originally specified order + QMap> categoryToEntryItems; // category name to sub-items that will be added + - for (int unfilteredDataIndex = 0, length = m_unfilteredData->length(); unfilteredDataIndex < length; ++unfilteredDataIndex) + const int numItems = unfilteredData.length(); + for (int unfilteredDataIndex = 0; unfilteredDataIndex < numItems; ++unfilteredDataIndex) { - const SearchTypeFilter& filter = m_unfilteredData->at(unfilteredDataIndex); - bool addItem = true; - - bool itemMatchesFilter = true; - bool categoryMatchesFilter = true; - - if (amFiltering) - { - itemMatchesFilter = filter.displayName.contains(m_filterString, Qt::CaseSensitivity::CaseInsensitive); - categoryMatchesFilter = filter.category.contains(m_filterString, Qt::CaseSensitivity::CaseInsensitive); - } - - if (filterItemOut(unfilteredDataIndex, itemMatchesFilter, categoryMatchesFilter)) - { - addItem = false; - } - - QStandardItem* categoryItem = nullptr; - if (categories.contains(filter.category)) - { - categoryItem = categories[filter.category]; - } - else - { - if (categoryMatchesFilter || addItem) - { - categoryItem = new QStandardItem(filter.category); - categories[filter.category] = categoryItem; - m_model->appendRow(categoryItem); - categoryItem->setEditable(false); - - numCategories++; - if (!firstCategory) - { - firstCategory = firstCategory ? firstCategory : categoryItem; - } - } - } - - // count the item even if we filter it out, so that the estimated height includes what it could be if the filter changes - numItems++; - - if (!addItem) - { - continue; - } - - numItemsAdded++; - - m_filteredItemIndices.append(unfilteredDataIndex); + const SearchTypeFilter& filter = unfilteredData.at(unfilteredDataIndex); + // create each item, but don't add them yet, as we don't know if we will be adding to the category items, + // or to the model directly QStandardItem* item = new QStandardItem(filter.displayName); - item->setData(unfilteredDataIndex); - item->setEditable(false); - initItem(item, filter, unfilteredDataIndex); - - if (categoryItem) + categoryToEntryItems[filter.category].push_back(item); + + if (categoriesInOrder.indexOf(filter.category) == -1) { - categoryItem->appendRow(item); - } - else - { - m_model->appendRow(item); + // need to add these category items as they are first encountered so + // that the original category ordering is maintained + categoriesInOrder.push_back(filter.category); } int textWidth = fontMetrics().horizontalAdvance(filter.displayName); if (textWidth > m_estimatedTableWidth) { - m_estimatedTableWidth = textWidth; + m_estimatedTableWidth = textWidth; } + } + const int numCategories = categoriesInOrder.size(); - if (!firstItem) + // If there is only one category and its name is empty, discard it, + // and add its children directly to the model as one big column of N rows + if (numCategories == 1 && categoriesInOrder[0].isEmpty()) + { + auto& entryItems = categoryToEntryItems.begin().value(); + m_model->appendColumn(entryItems); + } + else + { + for (int categoryIndex = 0; categoryIndex < numCategories; ++categoryIndex) { - firstItem = item; + const QString& currCategory = categoriesInOrder[categoryIndex]; + QStandardItem* categoryItem = new QStandardItem(currCategory); + auto& entryItems = categoryToEntryItems[currCategory]; + + categoryItem->appendColumn(entryItems); + m_model->appendRow(categoryItem); // add the parent last, so the model just gets one row add per category } } - if (numItemsAdded == GetNumFixedItems()) - { - QStandardItem* item = new QStandardItem(QObject::tr("No result found.")); - m_model->appendRow(item); - item->setEditable(false); - ++numItems; - } + // add a special row that indicates that no categories (other than the fixed ones) match the filter + // this row itself will be filtered out when there are other matching categories + m_filterModel->setNoResultsMessageRow(m_model->rowCount()); + QStandardItem* noResultsMessage = new QStandardItem(QObject::tr("No result found.")); + noResultsMessage->setEditable(false); + m_model->appendRow(new QStandardItem(QObject::tr("No result found."))); - // If there is only one category and its name is empty, let put everything at root. - if (categories.count() == 1 && categories.begin().key().isEmpty()) - { - m_tree->setRootIndex(categories.begin().value()->index()); - - numCategories = 0; - } - - estimateTableHeight(firstCategory, numCategories, firstItem, numItems); + estimateTableHeight(numCategories, numItems); } - void SearchTypeSelector::estimateTableHeight(QStandardItem* firstCategory, int numCategories, QStandardItem* firstItem, int numItems) + void SearchTypeSelector::estimateTableHeight(int numCategories, int numItems) { m_tree->expandAll(); int totalCategoryHeight = 0; int totalItemHeight = 0; - if (firstItem) + auto* theModel = m_tree->model(); + QModelIndex firstIndex(theModel->index(0, 0)); + QModelIndex firstChild(theModel->index(0, 0, firstIndex)); + + if (firstIndex.isValid()) { - QModelIndex index = m_model->indexFromItem(firstItem); - int itemHeight = m_tree->fetchRowHeight(index); + int itemHeight = m_tree->fetchRowHeight(firstIndex); totalItemHeight += (itemHeight * numItems); } - if (firstCategory) + if (firstChild.isValid()) { - QModelIndex index = m_model->indexFromItem(firstCategory); - int categoryHeight = m_tree->fetchRowHeight(index); + int categoryHeight = m_tree->fetchRowHeight(firstChild); totalCategoryHeight += (categoryHeight * numCategories); } @@ -504,10 +455,7 @@ namespace AzQtComponents void SearchTypeSelector::Setup(const SearchTypeFilterList& searchTypes) { - m_unfilteredData = &searchTypes; - - RepopulateDataModel(); - + RepopulateDataModel(searchTypes); setFixedWidth(m_estimatedTableWidth + FilterWindowWidthPadding); } @@ -578,8 +526,75 @@ namespace AzQtComponents void SearchTypeSelector::FilterTextChanged(const QString& newFilter) { m_filterString = newFilter; + m_filterModel->setFilterWildcard(m_filterString); + } - RepopulateDataModel(); + SearchTypeSelectorFilterModel::SearchTypeSelectorFilterModel(SearchTypeSelector* searchTypeSelector) + : QSortFilterProxyModel(searchTypeSelector), m_searchTypeSelector(searchTypeSelector) + { + // use queued connections so that the normal sort/filter operations get a chance to finish the index remapping before we act + connect(this, &QAbstractItemModel::rowsInserted, this, &SearchTypeSelectorFilterModel::onRowCountChanged, Qt::QueuedConnection); + connect(this, &QAbstractItemModel::rowsRemoved, this, &SearchTypeSelectorFilterModel::onRowCountChanged, Qt::QueuedConnection); + } + + void SearchTypeSelectorFilterModel::setNoResultsMessageRow(int row) + { + m_noResultsRow = row; + invalidateFilter(); + } + + + void SearchTypeSelectorFilterModel::onRowCountChanged() + { + // see if we need to hide or show the "no results" message item + const int numLeafNodes = getNumLeafNodes(); + + // check if we're down to the (never filtered) fixed items, and should show the "no results" message, + // or if we were already showing that message, check if we have more than the fixed items plus the message itself + const bool hasResultsChanged = (m_showingNoResultsMessage ? numLeafNodes > m_searchTypeSelector->GetNumFixedItems() + 1 + : numLeafNodes <= m_searchTypeSelector->GetNumFixedItems()); + + if (hasResultsChanged) + { + m_showingNoResultsMessage = !m_showingNoResultsMessage; + QModelIndex noResultsMessageIndex = sourceModel()->index(m_noResultsRow, 0); + + // The no results row is in the source model, so trigger dataChanged to allow us to re-filter it + emit sourceModel()->dataChanged(noResultsMessageIndex, noResultsMessageIndex); + } + } + + bool SearchTypeSelectorFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const + { + // if we're considering the "no results" item, accept it only if we're m_showingNoResultsMessage + if (!source_parent.isValid() && source_row == m_noResultsRow) + { + return m_showingNoResultsMessage; + } + + const bool filteredByBase = ! QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); + + // allow searchTypeSelector to make the final decision whether to filter out this item + return !(m_searchTypeSelector->filterItemOut(m_searchTypeSelector->m_model->index(source_row, 0, source_parent), filteredByBase)); + } + + int SearchTypeSelectorFilterModel::getNumLeafNodes(const QModelIndex& theIndex) + { + // count the number of leaf nodes descending from this index, not including itself + int numLeafNodes = 0; + for (int childRow = 0, numChildRows = rowCount(theIndex); childRow < numChildRows; ++childRow) + { + QModelIndex childIndex = index(childRow, 0, theIndex); + if (rowCount(childIndex) == 0) + { + ++numLeafNodes; + } + else + { + numLeafNodes += getNumLeafNodes(childIndex); + } + } + return numLeafNodes; } FilteredSearchWidget::Config FilteredSearchWidget::loadConfig(QSettings& settings) @@ -929,7 +944,7 @@ namespace AzQtComponents { { QSignalBlocker blocker(this); - ConfigHelpers::GroupGuard(&settings, widgetName); + ConfigHelpers::GroupGuard guard(&settings, widgetName); const auto textFilter = settings.value(g_textFilterKey); if (textFilter.isValid()) { @@ -953,7 +968,7 @@ namespace AzQtComponents void FilteredSearchWidget::writeSettings(QSettings& settings, const QString& widgetName) { - ConfigHelpers::GroupGuard(&settings, widgetName); + ConfigHelpers::GroupGuard guard(&settings, widgetName); settings.setValue(g_textFilterKey, textFilter()); const int size = m_typeFilters.size(); diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.h index a86d63ad95..4e74d3b410 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.h @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #endif @@ -28,9 +30,7 @@ namespace Ui class FlowLayout; class QTreeView; -class QSortFilterProxyModel; class QStandardItemModel; -class QStandardItem; class QSettings; class QLineEdit; class QToolButton; @@ -43,6 +43,7 @@ namespace AzQtComponents { class Style; class FilteredSearchItemDelegate; + class SearchTypeSelectorFilterModel; class AZ_QT_COMPONENTS_API FilterCriteriaButton : public QFrame @@ -160,28 +161,27 @@ namespace AzQtComponents void FilterTextChanged(const QString& newFilter); protected: - void estimateTableHeight(QStandardItem* firstCategory, int numCategories, QStandardItem* firstItem, int numItems); - void resetData(); + void estimateTableHeight(int numCategories, int numItems); - // can be used to override the logic when adding items in RepopulateDataModel - virtual bool filterItemOut(int index, bool itemMatchesFilter, bool categoryMatchesFilter); + // allows child classes to override the logic of accepting filter categories + virtual bool filterItemOut(const QModelIndex& sourceIndex, bool filteredByBase) { Q_UNUSED(sourceIndex); return filteredByBase; } virtual void initItem(QStandardItem* item, const SearchTypeFilter& filter, int unfilteredDataIndex); + int getUnfilteredDataIndex(QStandardItem* item); // get the original filter index from the item itself // Returns the number of items that always appear in the list, regardless of the filtering. virtual int GetNumFixedItems() { return 0; } void showEvent(QShowEvent* e) override; - virtual void RepopulateDataModel(); + void RepopulateDataModel(const SearchTypeFilterList& unfilteredData); void maximizeGeometryToFitScreen(); SearchTypeSelectorTreeView* m_tree; QStandardItemModel* m_model; - const SearchTypeFilterList* m_unfilteredData; - AZ_PUSH_DISABLE_WARNING(4127 4251, "-Wunknown-warning-option") // conditional expression is constant, needs to have dll-interface to be used by clients of class 'AzQtComponents::SearchTypeSelector' - QVector m_filteredItemIndices; - AZ_POP_DISABLE_WARNING - QString m_filterString; + + friend class SearchTypeSelectorFilterModel; + SearchTypeSelectorFilterModel* m_filterModel; + QString m_filterString; bool m_settingUp = false; int m_fixedWidth = 256; QLineEdit* m_searchField = nullptr; @@ -193,6 +193,26 @@ namespace AzQtComponents bool m_lineEditSearchVisible = true; }; + class SearchTypeSelectorFilterModel : public QSortFilterProxyModel + { + Q_OBJECT + + public: + SearchTypeSelectorFilterModel(SearchTypeSelector* searchTypeSelector); + void setNoResultsMessageRow(int row); // row of specialized "no results" message in the source model + + protected slots: + void onRowCountChanged(); + + protected: + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; + int getNumLeafNodes(const QModelIndex& theIndex = QModelIndex()); // gets the number of leaf node descendants of current index. Current index is *not* considered + + SearchTypeSelector* m_searchTypeSelector = nullptr; + int m_noResultsRow = -1; // row of specialized "no results" message in the source model + bool m_showingNoResultsMessage = false; + }; + class AZ_QT_COMPONENTS_API FilteredSearchWidget : public QFrame { diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker.cpp index e513c23d54..bab5044d8f 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker.cpp @@ -109,13 +109,13 @@ namespace AzQtComponents void ReadColorGridConfig(QSettings& settings, const QString& name, ColorPicker::ColorGridConfig& colorGrid) { - ConfigHelpers::GroupGuard(&settings, name); + ConfigHelpers::GroupGuard guard(&settings, name); ConfigHelpers::read(settings, QStringLiteral("MinimumSize"), colorGrid.minimumSize); } void ReadDialoButtonsConfig(QSettings& settings, const QString& name, ColorPicker::DialogButtonsConfig& dialogButtons) { - ConfigHelpers::GroupGuard(&settings, name); + ConfigHelpers::GroupGuard guard(&settings, name); ConfigHelpers::read(settings, QStringLiteral("TopPadding"), dialogButtons.topPadding); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.cpp index 157a49bd6a..ff7a43431f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.cpp @@ -36,18 +36,29 @@ namespace AzToolsFramework { } - bool EntityOutlinerSearchTypeSelector::filterItemOut(int unfilteredDataIndex, bool itemMatchesFilter, bool categoryMatchesFilter) + bool EntityOutlinerSearchTypeSelector::filterItemOut(const QModelIndex& sourceIndex, bool filteredByBase) { - bool unfilteredIndexInvalid = (unfilteredDataIndex >= aznumeric_cast(EntityOutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)); - return SearchTypeSelector::filterItemOut(unfilteredDataIndex, itemMatchesFilter, categoryMatchesFilter) && unfilteredIndexInvalid; + auto* currItem = m_model->itemFromIndex(sourceIndex); + if (currItem != nullptr) + { + int unfilteredIndex = getUnfilteredDataIndex(currItem); + if (unfilteredIndex >= 0 && unfilteredIndex < aznumeric_cast(EntityOutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)) + { + // never filter out the categories before FirstRealFilter (unlocked/locked, visible/hidden, etc.) + return false; + } + } + // no special case, return the result of the base filter + return filteredByBase; } void EntityOutlinerSearchTypeSelector::initItem(QStandardItem* item, const AzQtComponents::SearchTypeFilter& filter, int unfilteredDataIndex) { - if (filter.displayName != "--------") + SearchTypeSelector::initItem(item, filter, unfilteredDataIndex); + if (filter.displayName == "--------") { - item->setCheckable(true); - item->setCheckState(filter.enabled ? Qt::Checked : Qt::Unchecked); + SearchTypeSelector::initItem(item, filter, unfilteredDataIndex); + item->setCheckable(false); } if (unfilteredDataIndex < aznumeric_cast(EntityOutlinerSearchWidget::GlobalSearchCriteria::FirstRealFilter)) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.h index 7c11a34e53..3776f17eba 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerSearchWidget.h @@ -39,8 +39,8 @@ namespace AzToolsFramework EntityOutlinerSearchTypeSelector(QWidget* parent = nullptr); protected: - // can be used to override the logic when adding items in RepopulateDataModel - bool filterItemOut(int unfilteredDataIndex, bool itemMatchesFilter, bool categoryMatchesFilter) override; + // override the logic of accepting filter categories + bool filterItemOut(const QModelIndex& sourceIndex, bool filteredByBase) override; void initItem(QStandardItem* item, const AzQtComponents::SearchTypeFilter& filter, int unfilteredDataIndex) override; int GetNumFixedItems() override; }; From 73522e90c94608bee6a618781f35a9b0d2ee68a4 Mon Sep 17 00:00:00 2001 From: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Date: Thu, 1 Jul 2021 15:46:55 -0700 Subject: [PATCH 25/75] FBX -> Scene, part 2. Code changes, file renames (#1704) * First pass FBX -> Scene File conversion. This is the simple pass, minimizing code changes and focused on comments. Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> * Step 1 of part 2 of the FBX -> Scene rename Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> * Renaming FbxSceneBuilder folder to SceneBuilder Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> * Renamed files Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> * More FBX -> Scene Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- .../native/utilities/ApplicationManager.cpp | 2 +- Code/Tools/SceneAPI/CMakeLists.txt | 2 +- .../FbxImportRequestHandler.cpp | 106 ------------------ .../FbxSceneBuilder/FbxImportRequestHandler.h | 55 --------- .../SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp | 4 +- .../SceneAPI/SDKWrapper/AssImpNodeWrapper.h | 2 +- .../SceneAPI/SDKWrapper/MaterialWrapper.cpp | 15 +-- .../SceneAPI/SDKWrapper/MaterialWrapper.h | 9 -- .../Tools/SceneAPI/SDKWrapper/NodeWrapper.cpp | 15 +-- Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.h | 8 -- .../SceneAPI/SDKWrapper/SceneWrapper.cpp | 14 +-- Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.h | 8 -- .../CMakeLists.txt | 24 ++-- .../DllMain.cpp | 44 ++++---- .../ImportContexts/AssImpImportContexts.cpp | 18 +-- .../ImportContexts/AssImpImportContexts.h | 24 ++-- .../ImportContexts/ImportContexts.cpp | 6 +- .../ImportContexts/ImportContexts.h | 4 +- .../Importers/AssImpAnimationImporter.cpp | 14 +-- .../Importers/AssImpAnimationImporter.h | 6 +- .../AssImpBitangentStreamImporter.cpp | 10 +- .../Importers/AssImpBitangentStreamImporter.h | 6 +- .../Importers/AssImpBlendShapeImporter.cpp | 14 +-- .../Importers/AssImpBlendShapeImporter.h | 6 +- .../Importers/AssImpBoneImporter.cpp | 12 +- .../Importers/AssImpBoneImporter.h | 6 +- .../Importers/AssImpColorStreamImporter.cpp | 10 +- .../Importers/AssImpColorStreamImporter.h | 6 +- .../Importers/AssImpImporterUtilities.cpp | 6 +- .../Importers/AssImpImporterUtilities.h | 2 +- .../Importers/AssImpMaterialImporter.cpp | 18 +-- .../Importers/AssImpMaterialImporter.h | 6 +- .../Importers/AssImpMeshImporter.cpp | 10 +- .../Importers/AssImpMeshImporter.h | 6 +- .../Importers/AssImpSkinImporter.cpp | 10 +- .../Importers/AssImpSkinImporter.h | 6 +- .../Importers/AssImpSkinWeightsImporter.cpp | 12 +- .../Importers/AssImpSkinWeightsImporter.h | 11 +- .../Importers/AssImpTangentStreamImporter.cpp | 10 +- .../Importers/AssImpTangentStreamImporter.h | 6 +- .../Importers/AssImpTransformImporter.cpp | 14 +-- .../Importers/AssImpTransformImporter.h | 6 +- .../Importers/AssImpUvMapImporter.cpp | 14 +-- .../Importers/AssImpUvMapImporter.h | 6 +- .../Importers/ImporterUtilities.cpp | 8 +- .../Importers/ImporterUtilities.h | 10 +- .../Importers/ImporterUtilities.inl | 6 +- .../Utilities/AssImpMeshImporterUtilities.cpp | 10 +- .../Utilities/AssImpMeshImporterUtilities.h | 11 +- .../Importers/Utilities/RenamedNodesMap.cpp | 8 +- .../Importers/Utilities/RenamedNodesMap.h | 9 +- .../Platform/Linux/platform_linux_files.cmake | 0 .../Platform/Mac/platform_mac_files.cmake | 0 .../Windows/platform_windows_files.cmake | 0 .../SceneBuilderConfiguration.h} | 8 +- .../SceneImportRequestHandler.cpp | 103 +++++++++++++++++ .../SceneBuilder/SceneImportRequestHandler.h | 52 +++++++++ .../SceneImporter.cpp} | 42 +++---- .../SceneImporter.h} | 18 +-- .../SceneSystem.cpp} | 20 ++-- .../SceneSystem.h} | 10 +- .../SceneImporterUtilitiesTests.cpp} | 22 ++-- .../Utilities/RenamedNodesMapTests.cpp | 6 +- .../Tests/TestFbxMesh.cpp | 0 .../Tests/TestFbxMesh.h | 0 .../Tests/TestFbxNode.cpp | 0 .../Tests/TestFbxNode.h | 0 .../Tests/TestFbxSkin.cpp | 0 .../Tests/TestFbxSkin.h | 0 .../Tests/TestsMain.cpp | 20 ++-- .../scenebuilder_files.cmake} | 14 +-- .../scenebuilder_shared_files.cmake} | 0 .../scenebuilder_testing_files.cmake} | 2 +- .../SceneCore/Containers/SceneGraph.h | 6 +- .../SceneCore/DataTypes/GraphData/IMeshData.h | 4 +- .../Code/Source/Pipeline/MeshExporter.cpp | 30 ++--- .../PhysX/Code/Source/Pipeline/MeshExporter.h | 4 +- Gems/PhysX/Code/Source/Pipeline/MeshGroup.cpp | 2 +- Gems/SceneLoggingExample/ReadMe.txt | 2 +- Gems/SceneProcessing/Code/CMakeLists.txt | 2 +- .../SceneProcessingConfigSystemComponent.cpp | 6 +- .../Code/Source/SceneProcessingModule.cpp | 4 +- .../Code/Source/SceneProcessingModule.h | 2 +- 83 files changed, 475 insertions(+), 559 deletions(-) delete mode 100644 Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp delete mode 100644 Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/CMakeLists.txt (70%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/DllMain.cpp (71%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/ImportContexts/AssImpImportContexts.cpp (92%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/ImportContexts/AssImpImportContexts.h (91%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/ImportContexts/ImportContexts.cpp (97%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/ImportContexts/ImportContexts.h (99%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpAnimationImporter.cpp (98%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpAnimationImporter.h (90%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBitangentStreamImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBitangentStreamImporter.h (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBlendShapeImporter.cpp (96%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBlendShapeImporter.h (86%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBoneImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpBoneImporter.h (86%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpColorStreamImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpColorStreamImporter.h (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpImporterUtilities.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpImporterUtilities.h (96%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpMaterialImporter.cpp (94%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpMaterialImporter.h (88%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpMeshImporter.cpp (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpMeshImporter.h (86%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpSkinImporter.cpp (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpSkinImporter.h (86%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpSkinWeightsImporter.cpp (94%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpSkinWeightsImporter.h (91%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpTangentStreamImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpTangentStreamImporter.h (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpTransformImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpTransformImporter.h (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpUvMapImporter.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/AssImpUvMapImporter.h (87%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/ImporterUtilities.cpp (98%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/ImporterUtilities.h (88%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/ImporterUtilities.inl (94%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/Utilities/AssImpMeshImporterUtilities.cpp (93%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/Utilities/AssImpMeshImporterUtilities.h (84%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/Utilities/RenamedNodesMap.cpp (97%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Importers/Utilities/RenamedNodesMap.h (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Platform/Linux/platform_linux_files.cmake (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Platform/Mac/platform_mac_files.cmake (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Platform/Windows/platform_windows_files.cmake (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/FbxSceneBuilderConfiguration.h => SceneBuilder/SceneBuilderConfiguration.h} (67%) create mode 100644 Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp create mode 100644 Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.h rename Code/Tools/SceneAPI/{FbxSceneBuilder/FbxImporter.cpp => SceneBuilder/SceneImporter.cpp} (88%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/FbxImporter.h => SceneBuilder/SceneImporter.h} (70%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/FbxSceneSystem.cpp => SceneBuilder/SceneSystem.cpp} (89%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/FbxSceneSystem.h => SceneBuilder/SceneSystem.h} (81%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/Tests/Importers/FbxImporterUtilitiesTests.cpp => SceneBuilder/Tests/Importers/SceneImporterUtilitiesTests.cpp} (83%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/Importers/Utilities/RenamedNodesMapTests.cpp (95%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxMesh.cpp (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxMesh.h (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxNode.cpp (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxNode.h (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxSkin.cpp (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestFbxSkin.h (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder => SceneBuilder}/Tests/TestsMain.cpp (67%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/fbxscenebuilder_files.cmake => SceneBuilder/scenebuilder_files.cmake} (91%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/fbxscenebuilder_shared_files.cmake => SceneBuilder/scenebuilder_shared_files.cmake} (100%) rename Code/Tools/SceneAPI/{FbxSceneBuilder/fbxscenebuilder_testing_files.cmake => SceneBuilder/scenebuilder_testing_files.cmake} (85%) diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp index 33f5f43962..28d1850b40 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp @@ -446,7 +446,7 @@ void ApplicationManager::PopulateApplicationDependencies() // any of those should cause AP to drop. for (const QString& pathName : { "CrySystem", "SceneCore", "SceneData", - "FbxSceneBuilder", "AzQtComponents" + "SceneBuilder", "AzQtComponents" }) { QString pathWithPlatformExtension = pathName + QString(AZ_DYNAMIC_LIBRARY_EXTENSION); diff --git a/Code/Tools/SceneAPI/CMakeLists.txt b/Code/Tools/SceneAPI/CMakeLists.txt index 6085b7a691..f86fd71e28 100644 --- a/Code/Tools/SceneAPI/CMakeLists.txt +++ b/Code/Tools/SceneAPI/CMakeLists.txt @@ -5,7 +5,7 @@ # # -add_subdirectory(FbxSceneBuilder) +add_subdirectory(SceneBuilder) add_subdirectory(SceneCore) add_subdirectory(SceneData) add_subdirectory(SceneUI) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp deleted file mode 100644 index 8df2ca71c2..0000000000 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace FbxSceneImporter - { - void SceneImporterSettings::Reflect(AZ::ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context); serializeContext) - { - serializeContext->Class() - ->Version(2) - ->Field("SupportedFileTypeExtensions", &SceneImporterSettings::m_supportedFileTypeExtensions); - } - } - - void FbxImportRequestHandler::Activate() - { - if (auto* settingsRegistry = AZ::SettingsRegistry::Get()) - { - settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter"); - } - - BusConnect(); - } - - void FbxImportRequestHandler::Deactivate() - { - BusDisconnect(); - } - - void FbxImportRequestHandler::Reflect(ReflectContext* context) - { - SceneImporterSettings::Reflect(context); - - SerializeContext* serializeContext = azrtti_cast(context); - if (serializeContext) - { - serializeContext->Class()->Version(1)->Attribute( - AZ::Edit::Attributes::SystemComponentTags, - AZStd::vector( - {AssetBuilderSDK::ComponentTags::AssetBuilder, - AssetImportRequest::GetAssetImportRequestComponentTag()})); - - } - } - - void FbxImportRequestHandler::GetSupportedFileExtensions(AZStd::unordered_set& extensions) - { - extensions.insert(m_settings.m_supportedFileTypeExtensions.begin(), m_settings.m_supportedFileTypeExtensions.end()); - } - - Events::LoadingResult FbxImportRequestHandler::LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, [[maybe_unused]] RequestingApplication requester) - { - AZStd::string extension; - StringFunc::Path::GetExtension(path.c_str(), extension); - AZStd::to_lower(extension.begin(), extension.end()); - - if (!m_settings.m_supportedFileTypeExtensions.contains(extension)) - { - return Events::LoadingResult::Ignored; - } - - scene.SetSource(path, guid); - - // Push contexts - Events::ProcessingResultCombiner contextResult; - contextResult += Events::Process(path); - contextResult += Events::Process(path, scene); - contextResult += Events::Process(scene); - - if (contextResult.GetResult() == Events::ProcessingResult::Success) - { - return Events::LoadingResult::AssetLoaded; - } - else - { - return Events::LoadingResult::AssetFailure; - } - } - - void FbxImportRequestHandler::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided) - { - provided.emplace_back(AZ_CRC_CE("AssetImportRequestHandler")); - } - } // namespace Import - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h deleted file mode 100644 index 88c7322807..0000000000 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace FbxSceneImporter - { - struct SceneImporterSettings - { - AZ_TYPE_INFO(SceneImporterSettings, "{8BB6C7AD-BF99-44DC-9DA1-E7AD3F03DC10}"); - - static void Reflect(AZ::ReflectContext* context); - - AZStd::unordered_set m_supportedFileTypeExtensions; - }; - - class FbxImportRequestHandler - : public AZ::Component - , public Events::AssetImportRequestBus::Handler - { - public: - AZ_COMPONENT(FbxImportRequestHandler, "{9F4B189C-0A96-4F44-A5F0-E087FF1561F8}"); - - ~FbxImportRequestHandler() override = default; - - void Activate() override; - void Deactivate() override; - static void Reflect(ReflectContext* context); - - void GetSupportedFileExtensions(AZStd::unordered_set& extensions) override; - Events::LoadingResult LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, - RequestingApplication requester) override; - - static void GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided); - - private: - - SceneImporterSettings m_settings; - - static constexpr const char* SettingsFilename = "AssetImporterSettings.json"; - }; - } // namespace FbxSceneImporter - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp index 8819053152..f1ae433bca 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp +++ b/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.cpp @@ -15,8 +15,8 @@ namespace AZ { namespace AssImpSDKWrapper { - AssImpNodeWrapper::AssImpNodeWrapper(aiNode* fbxNode) - :SDKNode::NodeWrapper(fbxNode) + AssImpNodeWrapper::AssImpNodeWrapper(aiNode* sourceNode) + :SDKNode::NodeWrapper(sourceNode) { AZ_Assert(m_assImpNode, "Asset Importer Node cannot be null"); } diff --git a/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.h b/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.h index 203f0a5fa5..a2345b09a8 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.h +++ b/Code/Tools/SceneAPI/SDKWrapper/AssImpNodeWrapper.h @@ -18,7 +18,7 @@ namespace AZ { public: AZ_RTTI(AssImpNodeWrapper, "{1043260B-9076-49B7-AD38-EF62E85F7C1D}", SDKNode::NodeWrapper); - AssImpNodeWrapper(aiNode* fbxNode); + AssImpNodeWrapper(aiNode* sourceNode); ~AssImpNodeWrapper() override; const char* GetName() const override; AZ::u64 GetUniqueId() const override; diff --git a/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.cpp index efcab5cc2c..9adc9b414e 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.cpp +++ b/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.cpp @@ -11,29 +11,16 @@ namespace AZ { namespace SDKMaterial { - MaterialWrapper::MaterialWrapper(fbxsdk::FbxSurfaceMaterial* fbxMaterial) - :m_fbxMaterial(fbxMaterial) - , m_assImpMaterial(nullptr) - { - } - MaterialWrapper::MaterialWrapper(aiMaterial* assImpMaterial) - :m_fbxMaterial(nullptr) - , m_assImpMaterial(assImpMaterial) + : m_assImpMaterial(assImpMaterial) { } MaterialWrapper::~MaterialWrapper() { - m_fbxMaterial = nullptr; m_assImpMaterial = nullptr; } - fbxsdk::FbxSurfaceMaterial* MaterialWrapper::GetFbxMaterial() - { - return m_fbxMaterial; - } - aiMaterial* MaterialWrapper::GetAssImpMaterial() { return m_assImpMaterial; diff --git a/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.h b/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.h index 7ad4148ad8..4cdcd5a627 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.h +++ b/Code/Tools/SceneAPI/SDKWrapper/MaterialWrapper.h @@ -10,14 +10,8 @@ #include #include -namespace fbxsdk -{ - class FbxSurfaceMaterial; -} - struct aiMaterial; - namespace AZ { namespace SDKMaterial @@ -39,11 +33,9 @@ namespace AZ BaseColor }; - MaterialWrapper(fbxsdk::FbxSurfaceMaterial* fbxMaterial); MaterialWrapper(aiMaterial* assImpmaterial); virtual ~MaterialWrapper(); - fbxsdk::FbxSurfaceMaterial* GetFbxMaterial(); aiMaterial* GetAssImpMaterial(); virtual AZStd::string GetName() const; @@ -56,7 +48,6 @@ namespace AZ virtual float GetShininess() const; protected: - fbxsdk::FbxSurfaceMaterial* m_fbxMaterial = nullptr; aiMaterial* m_assImpMaterial = nullptr; }; } // namespace SDKMaterial diff --git a/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.cpp index 9adc93ff69..bdc428840c 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.cpp +++ b/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.cpp @@ -11,29 +11,16 @@ namespace AZ { namespace SDKNode { - NodeWrapper::NodeWrapper(fbxsdk::FbxNode* fbxNode) - :m_fbxNode(fbxNode) - , m_assImpNode(nullptr) - { - } - NodeWrapper::NodeWrapper(aiNode* aiNode) - :m_fbxNode(nullptr) - , m_assImpNode(aiNode) + : m_assImpNode(aiNode) { } NodeWrapper::~NodeWrapper() { - m_fbxNode = nullptr; m_assImpNode = nullptr; } - fbxsdk::FbxNode* NodeWrapper::GetFbxNode() - { - return m_fbxNode; - } - aiNode* NodeWrapper::GetAssImpNode() { return m_assImpNode; diff --git a/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.h b/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.h index 1863bc3751..abda330b10 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.h +++ b/Code/Tools/SceneAPI/SDKWrapper/NodeWrapper.h @@ -6,10 +6,6 @@ */ #pragma once #include -namespace fbxsdk -{ - class FbxNode; -} struct aiNode; @@ -23,7 +19,6 @@ namespace AZ AZ_RTTI(NodeWrapper, "{5EB0897B-9728-44B7-B056-BA34AAF14715}"); NodeWrapper() = default; - NodeWrapper(fbxsdk::FbxNode* fbxNode); NodeWrapper(aiNode* aiNode); virtual ~NodeWrapper(); @@ -34,7 +29,6 @@ namespace AZ Component_Z }; - fbxsdk::FbxNode* GetFbxNode(); aiNode* GetAssImpNode(); virtual const char* GetName() const; @@ -44,8 +38,6 @@ namespace AZ virtual int GetChildCount()const; virtual const std::shared_ptr GetChild(int childIndex) const; - - fbxsdk::FbxNode* m_fbxNode = nullptr; aiNode* m_assImpNode = nullptr; }; } //namespace Node diff --git a/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.cpp index 2329221a2c..e14173c163 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.cpp +++ b/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.cpp @@ -12,15 +12,8 @@ namespace AZ { const char* SceneWrapperBase::s_defaultSceneName = "myScene"; - SceneWrapperBase::SceneWrapperBase(fbxsdk::FbxScene* fbxScene) - :m_fbxScene(fbxScene) - , m_assImpScene(nullptr) - { - } - SceneWrapperBase::SceneWrapperBase(aiScene* aiScene) - :m_fbxScene(nullptr) - , m_assImpScene(aiScene) + : m_assImpScene(aiScene) { } @@ -47,11 +40,6 @@ namespace AZ { } - fbxsdk::FbxScene* SceneWrapperBase::GetFbxScene() const - { - return m_fbxScene; - } - const aiScene* SceneWrapperBase::GetAssImpScene() const { return m_assImpScene; diff --git a/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.h b/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.h index f5dcc0d862..2a8c6d6c14 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.h +++ b/Code/Tools/SceneAPI/SDKWrapper/SceneWrapper.h @@ -8,14 +8,9 @@ #include #include #include -namespace fbxsdk -{ - class FbxScene; -} struct aiScene; - namespace AZ { namespace SDKScene @@ -25,7 +20,6 @@ namespace AZ public: AZ_RTTI(SceneWrapperBase, "{703CD344-2C75-4F30-8CE2-6BDEF2511AFD}"); SceneWrapperBase() = default; - SceneWrapperBase(fbxsdk::FbxScene* fbxScene); virtual ~SceneWrapperBase() = default; SceneWrapperBase(aiScene* aiScene); @@ -37,10 +31,8 @@ namespace AZ virtual void Clear(); - virtual fbxsdk::FbxScene* GetFbxScene() const; virtual const aiScene* GetAssImpScene() const; - fbxsdk::FbxScene* m_fbxScene = nullptr; const aiScene* m_assImpScene = nullptr; static const char* s_defaultSceneName; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/CMakeLists.txt b/Code/Tools/SceneAPI/SceneBuilder/CMakeLists.txt similarity index 70% rename from Code/Tools/SceneAPI/FbxSceneBuilder/CMakeLists.txt rename to Code/Tools/SceneAPI/SceneBuilder/CMakeLists.txt index 5df1777048..029a254527 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/CMakeLists.txt +++ b/Code/Tools/SceneAPI/SceneBuilder/CMakeLists.txt @@ -10,14 +10,14 @@ if (NOT PAL_TRAIT_BUILD_HOST_TOOLS) endif() ly_add_target( - NAME FbxSceneBuilder.Static STATIC + NAME SceneBuilder.Static STATIC NAMESPACE AZ FILES_CMAKE - fbxscenebuilder_files.cmake + scenebuilder_files.cmake Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake COMPILE_DEFINITIONS PRIVATE - FBX_SCENE_BUILDER_EXPORTS + SCENE_BUILDER_EXPORTS INCLUDE_DIRECTORIES PUBLIC ../.. @@ -33,40 +33,40 @@ ly_add_target( ) ly_add_target( - NAME FbxSceneBuilder MODULE + NAME SceneBuilder MODULE NAMESPACE AZ FILES_CMAKE - fbxscenebuilder_shared_files.cmake + scenebuilder_shared_files.cmake COMPILE_DEFINITIONS PRIVATE - FBX_SCENE_BUILDER_EXPORTS + SCENE_BUILDER_EXPORTS INCLUDE_DIRECTORIES PUBLIC ../.. BUILD_DEPENDENCIES PUBLIC - AZ::FbxSceneBuilder.Static + AZ::SceneBuilder.Static PRIVATE AZ::AzCore ) -ly_add_dependencies(AssetBuilder AZ::FbxSceneBuilder) +ly_add_dependencies(AssetBuilder AZ::SceneBuilder) if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_target( - NAME FbxSceneBuilder.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAME SceneBuilder.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ FILES_CMAKE - fbxscenebuilder_testing_files.cmake + scenebuilder_testing_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests BUILD_DEPENDENCIES PRIVATE AZ::AzTest - AZ::FbxSceneBuilder + AZ::SceneBuilder ) ly_add_googletest( - NAME AZ::FbxSceneBuilder.Tests + NAME AZ::SceneBuilder.Tests ) endif() diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp b/Code/Tools/SceneAPI/SceneBuilder/DllMain.cpp similarity index 71% rename from Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp rename to Code/Tools/SceneAPI/SceneBuilder/DllMain.cpp index a9ff537910..2f6e0e1d07 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/DllMain.cpp @@ -11,27 +11,27 @@ #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 namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { static AZStd::vector g_componentDescriptors; @@ -40,13 +40,13 @@ namespace AZ // Descriptor registration is done in Reflect instead of Initialize because the ResourceCompilerScene initializes the libraries before // there's an application. using namespace AZ::SceneAPI; - using namespace AZ::SceneAPI::FbxSceneBuilder; + using namespace AZ::SceneAPI::SceneBuilder; if (g_componentDescriptors.empty()) { // Global importer and behavior - g_componentDescriptors.push_back(FbxSceneBuilder::FbxImporter::CreateDescriptor()); - g_componentDescriptors.push_back(FbxSceneImporter::FbxImportRequestHandler::CreateDescriptor()); + g_componentDescriptors.push_back(SceneBuilder::SceneImporter::CreateDescriptor()); + g_componentDescriptors.push_back(SceneImportRequestHandler::CreateDescriptor()); // Node and attribute importers g_componentDescriptors.push_back(AssImpBitangentStreamImporter::CreateDescriptor()); @@ -94,7 +94,7 @@ namespace AZ g_componentDescriptors.shrink_to_fit(); } } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ @@ -104,15 +104,15 @@ extern "C" AZ_DLL_EXPORT void InitializeDynamicModule(void* env) } extern "C" AZ_DLL_EXPORT void Reflect(AZ::SerializeContext* context) { - AZ::SceneAPI::FbxSceneBuilder::Reflect(context); + AZ::SceneAPI::SceneBuilder::Reflect(context); } extern "C" AZ_DLL_EXPORT void ReflectBehavior(AZ::BehaviorContext* context) { - AZ::SceneAPI::FbxSceneBuilder::ReflectBehavior(context); + AZ::SceneAPI::SceneBuilder::ReflectBehavior(context); } extern "C" AZ_DLL_EXPORT void UninitializeDynamicModule() { - AZ::SceneAPI::FbxSceneBuilder::Uninitialize(); + AZ::SceneAPI::SceneBuilder::Uninitialize(); AZ::Environment::Detach(); } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.cpp b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.cpp similarity index 92% rename from Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.cpp rename to Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.cpp index a3ba23065d..eea929f2f1 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.cpp @@ -5,7 +5,7 @@ * */ -#include +#include #include #include @@ -13,10 +13,10 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpImportContext::AssImpImportContext(const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode) : m_sourceScene(sourceScene) , m_sourceSceneSystem(sourceSceneSystem) @@ -27,7 +27,7 @@ namespace AZ AssImpNodeEncounteredContext::AssImpNodeEncounteredContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode) : AssImpImportContext(sourceScene, sourceSceneSystem, sourceNode) @@ -39,7 +39,7 @@ namespace AZ Events::ImportEventContext& parent, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode) : AssImpImportContext(sourceScene, sourceSceneSystem, sourceNode) @@ -57,7 +57,7 @@ namespace AZ AssImpSceneDataPopulatedContext::AssImpSceneDataPopulatedContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode, const AZStd::shared_ptr& nodeData, const AZStd::string& dataName) @@ -76,7 +76,7 @@ namespace AZ AssImpSceneNodeAppendedContext::AssImpSceneNodeAppendedContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode) : AssImpImportContext(sourceScene, sourceSceneSystem, sourceNode) , SceneNodeAppendedContextBase(scene, currentGraphPosition, nodeNameMap) @@ -111,7 +111,7 @@ namespace AZ AssImpFinalizeSceneContext::AssImpFinalizeSceneContext(Containers::Scene& scene, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap) : FinalizeSceneContextBase(scene, nodeNameMap) , m_sourceScene(sourceScene) @@ -120,5 +120,5 @@ namespace AZ } } // namespace SceneAPI - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.h b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.h similarity index 91% rename from Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.h rename to Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.h index 99002d1528..c620a8ced2 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/AssImpImportContexts.h +++ b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/AssImpImportContexts.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include namespace AZ @@ -22,8 +22,8 @@ namespace AZ namespace SceneAPI { - class FbxSceneSystem; - namespace FbxSceneBuilder + class SceneSystem; + namespace SceneBuilder { class RenamedNodesMap; @@ -36,12 +36,12 @@ namespace AZ AZ_RTTI(AssImpImportContext, "{B1076AFF-991B-423C-8D3E-D5C9230434AB}"); AssImpImportContext(const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode); const AssImpSDKWrapper::AssImpSceneWrapper& m_sourceScene; AssImpSDKWrapper::AssImpNodeWrapper& m_sourceNode; - const FbxSceneSystem& m_sourceSceneSystem; // Needed for unit and axis conversion + const SceneSystem& m_sourceSceneSystem; // Needed for unit and axis conversion }; // AssImpNodeEncounteredContext @@ -56,14 +56,14 @@ namespace AZ AssImpNodeEncounteredContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode); AssImpNodeEncounteredContext(Events::ImportEventContext& parent, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode); }; @@ -85,7 +85,7 @@ namespace AZ AssImpSceneDataPopulatedContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode, const AZStd::shared_ptr& nodeData, @@ -106,7 +106,7 @@ namespace AZ AssImpSceneNodeAppendedContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap, AssImpSDKWrapper::AssImpNodeWrapper& sourceNode); }; @@ -170,13 +170,13 @@ namespace AZ AssImpFinalizeSceneContext( Containers::Scene& scene, const AssImpSDKWrapper::AssImpSceneWrapper& sourceScene, - const FbxSceneSystem& sourceSceneSystem, + const SceneSystem& sourceSceneSystem, RenamedNodesMap& nodeNameMap); const AssImpSDKWrapper::AssImpSceneWrapper& m_sourceScene; - const FbxSceneSystem& m_sourceSceneSystem; // Needed for unit and axis conversion + const SceneSystem& m_sourceSceneSystem; // Needed for unit and axis conversion }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.cpp b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.cpp similarity index 97% rename from Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.cpp rename to Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.cpp index 130501533d..ae57ad5b9f 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.cpp @@ -5,14 +5,14 @@ * */ -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { ImportContext::ImportContext(Containers::Scene& scene, Containers::SceneGraph::NodeIndex currentGraphPosition, @@ -103,5 +103,5 @@ namespace AZ { } } // namespace SceneAPI - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.h b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.h similarity index 99% rename from Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.h rename to Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.h index 590b585661..db873f5eae 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/ImportContexts/ImportContexts.h +++ b/Code/Tools/SceneAPI/SceneBuilder/ImportContexts/ImportContexts.h @@ -33,7 +33,7 @@ namespace AZ class ImportEventContext; } - namespace FbxSceneBuilder + namespace SceneBuilder { class RenamedNodesMap; @@ -173,7 +173,7 @@ namespace AZ FinalizeSceneContextBase(Containers::Scene& scene, RenamedNodesMap& nodeNameMap); }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.cpp similarity index 98% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.cpp index 071f17a687..e7726de502 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.cpp @@ -12,11 +12,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpAnimationImporter::s_animationNodeName = "animation"; @@ -670,6 +670,6 @@ namespace AZ return Events::ProcessingResult::Success; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.h similarity index 90% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.h index 07a4fe362f..c8e7415378 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpAnimationImporter.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include struct aiAnimation; struct aiMesh; @@ -18,7 +18,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpAnimationImporter : public SceneCore::LoadingComponent @@ -43,6 +43,6 @@ namespace AZ protected: static const char* s_animationNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp index 214ced0dc3..d822ee148e 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp @@ -8,9 +8,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -24,7 +24,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpBitangentStreamImporter::m_defaultNodeName = "Bitangent"; @@ -125,6 +125,6 @@ namespace AZ return bitangentResults; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.h similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.h index 363beabcf6..a5359ab7db 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.h @@ -6,14 +6,14 @@ */ -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpBitangentStreamImporter : public SceneCore::LoadingComponent { @@ -30,6 +30,6 @@ namespace AZ protected: static const char* m_defaultNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.cpp similarity index 96% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.cpp index dbf431a50a..efd5744378 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.cpp @@ -9,11 +9,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpBlendShapeImporter::AssImpBlendShapeImporter() { @@ -234,6 +234,6 @@ namespace AZ return combinedBlendShapeResult.GetResult(); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.h similarity index 86% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.h index fd1b18f812..a5fbd1b817 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBlendShapeImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpBlendShapeImporter : public SceneCore::LoadingComponent @@ -29,6 +29,6 @@ namespace AZ Events::ProcessingResult ImportBlendShapes(AssImpSceneNodeAppendedContext& context); }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.cpp index 58da14ca58..1e46485f1d 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.cpp @@ -9,10 +9,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -24,7 +24,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpBoneImporter::AssImpBoneImporter() { @@ -170,6 +170,6 @@ namespace AZ return Events::ProcessingResult::Success; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.h similarity index 86% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.h index 9b1fc6c390..10b5964cdf 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBoneImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpBoneImporter : public SceneCore::LoadingComponent @@ -29,6 +29,6 @@ namespace AZ Events::ProcessingResult ImportBone(AssImpNodeEncounteredContext& context); }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.cpp index f220f861e3..c1720ec362 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.cpp @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpColorStreamImporter::m_defaultNodeName = "Col"; @@ -126,6 +126,6 @@ namespace AZ return combinedVertexColorResults.GetResult(); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.h similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.h index 6551f6434c..c871a93c63 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpColorStreamImporter.h @@ -6,14 +6,14 @@ */ -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpColorStreamImporter : public SceneCore::LoadingComponent { @@ -30,6 +30,6 @@ namespace AZ protected: static const char* m_defaultNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.cpp index 706f0bda29..929fde19eb 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.cpp @@ -5,7 +5,7 @@ * */ -#include +#include #include #include @@ -16,7 +16,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { bool IsSkinnedMesh(const aiNode& node, const aiScene& scene) { @@ -84,6 +84,6 @@ namespace AZ return combinedTransform; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.h similarity index 96% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.h index a7bb2d3c7c..deba1b0279 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpImporterUtilities.h @@ -15,7 +15,7 @@ struct aiScene; struct aiString; -namespace AZ::SceneAPI::FbxSceneBuilder +namespace AZ::SceneAPI::SceneBuilder { inline constexpr char PivotNodeMarker[] = "_$AssimpFbx$_"; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.cpp similarity index 94% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.cpp index 57ae04cc19..f2194c352b 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.cpp @@ -5,16 +5,16 @@ * */ -#include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpMaterialImporter::AssImpMaterialImporter() { @@ -164,7 +164,7 @@ namespace AZ if (materialResult != Events::ProcessingResult::Failure) { - materialResult = SceneAPI::FbxSceneBuilder::AddAttributeDataNodeWithContexts(dataPopulated); + materialResult = SceneAPI::SceneBuilder::AddAttributeDataNodeWithContexts(dataPopulated); } combinedMaterialImportResults += materialResult; @@ -186,7 +186,7 @@ namespace AZ AZ::StringFunc::Path::StripFullName(cleanedUpSceneFilePath); AZ::StringFunc::Path::Join(cleanedUpSceneFilePath.c_str(), textureFilePath.c_str(), texturePathRelativeToScene); - // If the texture did start with marker to change directories upward, then it's relative to the FBX file, + // If the texture did start with marker to change directories upward, then it's relative to the scene file, // and that path needs to be resolved. It can't be resolved later. This was handled internally by FBX SDK, // but is not handled by AssImp. if (textureFilePath.starts_with("..")) @@ -196,7 +196,7 @@ namespace AZ } // The engine only supports relative paths to scan folders. - // FBX files may have paths to textures, relative to the FBX file. Check for those, first. + // Scene files may have paths to textures, relative to the scene file. Check for those, first. if (AZ::IO::FileIOBase::GetInstance()->Exists(texturePathRelativeToScene.c_str())) { return texturePathRelativeToScene; @@ -205,6 +205,6 @@ namespace AZ return textureFilePath; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.h similarity index 88% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.h index 1879159432..e4e75eff3c 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMaterialImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpMaterialImporter : public SceneCore::LoadingComponent @@ -32,6 +32,6 @@ namespace AZ private: AZStd::string ResolveTexturePath(const AZStd::string& sceneFilePath, const AZStd::string& textureFilePath) const; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.cpp similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.cpp index 1f1f2c3567..b3c4cf68db 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.cpp @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -20,7 +20,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpMeshImporter::AssImpMeshImporter() { @@ -57,6 +57,6 @@ namespace AZ return Events::ProcessingResult::Failure; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.h similarity index 86% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.h index b7da6e375f..2337400d13 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpMeshImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpMeshImporter : public SceneCore::LoadingComponent @@ -29,6 +29,6 @@ namespace AZ Events::ProcessingResult ImportMesh(AssImpNodeEncounteredContext& context); }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.cpp similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.cpp index a8e954cf35..5dff07aae7 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.cpp @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -20,7 +20,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { AssImpSkinImporter::AssImpSkinImporter() { @@ -57,6 +57,6 @@ namespace AZ return Events::ProcessingResult::Failure; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.h similarity index 86% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.h index 3183acb665..31548d670d 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpSkinImporter : public SceneCore::LoadingComponent @@ -29,6 +29,6 @@ namespace AZ Events::ProcessingResult ImportSkin(AssImpNodeEncounteredContext& context); }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.cpp similarity index 94% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.cpp index b83ec3872e..532a397f88 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.cpp @@ -9,10 +9,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -23,7 +23,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const AZStd::string AssImpSkinWeightsImporter::s_skinWeightName = "SkinWeight_"; @@ -142,6 +142,6 @@ namespace AZ m_pendingSkinWeights.clear(); return result; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.h similarity index 91% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.h index 76b196b8e2..be54db5530 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpSkinWeightsImporter.h @@ -9,17 +9,12 @@ #include #include -#include +#include #include #include namespace AZ { - namespace FbxSDKWrapper - { - class FbxMeshWrapper; - } - namespace SceneData { namespace GraphData @@ -35,7 +30,7 @@ namespace AZ class PostImportEventContext; } - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpSkinWeightsImporter : public SceneCore::LoadingComponent @@ -68,6 +63,6 @@ namespace AZ static const AZStd::string s_skinWeightName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp index e4a85b15b9..97c9c6c004 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp @@ -9,9 +9,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpTangentStreamImporter::m_defaultNodeName = "Tangent"; @@ -127,6 +127,6 @@ namespace AZ return tangentResults; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.h similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.h index 91a479f341..6cd830a8b5 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.h @@ -6,14 +6,14 @@ */ -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpTangentStreamImporter : public SceneCore::LoadingComponent { @@ -30,6 +30,6 @@ namespace AZ protected: static const char* m_defaultNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.cpp index 1a7d0e5e8a..09f8575351 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.cpp @@ -4,27 +4,27 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include #include -#include +#include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpTransformImporter::s_transformNodeName = "transform"; @@ -198,6 +198,6 @@ namespace AZ return Events::ProcessingResult::Ignored; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.h similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.h index 418c673dd4..f6afa4742c 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTransformImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpTransformImporter : public SceneCore::LoadingComponent @@ -30,6 +30,6 @@ namespace AZ Events::ProcessingResult ImportTransform(AssImpSceneNodeAppendedContext& context); static const char* s_transformNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp index 7c3569a159..f8319330ac 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.cpp @@ -11,10 +11,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { const char* AssImpUvMapImporter::m_defaultNodeName = "UV"; @@ -141,7 +141,7 @@ namespace AZ { AZ::Vector2 vertexUV( mesh->mTextureCoords[texCoordIndex][v].x, - // The engine's V coordinate is reverse of how it's stored in the FBX file. + // The engine's V coordinate is reverse of how it's coming in from the SDK. 1.0f - mesh->mTextureCoords[texCoordIndex][v].y); uvMap->AppendUV(vertexUV); } @@ -175,6 +175,6 @@ namespace AZ return combinedUvMapResults.GetResult(); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.h similarity index 87% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.h index 21ef69c8bc..249e305a50 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpUvMapImporter.h @@ -7,14 +7,14 @@ #pragma once -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class AssImpUvMapImporter : public SceneCore::LoadingComponent @@ -32,6 +32,6 @@ namespace AZ protected: static const char* m_defaultNodeName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.cpp similarity index 98% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.cpp index 89ec1142d8..48c00f5114 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.cpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -25,7 +25,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { static const float g_sceneUtilityEqualityEpsilon = 0.001f; @@ -429,6 +429,6 @@ namespace AZ return true; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.h similarity index 88% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.h index 2f6ce68561..c85812b420 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -19,9 +19,9 @@ namespace AZ namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { - struct FbxImportContext; + struct SceneImportContext; using CoreScene = Containers::Scene; using CoreSceneGraph = Containers::SceneGraph; @@ -41,8 +41,8 @@ namespace AZ bool IsGraphDataEqual(const AZStd::shared_ptr& lhs, const AZStd::shared_ptr& rhs); - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ -#include +#include diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.inl b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.inl similarity index 94% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.inl rename to Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.inl index aede722b0b..3cbade4c98 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/ImporterUtilities.inl +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/ImporterUtilities.inl @@ -5,7 +5,7 @@ * */ -#include +#include #include #include @@ -13,7 +13,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { bool NodeIsOfType(const CoreSceneGraph& sceneGraph, CoreGraphNodeIndex nodeIndex, const AZ::Uuid& uuid) { @@ -63,6 +63,6 @@ namespace AZ return true; } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp similarity index 93% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp index 9ced6af005..5c42122056 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp @@ -10,17 +10,17 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include #include -namespace AZ::SceneAPI::FbxSceneBuilder +namespace AZ::SceneAPI::SceneBuilder { - bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, + bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const SceneSystem& sceneSystem, AZStd::vector>& meshes, const AZStd::function()>& makeMeshFunc) { AZStd::unordered_map assImpMatIndexToLYIndex; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h similarity index 84% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h index a57fbb98ae..b04777134f 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h @@ -14,11 +14,6 @@ struct aiScene; namespace AZ { - namespace FbxSDKWrapper - { - class FbxMeshWrapper; - } - namespace SceneData { namespace GraphData @@ -35,11 +30,11 @@ namespace AZ class IGraphObject; } struct AssImpSceneNodeAppendedContext; - class FbxSceneSystem; + class SceneSystem; - namespace FbxSceneBuilder + namespace SceneBuilder { - bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, + bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const SceneSystem& sceneSystem, AZStd::vector>& meshes, const AZStd::function()>& makeMeshFunc); typedef AZ::Outcome GetMeshDataFromParentResult; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.cpp similarity index 97% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.cpp index d87c81bcb6..a85e3686de 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.cpp @@ -9,14 +9,14 @@ #include #include #include -#include +#include #include namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { bool RenamedNodesMap::SanitizeNodeName(AZStd::string& name, const Containers::SceneGraph& graph, Containers::SceneGraph::NodeIndex parentNode, const char* defaultName) @@ -94,7 +94,7 @@ namespace AZ { AZ_TraceContext("New node name", name); - // Only register if the name is updated, otherwise the name in the fbx node can be returned. + // Only register if the name is updated, otherwise the name in the source scene's node can be returned. auto entry = m_idToName.find(node.GetUniqueId()); if (entry == m_idToName.end()) { @@ -153,6 +153,6 @@ namespace AZ return node.GetName(); } } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.h b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.h similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.h rename to Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.h index 8bbba5c8c8..1428731469 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.h +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/Utilities/RenamedNodesMap.h @@ -15,14 +15,9 @@ namespace AZ { - namespace FbxSDKWrapper - { - class FbxNodeWrapper; - } - namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { class RenamedNodesMap { @@ -60,6 +55,6 @@ namespace AZ AZStd::unordered_map m_idToName; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Linux/platform_linux_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/Platform/Linux/platform_linux_files.cmake similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Linux/platform_linux_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/Platform/Linux/platform_linux_files.cmake diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Mac/platform_mac_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/Platform/Mac/platform_mac_files.cmake similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Mac/platform_mac_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/Platform/Mac/platform_mac_files.cmake diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Windows/platform_windows_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/Platform/Windows/platform_windows_files.cmake similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Platform/Windows/platform_windows_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/Platform/Windows/platform_windows_files.cmake diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneBuilderConfiguration.h b/Code/Tools/SceneAPI/SceneBuilder/SceneBuilderConfiguration.h similarity index 67% rename from Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneBuilderConfiguration.h rename to Code/Tools/SceneAPI/SceneBuilder/SceneBuilderConfiguration.h index 6f1bed9665..aee0ed7f47 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneBuilderConfiguration.h +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneBuilderConfiguration.h @@ -10,11 +10,11 @@ #include #if defined(AZ_MONOLITHIC_BUILD) - #define FBX_SCENE_BUILDER_API + #define SCENE_BUILDER_API #else - #ifdef FBX_SCENE_BUILDER_EXPORTS - #define FBX_SCENE_BUILDER_API AZ_DLL_EXPORT + #ifdef SCENE_BUILDER_EXPORTS + #define SCENE_BUILDER_API AZ_DLL_EXPORT #else - #define FBX_SCENE_BUILDER_API AZ_DLL_IMPORT + #define SCENE_BUILDER_API AZ_DLL_IMPORT #endif #endif // AZ_MONOLITHIC_BUILD diff --git a/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp new file mode 100644 index 0000000000..2881b355cd --- /dev/null +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace SceneAPI + { + void SceneImporterSettings::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context); serializeContext) + { + serializeContext->Class() + ->Version(2) + ->Field("SupportedFileTypeExtensions", &SceneImporterSettings::m_supportedFileTypeExtensions); + } + } + + void SceneImportRequestHandler::Activate() + { + if (auto* settingsRegistry = AZ::SettingsRegistry::Get()) + { + settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter"); + } + + BusConnect(); + } + + void SceneImportRequestHandler::Deactivate() + { + BusDisconnect(); + } + + void SceneImportRequestHandler::Reflect(ReflectContext* context) + { + SceneImporterSettings::Reflect(context); + + SerializeContext* serializeContext = azrtti_cast(context); + if (serializeContext) + { + serializeContext->Class()->Version(1)->Attribute( + AZ::Edit::Attributes::SystemComponentTags, + AZStd::vector( + {AssetBuilderSDK::ComponentTags::AssetBuilder, + AssetImportRequest::GetAssetImportRequestComponentTag()})); + + } + } + + void SceneImportRequestHandler::GetSupportedFileExtensions(AZStd::unordered_set& extensions) + { + extensions.insert(m_settings.m_supportedFileTypeExtensions.begin(), m_settings.m_supportedFileTypeExtensions.end()); + } + + Events::LoadingResult SceneImportRequestHandler::LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, [[maybe_unused]] RequestingApplication requester) + { + AZStd::string extension; + StringFunc::Path::GetExtension(path.c_str(), extension); + AZStd::to_lower(extension.begin(), extension.end()); + + if (!m_settings.m_supportedFileTypeExtensions.contains(extension)) + { + return Events::LoadingResult::Ignored; + } + + scene.SetSource(path, guid); + + // Push contexts + Events::ProcessingResultCombiner contextResult; + contextResult += Events::Process(path); + contextResult += Events::Process(path, scene); + contextResult += Events::Process(scene); + + if (contextResult.GetResult() == Events::ProcessingResult::Success) + { + return Events::LoadingResult::AssetLoaded; + } + else + { + return Events::LoadingResult::AssetFailure; + } + } + + void SceneImportRequestHandler::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided) + { + provided.emplace_back(AZ_CRC_CE("AssetImportRequestHandler")); + } + } // namespace SceneAPI +} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.h b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.h new file mode 100644 index 0000000000..f59f197683 --- /dev/null +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneImportRequestHandler.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ +{ + namespace SceneAPI + { + struct SceneImporterSettings + { + AZ_TYPE_INFO(SceneImporterSettings, "{8BB6C7AD-BF99-44DC-9DA1-E7AD3F03DC10}"); + + static void Reflect(AZ::ReflectContext* context); + + AZStd::unordered_set m_supportedFileTypeExtensions; + }; + + class SceneImportRequestHandler + : public AZ::Component + , public Events::AssetImportRequestBus::Handler + { + public: + AZ_COMPONENT(SceneImportRequestHandler, "{9F4B189C-0A96-4F44-A5F0-E087FF1561F8}"); + + ~SceneImportRequestHandler() override = default; + + void Activate() override; + void Deactivate() override; + static void Reflect(ReflectContext* context); + + void GetSupportedFileExtensions(AZStd::unordered_set& extensions) override; + Events::LoadingResult LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, + RequestingApplication requester) override; + + static void GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided); + + private: + + SceneImporterSettings m_settings; + + static constexpr const char* SettingsFilename = "AssetImporterSettings.json"; + }; + } // namespace SceneAPI +} // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/SceneImporter.cpp similarity index 88% rename from Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.cpp rename to Code/Tools/SceneAPI/SceneBuilder/SceneImporter.cpp index 0a2df783f1..cd6ffb8b29 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneImporter.cpp @@ -14,11 +14,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -29,7 +29,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { struct QueueNode { @@ -44,23 +44,23 @@ namespace AZ } }; - FbxImporter::FbxImporter() - : m_sceneSystem(new FbxSceneSystem()) + SceneImporter::SceneImporter() + : m_sceneSystem(new SceneSystem()) { m_sceneWrapper = AZStd::make_unique(); - BindToCall(&FbxImporter::ImportProcessing); + BindToCall(&SceneImporter::ImportProcessing); } - void FbxImporter::Reflect(ReflectContext* context) + void SceneImporter::Reflect(ReflectContext* context) { SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(2); // SPEC-5776 + serializeContext->Class()->Version(2); // SPEC-5776 } } - Events::ProcessingResult FbxImporter::ImportProcessing(Events::ImportEventContext& context) + Events::ProcessingResult SceneImporter::ImportProcessing(Events::ImportEventContext& context) { m_sceneWrapper->Clear(); @@ -77,7 +77,7 @@ namespace AZ return Events::ProcessingResult::Failure; } - convertFunc = AZStd::bind(&FbxImporter::ConvertFbxScene, this, AZStd::placeholders::_1); + convertFunc = AZStd::bind(&SceneImporter::ConvertScene, this, AZStd::placeholders::_1); if (convertFunc(context.GetScene())) { @@ -89,10 +89,10 @@ namespace AZ } } - bool FbxImporter::ConvertFbxScene(Containers::Scene& scene) const + bool SceneImporter::ConvertScene(Containers::Scene& scene) const { - std::shared_ptr fbxRoot = m_sceneWrapper->GetRootNode(); - if (!fbxRoot) + std::shared_ptr sceneRoot = m_sceneWrapper->GetRootNode(); + if (!sceneRoot) { return false; } @@ -123,13 +123,13 @@ namespace AZ break; } - AZStd::queue nodes; - nodes.emplace(AZStd::move(fbxRoot), scene.GetGraph().GetRoot()); + AZStd::queue nodes; + nodes.emplace(AZStd::move(sceneRoot), scene.GetGraph().GetRoot()); RenamedNodesMap nodeNameMap; while (!nodes.empty()) { - FbxSceneBuilder::QueueNode& node = nodes.front(); + SceneBuilder::QueueNode& node = nodes.front(); AZ_Assert(node.m_node, "Empty asset importer node queued"); if (!nodeNameMap.RegisterNode(node.m_node, scene.GetGraph(), node.m_parent)) { @@ -240,12 +240,12 @@ namespace AZ return true; } - void FbxImporter::SanitizeNodeName(AZStd::string& nodeName) const + void SceneImporter::SanitizeNodeName(AZStd::string& nodeName) const { // Replace % with something else so it is safe for use in printfs. AZStd::replace(nodeName.begin(), nodeName.end(), '%', '_'); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.h b/Code/Tools/SceneAPI/SceneBuilder/SceneImporter.h similarity index 70% rename from Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.h rename to Code/Tools/SceneAPI/SceneBuilder/SceneImporter.h index 9eb85e4f2d..669ae7abdd 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImporter.h +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneImporter.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include namespace AZ @@ -24,28 +24,28 @@ namespace AZ class Scene; } - namespace FbxSceneBuilder + namespace SceneBuilder { - class FbxImporter + class SceneImporter : public SceneCore::LoadingComponent { public: - AZ_COMPONENT(FbxImporter, "{D5EE21B6-8B73-45BF-B711-31346E0BEDB3}", SceneCore::LoadingComponent); + AZ_COMPONENT(SceneImporter, "{D5EE21B6-8B73-45BF-B711-31346E0BEDB3}", SceneCore::LoadingComponent); - FbxImporter(); - ~FbxImporter() override = default; + SceneImporter(); + ~SceneImporter() override = default; static void Reflect(ReflectContext* context); Events::ProcessingResult ImportProcessing(Events::ImportEventContext& context); protected: - bool ConvertFbxScene(Containers::Scene& scene) const; + bool ConvertScene(Containers::Scene& scene) const; void SanitizeNodeName(AZStd::string& nodeName) const; AZStd::unique_ptr m_sceneWrapper; - AZStd::shared_ptr m_sceneSystem; + AZStd::shared_ptr m_sceneSystem; }; - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.cpp b/Code/Tools/SceneAPI/SceneBuilder/SceneSystem.cpp similarity index 89% rename from Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.cpp rename to Code/Tools/SceneAPI/SceneBuilder/SceneSystem.cpp index bb1f0e71b1..8adb0ac0c0 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneSystem.cpp @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include @@ -17,7 +17,7 @@ namespace AZ { namespace SceneAPI { - FbxSceneSystem::FbxSceneSystem() : + SceneSystem::SceneSystem() : m_unitSizeInMeters(1.0f), m_originalUnitSizeInMeters(1.0f), m_adjustTransform(nullptr), @@ -25,15 +25,15 @@ namespace AZ { } - void FbxSceneSystem::Set(const SDKScene::SceneWrapperBase* fbxScene) + void SceneSystem::Set(const SDKScene::SceneWrapperBase* scene) { // Get unit conversion factor to meter. - if (!azrtti_istypeof(fbxScene)) + if (!azrtti_istypeof(scene)) { return; } - const AssImpSDKWrapper::AssImpSceneWrapper* assImpScene = azrtti_cast(fbxScene); + const AssImpSDKWrapper::AssImpSceneWrapper* assImpScene = azrtti_cast(scene); // If either meta data piece is not available, the default of 1 will be used. assImpScene->GetAssImpScene()->mMetaData->Get("UnitScaleFactor", m_unitSizeInMeters); @@ -111,7 +111,7 @@ namespace AZ } } - void FbxSceneSystem::SwapVec3ForUpAxis(Vector3& swapVector) const + void SceneSystem::SwapVec3ForUpAxis(Vector3& swapVector) const { if (m_adjustTransform) { @@ -119,7 +119,7 @@ namespace AZ } } - void FbxSceneSystem::SwapTransformForUpAxis(DataTypes::MatrixType& inOutTransform) const + void SceneSystem::SwapTransformForUpAxis(DataTypes::MatrixType& inOutTransform) const { if (m_adjustTransform) { @@ -127,19 +127,19 @@ namespace AZ } } - void FbxSceneSystem::ConvertUnit(Vector3& scaleVector) const + void SceneSystem::ConvertUnit(Vector3& scaleVector) const { scaleVector *= m_unitSizeInMeters; } - void FbxSceneSystem::ConvertUnit(DataTypes::MatrixType& inOutTransform) const + void SceneSystem::ConvertUnit(DataTypes::MatrixType& inOutTransform) const { Vector3 translation = inOutTransform.GetTranslation(); translation *= m_unitSizeInMeters; inOutTransform.SetTranslation(translation); } - void FbxSceneSystem::ConvertBoneUnit(DataTypes::MatrixType& inOutTransform) const + void SceneSystem::ConvertBoneUnit(DataTypes::MatrixType& inOutTransform) const { diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.h b/Code/Tools/SceneAPI/SceneBuilder/SceneSystem.h similarity index 81% rename from Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.h rename to Code/Tools/SceneAPI/SceneBuilder/SceneSystem.h index 0667b9969e..48c5dd152c 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxSceneSystem.h +++ b/Code/Tools/SceneAPI/SceneBuilder/SceneSystem.h @@ -8,7 +8,7 @@ */ #include -#include +#include #include namespace AZ @@ -22,10 +22,10 @@ namespace AZ namespace SceneAPI { - class FBX_SCENE_BUILDER_API FbxSceneSystem + class SCENE_BUILDER_API SceneSystem { public: - FbxSceneSystem(); + SceneSystem(); void Set(const SDKScene::SceneWrapperBase* sceneWrapper); void SwapVec3ForUpAxis(Vector3& swapVector) const; @@ -34,11 +34,11 @@ namespace AZ void ConvertUnit(DataTypes::MatrixType& inOutTransform) const; void ConvertBoneUnit(DataTypes::MatrixType& inOutTransform) const; - //! Get effect unit size in meters of this Fbx Scene, internally FBX saves it in the following manner + //! Get effect unit size in meters of this scene, internally FBX saves it in the following manner //! GlobalSettings: { //! P : "UnitScaleFactor", "double", "Number", "", 2.54 float GetUnitSizeInMeters() const { return m_unitSizeInMeters; } - //! Get original unit size in meters of this Fbx Scene, internally FBX saves it in the following manner + //! Get original unit size in meters of this scene, internally FBX saves it in the following manner //! GlobalSettings: { //! P : "OriginalUnitScaleFactor", "double", "Number", "", 2.54 float GetOriginalUnitSizeInMeters() const { return m_originalUnitSizeInMeters; } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/FbxImporterUtilitiesTests.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/SceneImporterUtilitiesTests.cpp similarity index 83% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/FbxImporterUtilitiesTests.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/SceneImporterUtilitiesTests.cpp index ed606e32b1..f26ae4f5e3 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/FbxImporterUtilitiesTests.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/SceneImporterUtilitiesTests.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -18,9 +18,9 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_EmptySceneGraphs_ReturnsTrue) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_EmptySceneGraphs_ReturnsTrue) { Containers::SceneGraph lhsGraph; Containers::SceneGraph rhsGraph; @@ -31,7 +31,7 @@ namespace AZ EXPECT_TRUE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeBothNull_ReturnsTrue) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeBothNull_ReturnsTrue) { Containers::SceneGraph lhsGraph; lhsGraph.AddChild(lhsGraph.GetRoot(), "testChild"); @@ -44,7 +44,7 @@ namespace AZ EXPECT_TRUE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeSameType_ReturnsTrue) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeSameType_ReturnsTrue) { Containers::SceneGraph lhsGraph; AZStd::shared_ptr lhsData = AZStd::make_shared(); @@ -59,7 +59,7 @@ namespace AZ EXPECT_TRUE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeOneNull_ReturnsFalse) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeOneNull_ReturnsFalse) { Containers::SceneGraph lhsGraph; AZStd::shared_ptr lhsData = AZStd::make_shared(); @@ -73,7 +73,7 @@ namespace AZ EXPECT_FALSE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeDifferentTypes_ReturnsFalse) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SameNameSingleNodeDifferentTypes_ReturnsFalse) { Containers::SceneGraph lhsGraph; AZStd::shared_ptr lhsData = AZStd::make_shared(); @@ -88,7 +88,7 @@ namespace AZ EXPECT_FALSE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SameNameOneEmptyOneSingleNode_ReturnsFalse) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SameNameOneEmptyOneSingleNode_ReturnsFalse) { Containers::SceneGraph lhsGraph; AZStd::shared_ptr lhsData = AZStd::make_shared(); @@ -101,7 +101,7 @@ namespace AZ EXPECT_FALSE(sceneGraphsEqual); } - TEST(FbxImpoterUtilityTests, AreSceneGraphsEqual_DifferentNamesSingleNodeBothNull_ReturnsFalse) + TEST(SceneImpoterUtilityTests, AreSceneGraphsEqual_DifferentNamesSingleNodeBothNull_ReturnsFalse) { Containers::SceneGraph lhsGraph; lhsGraph.AddChild(lhsGraph.GetRoot(), "testChild"); @@ -114,7 +114,7 @@ namespace AZ EXPECT_FALSE(sceneGraphsEqual); } - TEST(FbxImporterUtilityTests, AreSceneGraphsEqual_SecondGraphExtraChild_ReturnsFalse) + TEST(SceneImporterUtilityTests, AreSceneGraphsEqual_SecondGraphExtraChild_ReturnsFalse) { Containers::SceneGraph lhsGraph; lhsGraph.AddChild(lhsGraph.GetRoot(), "testChild"); @@ -127,6 +127,6 @@ namespace AZ EXPECT_FALSE(sceneGraphsEqual); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp similarity index 95% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp index 7f25508b5d..6b1279cccc 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Tests/Importers/Utilities/RenamedNodesMapTests.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -17,7 +17,7 @@ namespace AZ { namespace SceneAPI { - namespace FbxSceneBuilder + namespace SceneBuilder { TEST(RenamedNodesMapTests, SanitizeNodeName_ValidNameProvided_ReturnsFalseAndNameUnchanged) { @@ -79,6 +79,6 @@ namespace AZ EXPECT_TRUE(result); EXPECT_STREQ("Child_2", name.c_str()); } - } // namespace FbxSceneBuilder + } // namespace SceneBuilder } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxMesh.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxMesh.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxMesh.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxMesh.h rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxNode.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxNode.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxNode.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxNode.h rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxSkin.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxSkin.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxSkin.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestFbxSkin.h rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestsMain.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp similarity index 67% rename from Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestsMain.cpp rename to Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp index 841e76da4c..4b49c0ead8 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Tests/TestsMain.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestsMain.cpp @@ -10,11 +10,11 @@ #include #include -class FbxSceneBuilderTestEnvironment +class SceneBuilderTestEnvironment : public AZ::Test::ITestEnvironment { public: - virtual ~FbxSceneBuilderTestEnvironment() + virtual ~SceneBuilderTestEnvironment() {} protected: @@ -23,31 +23,31 @@ protected: AZ::AllocatorInstance::Create(); sceneCoreModule = AZ::DynamicModuleHandle::Create("SceneCore"); - AZ_Assert(sceneCoreModule, "FbxSceneBuilder unit tests failed to create SceneCore module."); + AZ_Assert(sceneCoreModule, "SceneBuilder unit tests failed to create SceneCore module."); bool loaded = sceneCoreModule->Load(false); - AZ_Assert(loaded, "FbxSceneBuilder unit tests failed to load SceneCore module."); + AZ_Assert(loaded, "SceneBuilder unit tests failed to load SceneCore module."); auto init = sceneCoreModule->GetFunction(AZ::InitializeDynamicModuleFunctionName); - AZ_Assert(init, "FbxSceneBuilder unit tests failed to find the initialization function the SceneCore module."); + AZ_Assert(init, "SceneBuilder unit tests failed to find the initialization function the SceneCore module."); (*init)(AZ::Environment::GetInstance()); sceneDataModule = AZ::DynamicModuleHandle::Create("SceneData"); AZ_Assert(sceneDataModule, "SceneData unit tests failed to create SceneData module."); loaded = sceneDataModule->Load(false); - AZ_Assert(loaded, "FbxSceneBuilder unit tests failed to load SceneData module."); + AZ_Assert(loaded, "SceneBuilder unit tests failed to load SceneData module."); init = sceneDataModule->GetFunction(AZ::InitializeDynamicModuleFunctionName); - AZ_Assert(init, "FbxSceneBuilder unit tests failed to find the initialization function the SceneData module."); + AZ_Assert(init, "SceneBuilder unit tests failed to find the initialization function the SceneData module."); (*init)(AZ::Environment::GetInstance()); } void TeardownEnvironment() override { auto uninit = sceneDataModule->GetFunction(AZ::UninitializeDynamicModuleFunctionName); - AZ_Assert(uninit, "FbxSceneBuilder unit tests failed to find the uninitialization function the SceneData module."); + AZ_Assert(uninit, "SceneBuilder unit tests failed to find the uninitialization function the SceneData module."); (*uninit)(); sceneDataModule.reset(); uninit = sceneCoreModule->GetFunction(AZ::UninitializeDynamicModuleFunctionName); - AZ_Assert(uninit, "FbxSceneBuilder unit tests failed to find the uninitialization function the SceneCore module."); + AZ_Assert(uninit, "SceneBuilder unit tests failed to find the uninitialization function the SceneCore module."); (*uninit)(); sceneCoreModule.reset(); @@ -59,5 +59,5 @@ private: AZStd::unique_ptr sceneDataModule; }; -AZ_UNIT_TEST_HOOK(new FbxSceneBuilderTestEnvironment); +AZ_UNIT_TEST_HOOK(new SceneBuilderTestEnvironment); diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/scenebuilder_files.cmake similarity index 91% rename from Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/scenebuilder_files.cmake index 0e3a793af1..5bd6748399 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_files.cmake +++ b/Code/Tools/SceneAPI/SceneBuilder/scenebuilder_files.cmake @@ -6,13 +6,13 @@ # set(FILES - FbxSceneBuilderConfiguration.h - FbxImportRequestHandler.h - FbxImportRequestHandler.cpp - FbxImporter.h - FbxImporter.cpp - FbxSceneSystem.h - FbxSceneSystem.cpp + SceneBuilderConfiguration.h + SceneImportRequestHandler.h + SceneImportRequestHandler.cpp + SceneImporter.h + SceneImporter.cpp + SceneSystem.h + SceneSystem.cpp ImportContexts/ImportContexts.h ImportContexts/ImportContexts.cpp ImportContexts/AssImpImportContexts.h diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_shared_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/scenebuilder_shared_files.cmake similarity index 100% rename from Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_shared_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/scenebuilder_shared_files.cmake diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_testing_files.cmake b/Code/Tools/SceneAPI/SceneBuilder/scenebuilder_testing_files.cmake similarity index 85% rename from Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_testing_files.cmake rename to Code/Tools/SceneAPI/SceneBuilder/scenebuilder_testing_files.cmake index 8f84805438..c4d970e4e3 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/fbxscenebuilder_testing_files.cmake +++ b/Code/Tools/SceneAPI/SceneBuilder/scenebuilder_testing_files.cmake @@ -7,6 +7,6 @@ set(FILES Tests/TestsMain.cpp - Tests/Importers/FbxImporterUtilitiesTests.cpp + Tests/Importers/SceneImporterUtilitiesTests.cpp Tests/Importers/Utilities/RenamedNodesMapTests.cpp ) diff --git a/Code/Tools/SceneAPI/SceneCore/Containers/SceneGraph.h b/Code/Tools/SceneAPI/SceneCore/Containers/SceneGraph.h index 2b0cb968a8..3b62341dce 100644 --- a/Code/Tools/SceneAPI/SceneCore/Containers/SceneGraph.h +++ b/Code/Tools/SceneAPI/SceneCore/Containers/SceneGraph.h @@ -27,7 +27,7 @@ namespace AZ { class IGraphObject; } - namespace FbxSceneBuilder + namespace SceneBuilder { struct QueueNode; struct ImportContext; @@ -58,8 +58,8 @@ namespace AZ class NodeIndex { friend class SceneGraph; - friend struct FbxSceneBuilder::QueueNode; - friend struct FbxSceneBuilder::ImportContext; + friend struct SceneBuilder::QueueNode; + friend struct SceneBuilder::ImportContext; public: // Type needs to be able to store an index in a NodeHeader (currently 21-bits). using IndexType = uint32_t; diff --git a/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshData.h b/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshData.h index 16a5f509e0..7b8ea30c3c 100644 --- a/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshData.h +++ b/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshData.h @@ -80,11 +80,11 @@ namespace AZ virtual unsigned int GetVertexIndex(int faceIndex, int vertexIndexInFace) const = 0; static const int s_invalidMaterialId = 0; - // Set the unit size of the mesh, from the point of FBX SDK + // Set the unit size of the mesh, from the point of the source SDK void SetUnitSizeInMeters(float size) { m_unitSizeInMeters = size; } float GetUnitSizeInMeters() const { return m_unitSizeInMeters; } - // Set the original unit size of the mesh, from the point of FBX SDK + // Set the original unit size of the mesh, from the point of the source SDK void SetOriginalUnitSizeInMeters(float size) { m_originalUnitSizeInMeters = size; } float GetOriginalUnitSizeInMeters() const { return m_originalUnitSizeInMeters; } diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp index c2b80051fe..8f4b3d9c63 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp @@ -144,10 +144,10 @@ namespace PhysX namespace Utils { - // Utility function doing look-up in fbxMaterialNames and inserting the name if it's not found + // Utility function doing look-up in sourceSceneMaterialNames and inserting the name if it's not found AZ::u16 InsertMaterialIndexByName(const AZStd::string& materialName, AssetMaterialsData& materials) { - AZStd::vector& fbxMaterialNames = materials.m_fbxMaterialNames; + AZStd::vector& sourceSceneMaterialNames = materials.m_sourceSceneMaterialNames; AZStd::unordered_map& materialIndexByName = materials.m_materialIndexByName; // Check if we have this material in the list @@ -159,9 +159,9 @@ namespace PhysX } // Add it to the list otherwise - fbxMaterialNames.push_back(materialName); + sourceSceneMaterialNames.push_back(materialName); - AZ::u16 newIndex = fbxMaterialNames.size() - 1; + AZ::u16 newIndex = sourceSceneMaterialNames.size() - 1; materialIndexByName[materialName] = newIndex; return newIndex; @@ -284,8 +284,8 @@ namespace PhysX AZStd::string_view nodeName = sceneGraph.GetNodeName(nodeIndex).GetName(); - const AZStd::vector localFbxMaterialsList = GenerateLocalNodeMaterialMap(sceneGraph, nodeIndex); - if (localFbxMaterialsList.empty()) + const AZStd::vector localSourceSceneMaterialsList = GenerateLocalNodeMaterialMap(sceneGraph, nodeIndex); + if (localSourceSceneMaterialsList.empty()) { AZ_TracePrintf( AZ::SceneAPI::Utilities::WarningWindow, @@ -304,26 +304,26 @@ namespace PhysX for (AZ::u32 faceIndex = 0; faceIndex < faceCount; ++faceIndex) { AZStd::string materialName = DefaultMaterialName; - if (!localFbxMaterialsList.empty()) + if (!localSourceSceneMaterialsList.empty()) { const int materialId = nodeMesh->GetFaceMaterialId(faceIndex); - if (materialId >= localFbxMaterialsList.size()) + if (materialId >= localSourceSceneMaterialsList.size()) { AZ_TracePrintf(AZ::SceneAPI::Utilities::ErrorWindow, - "materialId %d for face %d is out of bound for localFbxMaterialsList (size %d).", - materialId, faceIndex, localFbxMaterialsList.size()); + "materialId %d for face %d is out of bound for localSourceSceneMaterialsList (size %d).", + materialId, faceIndex, localSourceSceneMaterialsList.size()); return AZStd::nullopt; } - materialName = localFbxMaterialsList[materialId]; + materialName = localSourceSceneMaterialsList[materialId]; // Keep using the first material when it has to be limited to one. if (limitToOneMaterial && - assetMaterialData.m_fbxMaterialNames.size() == 1 && - assetMaterialData.m_fbxMaterialNames[0] != materialName) + assetMaterialData.m_sourceSceneMaterialNames.size() == 1 && + assetMaterialData.m_sourceSceneMaterialNames[0] != materialName) { - materialName = assetMaterialData.m_fbxMaterialNames[0]; + materialName = assetMaterialData.m_sourceSceneMaterialNames[0]; } } @@ -504,7 +504,7 @@ namespace PhysX // because this exporter runs when the source scene is being processed, which // could have a different content from when the mesh group info was // entered in Scene Settings Editor. - if (!Utils::UpdateAssetPhysicsMaterials(assetMaterialsData.m_fbxMaterialNames, assetData.m_materialNames, assetData.m_physicsMaterialNames)) + if (!Utils::UpdateAssetPhysicsMaterials(assetMaterialsData.m_sourceSceneMaterialNames, assetData.m_materialNames, assetData.m_physicsMaterialNames)) { return SceneEvents::ProcessingResult::Failure; } diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.h b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.h index 3bb6bea456..fa12eb6f56 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.h +++ b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.h @@ -60,9 +60,9 @@ namespace PhysX struct AssetMaterialsData { //! Material names coming from the source scene file. - AZStd::vector m_fbxMaterialNames; + AZStd::vector m_sourceSceneMaterialNames; - //! Look-up table for fbxMaterialNames. + //! Look-up table for sourceSceneMaterialNames. AZStd::unordered_map m_materialIndexByName; //! Map of mesh nodes to their list of material indices associated to each face. diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshGroup.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshGroup.cpp index 9fe9256019..e0d9eb1e96 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshGroup.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshGroup.cpp @@ -763,7 +763,7 @@ namespace PhysX return; } - Utils::UpdateAssetPhysicsMaterials(assetMaterialData->m_fbxMaterialNames, m_materialSlots, m_physicsMaterials); + Utils::UpdateAssetPhysicsMaterials(assetMaterialData->m_sourceSceneMaterialNames, m_materialSlots, m_physicsMaterials); } AZ::SceneAPI::Containers::RuleContainer& MeshGroup::GetRuleContainer() diff --git a/Gems/SceneLoggingExample/ReadMe.txt b/Gems/SceneLoggingExample/ReadMe.txt index f7c398c78d..62fe755ddf 100644 --- a/Gems/SceneLoggingExample/ReadMe.txt +++ b/Gems/SceneLoggingExample/ReadMe.txt @@ -2,7 +2,7 @@ The Scene Logging Example demonstrates how to extend the SceneAPI by adding addi a collection of libraries that handle loading scene files and converting content to data that the Open 3D Engine and its editor can load. The following approach is used: - 1. The FbxSceneBuilder and SceneData load and convert the scene file (for example, .fbx) into a graph that is stored in memory. + 1. The SceneBuilder and SceneData load and convert the scene file (for example, .fbx) into a graph that is stored in memory. 2. SceneCore and SceneData are used to create a manifest with instructions about how to export the file. 3. SceneData analyzes the manifest and memory graph and creates defaults. 4. Scene Settings allows updates to the manifest through a UI. diff --git a/Gems/SceneProcessing/Code/CMakeLists.txt b/Gems/SceneProcessing/Code/CMakeLists.txt index 02603a57a3..9aa5bc6763 100644 --- a/Gems/SceneProcessing/Code/CMakeLists.txt +++ b/Gems/SceneProcessing/Code/CMakeLists.txt @@ -39,7 +39,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::SceneCore AZ::SceneData AZ::AzFramework - AZ::FbxSceneBuilder + AZ::SceneBuilder AZ::AssetBuilderSDK ) diff --git a/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp b/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp index 747253d5b1..72513b509f 100644 --- a/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp @@ -31,7 +31,7 @@ namespace AZ ActivateSceneModule(SceneProcessing::s_sceneCoreModule); ActivateSceneModule(SceneProcessing::s_sceneDataModule); - ActivateSceneModule(SceneProcessing::s_fbxSceneBuilderModule); + ActivateSceneModule(SceneProcessing::s_sceneBuilderModule); // Defaults in case there's no config setup in the Project Configurator. m_softNames.push_back(aznew NodeSoftNameSetting("^.*_[Ll][Oo][Dd]1(_optimized)?$", PatternMatcher::MatchApproach::Regex, "LODMesh1", true)); @@ -65,7 +65,7 @@ namespace AZ SceneProcessingConfigSystemComponent::~SceneProcessingConfigSystemComponent() { - DeactivateSceneModule(SceneProcessing::s_fbxSceneBuilderModule); + DeactivateSceneModule(SceneProcessing::s_sceneBuilderModule); DeactivateSceneModule(SceneProcessing::s_sceneDataModule); DeactivateSceneModule(SceneProcessing::s_sceneCoreModule); } @@ -140,7 +140,7 @@ namespace AZ { ReflectSceneModule(context, SceneProcessing::s_sceneCoreModule); ReflectSceneModule(context, SceneProcessing::s_sceneDataModule); - ReflectSceneModule(context, SceneProcessing::s_fbxSceneBuilderModule); + ReflectSceneModule(context, SceneProcessing::s_sceneBuilderModule); SoftNameSetting::Reflect(context); NodeSoftNameSetting::Reflect(context); diff --git a/Gems/SceneProcessing/Code/Source/SceneProcessingModule.cpp b/Gems/SceneProcessing/Code/Source/SceneProcessingModule.cpp index 2839c8037d..bff43b9518 100644 --- a/Gems/SceneProcessing/Code/Source/SceneProcessingModule.cpp +++ b/Gems/SceneProcessing/Code/Source/SceneProcessingModule.cpp @@ -33,7 +33,7 @@ namespace AZ { LoadSceneModule(s_sceneCoreModule, "SceneCore"); LoadSceneModule(s_sceneDataModule, "SceneData"); - LoadSceneModule(s_fbxSceneBuilderModule, "FbxSceneBuilder"); + LoadSceneModule(s_sceneBuilderModule, "SceneBuilder"); m_descriptors.insert(m_descriptors.end(), { @@ -59,7 +59,7 @@ namespace AZ ~SceneProcessingModule() { - UnloadModule(s_fbxSceneBuilderModule); + UnloadModule(s_sceneBuilderModule); UnloadModule(s_sceneDataModule); UnloadModule(s_sceneCoreModule); } diff --git a/Gems/SceneProcessing/Code/Source/SceneProcessingModule.h b/Gems/SceneProcessing/Code/Source/SceneProcessingModule.h index 674d3b449b..3491d1a702 100644 --- a/Gems/SceneProcessing/Code/Source/SceneProcessingModule.h +++ b/Gems/SceneProcessing/Code/Source/SceneProcessingModule.h @@ -12,5 +12,5 @@ namespace AZ::SceneProcessing { inline AZStd::unique_ptr s_sceneCoreModule; inline AZStd::unique_ptr s_sceneDataModule; - inline AZStd::unique_ptr s_fbxSceneBuilderModule; + inline AZStd::unique_ptr s_sceneBuilderModule; } // namespace AZ::SceneProcessing From b331eea9ca54b2df09c719f10a3462b058931b09 Mon Sep 17 00:00:00 2001 From: Terry Michaels Date: Thu, 1 Jul 2021 19:25:08 -0500 Subject: [PATCH 26/75] Removed the AmazonStyle executable and files as they are old/invalid (#1733) * signoff Signed-off-by: Terry Michaels --- .../StyleGallery/ConditionGroupWidget.cpp | 145 -- .../StyleGallery/ConditionGroupWidget.h | 36 - .../StyleGallery/ConditionWidget.cpp | 51 - .../StyleGallery/ConditionWidget.h | 30 - .../StyleGallery/DeploymentsWidget.cpp | 57 - .../StyleGallery/DeploymentsWidget.h | 30 - .../AzQtComponents/StyleGallery/MyCombo.cpp | 15 - .../AzQtComponents/StyleGallery/MyCombo.h | 22 - .../StyleGallery/ViewportTitleDlg.cpp | 69 - .../StyleGallery/ViewportTitleDlg.h | 36 - .../StyleGallery/ViewportTitleDlg.ui | 225 -- .../AzQtComponents/StyleGallery/assets.svg | 179 -- .../StyleGallery/deploymentswidget.ui | 176 -- .../AzQtComponents/StyleGallery/main.cpp | 300 --- .../StyleGallery/mainwidget.cpp | 275 --- .../AzQtComponents/StyleGallery/mainwidget.h | 40 - .../AzQtComponents/StyleGallery/mainwidget.ui | 2042 ----------------- .../AzQtComponents/StyleGallery/triangles.svg | 138 -- .../azqtcomponents_style_files.cmake | 25 - Code/Framework/AzQtComponents/CMakeLists.txt | 18 - 20 files changed, 3909 deletions(-) delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.ui delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/assets.svg delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/deploymentswidget.ui delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.ui delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/triangles.svg delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_style_files.cmake diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.cpp deleted file mode 100644 index ad18668650..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.cpp +++ /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 - * - */ - -#include "ConditionGroupWidget.h" -#include "ConditionWidget.h" -#include -#include -#include -#include -#include -#include -#include - -enum Action { - ActionAdd, - ActionRemove -}; - -class ActionButton : public QToolButton -{ -public: - explicit ActionButton(QWidget *parent = nullptr) - : QToolButton(parent) - { - setAttribute(Qt::WA_Hover); - } - - void paintEvent(QPaintEvent *) - { - QStyleOptionToolButton opt; - initStyleOption(&opt); - auto state = (opt.state & QStyle::State_Sunken) ? QIcon::Active - : ((opt.state & QStyle::State_MouseOver) ? QIcon::Selected - : QIcon::Normal); - - QPixmap pix = icon().pixmap(QSize(16, 16), state); - QPainter p(this); - QRect pixRect = pix.rect(); - pixRect.moveCenter(rect().center()); - pixRect.adjust(-2, 1, -2, 1); - p.drawPixmap(pixRect , pix); - } -}; - -ConditionGroupWidget::ConditionGroupWidget(QWidget *parent) - : QWidget(parent) - , m_layout(new QGridLayout(this)) -{ - m_addIcon.addPixmap(QPixmap(":/stylesheet/img/condition_add.png"), QIcon::Normal); - m_addIcon.addPixmap(QPixmap(":/stylesheet/img/condition_add_hover.png"), QIcon::Selected); - m_addIcon.addPixmap(QPixmap(":/stylesheet/img/condition_add_pressed.png"), QIcon::Active); - - m_delIcon.addPixmap(QPixmap(":/stylesheet/img/condition_remove.png"), QIcon::Normal); - m_delIcon.addPixmap(QPixmap(":/stylesheet/img/condition_remove_hover.png"), QIcon::Selected); - m_delIcon.addPixmap(QPixmap(":/stylesheet/img/condition_remove_pressed.png"), QIcon::Active); - - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); - m_layout->setHorizontalSpacing(0); - - // Lets have at least one condition - appendCondition(); -} - -void ConditionGroupWidget::appendCondition() -{ - auto cond = new ConditionWidget(); - connect(cond, SIGNAL(geometryChanged()), this, SLOT(update())); - m_layout->addWidget(cond, count(), 0); - m_layout->addWidget(new ActionButton(), count() - 1, 1); - updateButtons(); -} - -void ConditionGroupWidget::removeCondition(int n) -{ - if (n >= 0 && n < count() && count() > 1) { - m_layout->removeItem(m_layout->itemAtPosition(n, 0)); - m_layout->removeItem(m_layout->itemAtPosition(n, 1)); - updateButtons(); - } -} - -int ConditionGroupWidget::count() const -{ - return m_layout->rowCount(); -} - -void ConditionGroupWidget::paintEvent(QPaintEvent *) -{ - const int c = count(); - for (int i = 0; i < c - 1; ++i) { - ConditionWidget *cond1 = conditionAt(i); - ConditionWidget *cond2 = conditionAt(i + 1); - if (!cond1 || !cond2) - continue; // defensive, doesn't happen - - const int separatorHeight = 3; - const int y = ((cond1->geometry().bottom() + cond2->y()) / 2) - (separatorHeight / 2); - QPainter p(this); - p.setPen(QColor(50, 52, 53)); - p.setBrush(QColor(94, 96, 96)); - p.drawRoundedRect(QRect(0, y, width() - 1, separatorHeight), 1, 1); - } -} - -ConditionWidget *ConditionGroupWidget::conditionAt(int row) const -{ - if (row < 0 || row >= count()) - return nullptr; - - if (auto item = m_layout->itemAtPosition(row, 0)) - return qobject_cast(item->widget()); - - return nullptr; -} - -void ConditionGroupWidget::updateButtons() -{ - update(); - const int n = count(); - for (int i = 0; i < n; ++i) { - if (auto item = m_layout->itemAtPosition(i, 1)) { - if (auto button = qobject_cast(item->widget())) { - bool isLast = i == n - 1; - button->setCheckable(true); - button->setChecked(true); - button->setIcon(isLast ? m_addIcon : m_delIcon); - button->disconnect(); - - if (isLast) { - connect(button, &QToolButton::clicked, this, &ConditionGroupWidget::appendCondition); - } else { - connect(button, &QToolButton::clicked, this, [this, i] { - removeCondition(i); - }); - } - } - } - } -} - -#include "StyleGallery/moc_ConditionGroupWidget.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.h deleted file mode 100644 index be0bb76966..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionGroupWidget.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 - * - */ - -#ifndef CONDITIONGROUPWIDGET_H -#define CONDITIONGROUPWIDGET_H - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -class QGridLayout; -class ConditionWidget; - -class ConditionGroupWidget : public QWidget -{ - Q_OBJECT -public: - explicit ConditionGroupWidget(QWidget *parent = nullptr); - void appendCondition(); - void removeCondition(int n); - int count() const; - void paintEvent(QPaintEvent *) override; -private: - ConditionWidget* conditionAt(int row) const; - void updateButtons(); - QGridLayout *const m_layout; - QIcon m_addIcon; - QIcon m_delIcon; -}; - -#endif diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.cpp deleted file mode 100644 index c9b7648eca..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "ConditionWidget.h" -#include -#include -#include -#include - -ConditionWidget::ConditionWidget(QWidget *parent) - : QWidget(parent) -{ - auto layout = new QHBoxLayout(this); - auto checkbox = new QCheckBox(); - auto combo1 = new QComboBox(); - combo1->addItem(QStringLiteral("Asset Type")); - combo1->addItem(QStringLiteral("Asset Name")); - combo1->setProperty("class", "condition"); - auto combo2 = new QComboBox(); - combo2->setFixedWidth(88); - combo2->setProperty("class", "condition"); - combo2->addItem(QStringLiteral("is")); - combo2->addItem(QStringLiteral("is not")); - auto lineedit = new QLineEdit(); - - layout->addWidget(checkbox); - layout->addWidget(combo1); - layout->addWidget(combo2); - layout->addWidget(lineedit); - layout->setSpacing(5); - - setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); -} - -void ConditionWidget::resizeEvent(QResizeEvent *event) -{ - QWidget::resizeEvent(event); - emit geometryChanged(); -} - -void ConditionWidget::moveEvent(QMoveEvent *event) -{ - QWidget::moveEvent(event); - emit geometryChanged(); -} - -#include "StyleGallery/moc_ConditionWidget.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.h deleted file mode 100644 index b921f73da7..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ConditionWidget.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 - * - */ - - -#ifndef CONDITIONWIDGET_H -#define CONDITIONWIDGET_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class ConditionWidget : public QWidget -{ - Q_OBJECT -public: - explicit ConditionWidget(QWidget *parent = nullptr); - -signals: - void geometryChanged(); - -protected: - void resizeEvent(QResizeEvent *event) override; - void moveEvent(QMoveEvent *event) override; -}; - -#endif diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.cpp deleted file mode 100644 index 9f7c670989..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.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 "DeploymentsWidget.h" -#include -#include -#include - -using namespace AzQtComponents; - -DeploymentsWidget::DeploymentsWidget(QWidget *parent) - : QWidget(parent) - , ui(new Ui::DeploymentsWidget()) -{ - setFixedSize(263, 238); - ui->setupUi(this); - ui->titlebar->setWindowTitleOverride(tr("Deployments")); - //ui->titlebar->setFrameHackEnabled(true); - ui->titlebar->setForceInactive(true); - ui->deploymentOk->setProperty("class", "Primary"); - ui->contents->setAttribute(Qt::WA_TranslucentBackground); - ui->blueLabel->setProperty("class", "addDeployment"); // Should this label style be more generic ? - ui->blueLabel->installEventFilter(this); - ui->blueLabel->setCursor(Qt::PointingHandCursor); -} - -void DeploymentsWidget::paintEvent(QPaintEvent *) -{ - QPainter p(this); - StyledDockWidget::drawFrame(p, rect(), false); - - p.setPen(QColor(35, 36, 37)); - p.drawLine(1, height()-51, width() - 2, height() - 51); - p.setPen(QColor(66, 67, 68)); - p.drawLine(1, height()-50, width() - 2, height() - 50); -} - -bool DeploymentsWidget::eventFilter(QObject *watched, QEvent *event) -{ - if (event->type() == QEvent::MouseButtonRelease) { - addDeployment(); - return true; - } - - return QWidget::eventFilter(watched, event); -} - -void DeploymentsWidget::addDeployment() -{ - QInputDialog::getText(this, tr("Enter deployment name"), QString()); -} - -#include "StyleGallery/moc_DeploymentsWidget.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h deleted file mode 100644 index e8dc6a1658..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.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 - * - */ - -#ifndef DEPLOYMENTSWIDGET_H -#define DEPLOYMENTSWIDGET_H - -#if !defined(Q_MOC_RUN) -#include - -#include -#include -#endif - -class DeploymentsWidget : public QWidget -{ - Q_OBJECT -public: - explicit DeploymentsWidget(QWidget *parent = 0); - void paintEvent(QPaintEvent *event) override; - bool eventFilter(QObject *watched, QEvent *event) override; - void addDeployment(); -private: - QScopedPointer ui; -}; - -#endif diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.cpp deleted file mode 100644 index f5d0095971..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.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 "MyCombo.h" - -MyComboBox::MyComboBox(QWidget *parent) - : QComboBox(parent) -{ - -} - -#include "StyleGallery/moc_MyCombo.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.h deleted file mode 100644 index 3c278754cc..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/MyCombo.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef MY_COMBO_H -#define MY_COMBO_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class MyComboBox : public QComboBox -{ - Q_OBJECT -public: - explicit MyComboBox(QWidget *parent = nullptr); -}; - - -#endif diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp deleted file mode 100644 index 573bb4c040..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : CViewportTitleDlg implementation file - - -#include "ViewportTitleDlg.h" - -#include -#include - -ViewportTitleDlg::ViewportTitleDlg(QWidget* pParent) - : QWidget(pParent), - m_ui(new Ui::ViewportTitleDlg) -{ - m_ui->setupUi(this); - - OnInitDialog(); - m_ui->m_viewportSearch->setIcon(QIcon(":/stylesheet/img/16x16/Search.png")); - - auto clearAction = new QAction(this); - clearAction->setIcon(QIcon(":/stylesheet/img/16x16/lineedit-clear.png")); - - m_ui->m_viewportSearch->setFixedWidth(190); -} - -ViewportTitleDlg::~ViewportTitleDlg() -{ -} - -void ViewportTitleDlg::OnInitDialog() -{ - m_ui->m_titleBtn->setText(m_title); - m_ui->m_sizeStaticCtrl->setText(QString()); - - connect(m_ui->m_maxBtn, &QToolButton::clicked, this, &ViewportTitleDlg::OnMaximize); - connect(m_ui->m_toggleHelpersBtn, &QToolButton::clicked, this, &ViewportTitleDlg::OnToggleHelpers); - connect(m_ui->m_toggleDisplayInfoBtn, &QToolButton::clicked, this, &ViewportTitleDlg::OnToggleDisplayInfo); - - m_ui->m_maxBtn->setProperty("class", "big"); - m_ui->m_toggleHelpersBtn->setProperty("class", "big"); - m_ui->m_toggleDisplayInfoBtn->setProperty("class", "big"); -} - -void ViewportTitleDlg::SetTitle( const QString &title ) -{ - m_title = title; - m_ui->m_titleBtn->setText(m_title); - m_ui->m_viewportSearch->setVisible(title == QLatin1String("Perspective")); -} - -void ViewportTitleDlg::OnMaximize() -{ -} - -void ViewportTitleDlg::OnToggleHelpers() -{ -} - -void ViewportTitleDlg::OnToggleDisplayInfo() -{ -} - -#include "StyleGallery/moc_ViewportTitleDlg.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.h deleted file mode 100644 index 8d9640553d..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class ViewportTitleDlg; -} - -class ViewportTitleDlg : public QWidget -{ - Q_OBJECT -public: - ViewportTitleDlg(QWidget* pParent = nullptr); - virtual ~ViewportTitleDlg(); -protected slots: - void OnMaximize(); - void OnToggleHelpers(); - void OnToggleDisplayInfo(); -private: - void OnInitDialog(); - void SetTitle(const QString &title); - - QString m_title = QLatin1String("Perspective"); - QScopedPointer m_ui; -}; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.ui b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.ui deleted file mode 100644 index 066dafe912..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.ui +++ /dev/null @@ -1,225 +0,0 @@ - - - ViewportTitleDlg - - - - 0 - 0 - 574 - 29 - - - - - 0 - 0 - - - - - 10 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - Static - - - - - - - - 0 - 0 - - - - - 147 - 22 - - - - - 147 - 22 - - - - - - - - FOV: - - - - - - - - 0 - 0 - - - - 120° - - - - - - - Ratio: - - - - - - - - 0 - 0 - - - - - 40 - 0 - - - - - 40 - 16777215 - - - - 000:000 - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - 0000 x 0000 - - - - - - - - - - Toggle display info - - - - :/stylesheet/img/UI20/Info.svg:/stylesheet/img/UI20/Info.svg - - - true - - - - - - - Toggle display helpers - - - - :/stylesheet/img/UI20/Helpers.svg:/stylesheet/img/UI20/Helpers.svg - - - true - - - - - - - - - - - :/stylesheet/img/16x16/Maximize.png:/stylesheet/img/16x16/Maximize.png - - - - 16 - 16 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 5 - - - - - - - - - AzQtComponents::ToolButtonLineEdit - QLineEdit -
AzQtComponents/Components/ToolButtonLineEdit.h
-
- - AzQtComponents::ButtonDivider - QWidget -
AzQtComponents/Components/ButtonDivider.h
- 1 -
-
- - -
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/assets.svg b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/assets.svg deleted file mode 100644 index a64626e47a..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/assets.svg +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/deploymentswidget.ui b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/deploymentswidget.ui deleted file mode 100644 index f02c215e4f..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/deploymentswidget.ui +++ /dev/null @@ -1,176 +0,0 @@ - - - DeploymentsWidget - - - - 0 - 0 - 263 - 238 - - - - - 0 - 0 - - - - - 263 - 238 - - - - - 263 - 238 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 1 - - - 1 - - - - - - - - - - - 10 - - - 12 - - - - - You must select a default deployment where -you would like to add these resurces. - - - - - - - Add a deployment - - - - - - - New deployment name 3 - - - true - - - - - - - Deployment name 2 - - - - - - - Deployment name 1 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - 0 - - - 5 - - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - - - - - - - AzQtComponents::TitleBar - QWidget -
AzQtComponents/Components/Titlebar.h
- 1 -
-
- - -
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp deleted file mode 100644 index 4ce21ebf7e..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "mainwidget.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "MyCombo.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace AzQtComponents; - -QToolBar * toolBar() -{ - auto t = new QToolBar(QString()); - QAction *a = nullptr; - QMenu *menu = nullptr; - auto but = new QToolButton(); - menu = new QMenu(); - but->setMenu(menu); - but->setCheckable(true); - but->setPopupMode(QToolButton::MenuButtonPopup); - but->setDefaultAction(new QAction(QStringLiteral("Test"), but)); - but->setIcon(QIcon(":/stylesheet/img/undo.png")); - t->addWidget(but); - - a = t->addAction(QIcon(":/stylesheet/img/select.png"), QString()); - a->setCheckable(true); - t->addSeparator(); - - auto tbcb = new AzQtComponents::ToolButtonComboBox(); - tbcb->setIcon(QIcon(":/stylesheet/img/angle.png")); - tbcb->comboBox()->addItem("1"); - tbcb->comboBox()->addItem("2"); - tbcb->comboBox()->addItem("3"); - tbcb->comboBox()->addItem("4"); - t->addWidget(tbcb); - - auto tble = new AzQtComponents::ToolButtonLineEdit(); - tble->setFixedWidth(130); - tble->setIcon(QIcon(":/stylesheet/img/16x16/Search.png")); - t->addWidget(tble); - - auto combo = new QComboBox(); - combo->addItem("Test1"); - combo->addItem("Test3"); - combo->addItem("Selection,Area"); - t->addWidget(combo); - - const QStringList iconNames = { - "Align_object_to_surface", - "Align_to_grid", - "Align_to_Object", - "Angle", - "Asset_Browser", - "Audio", - "Database_view", - "Delete_named_selection", - "Follow_terrain", - "Freeze", - "Gepetto", - "Get_physics_state", - "Grid", - "layer_editor", - "layers", - "LIghting", - "lineedit-clear", - "LOD_generator", - "LUA", - "Material", - "Maximize", - "Measure", - "Move", - "Object_follow_terrain", - "Object_list", - "Redo", - "Reset_physics_state", - "Scale", - "select_object", - "Select", - "Select_terrain", - "Simulate_Physics_on_selected_objects", - "Substance", - "Terrain", - "Terrain_Texture", - "Texture_browser", - "Time_of_Day", - "Trackview", - "Translate", - "UI_editor", - "undo", - "Unfreeze_all", - "Vertex_snapping" }; - - for (auto name : iconNames) { - auto a2 = t->addAction(QIcon(QString(":/stylesheet/img/16x16/%1.png").arg(name)), nullptr); - a2->setToolTip(name); - a2->setDisabled(name == "Audio"); - } - - combo = new MyComboBox(); - combo->addItem("Test1"); - combo->addItem("Test3"); - combo->addItem("Selection,Area"); - t->addWidget(combo); - - return t; -} - -class MainWindow : public QMainWindow -{ -public: - explicit MainWindow(QWidget *parent = nullptr) - : QMainWindow(parent) - , m_settings("org", "app") - { - setAttribute(Qt::WA_DeleteOnClose); - QVariant geoV = m_settings.value("geo"); - if (geoV.isValid()) { - restoreGeometry(geoV.toByteArray()); - } - } - - ~MainWindow() - { - qDebug() << "Deleted mainwindow"; - auto geo = saveGeometry(); - m_settings.setValue("geo", geo); - } -private: - QSettings m_settings; -}; - -static void addMenu(QMainWindow *w, const QString &name) -{ - auto action = w->menuBar()->addAction(name); - auto menu = new QMenu(); - action->setMenu(menu); - menu->addAction("Item 1"); - menu->addAction("Item 2"); - menu->addAction("Item 3"); - menu->addAction("Longer item 4"); - menu->addAction("Longer item 5"); -} - -int main(int argc, char **argv) -{ - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); - - QApplication app(argc, argv); - AzQtComponents::O3DEStylesheet stylesheet(&app); - AZ::IO::FixedMaxPath engineRootPath; - { - AZ::ComponentApplication componentApplication(argc, argv); - auto settingsRegistry = AZ::SettingsRegistry::Get(); - settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder); - } - stylesheet.initialize(&app, engineRootPath); - - auto wrapper = new AzQtComponents::WindowDecorationWrapper(); - QMainWindow *w = new MainWindow(); - w->setWindowTitle("Component Gallery"); - auto widget = new MainWidget(w); - w->resize(550, 900); - w->setMinimumWidth(500); - wrapper->setGuest(w); - wrapper->enableSaveRestoreGeometry("app", "org", "windowGeometry"); - w->setCentralWidget(widget); - w->setWindowFlags(w->windowFlags() | Qt::WindowStaysOnTopHint); - w->show(); - - auto action = w->menuBar()->addAction("Menu 1"); - - auto fileMenu = new QMenu(); - action->setMenu(fileMenu); - auto openDock = fileMenu->addAction("Open dockwidget"); - QObject::connect(openDock, &QAction::triggered, w, [&w] { - auto dock = new AzQtComponents::StyledDockWidget(QLatin1String("O3DE"), w); - auto button = new QPushButton("Click to dock"); - auto wid = new QWidget(); - auto widLayout = new QVBoxLayout(wid); - widLayout->addWidget(button); - wid->resize(300, 200); - QObject::connect(button, &QPushButton::clicked, dock, [dock]{ - dock->setFloating(!dock->isFloating()); - }); - w->addDockWidget(Qt::BottomDockWidgetArea, dock); - dock->setWidget(wid); - dock->resize(300, 200); - dock->setFloating(true); - dock->show(); - }); - - - QAction* newAction = fileMenu->addAction("Test StyledDetailsTableView"); - newAction->setShortcut(QKeySequence::Delete); - QObject::connect(newAction, &QAction::triggered, w, [w]() { - QDialog temp(w); - temp.setWindowTitle("StyleTableWidget Test"); - - QVBoxLayout* layout = new QVBoxLayout(&temp); - - AzQtComponents::StyledDetailsTableModel* tableModel = new AzQtComponents::StyledDetailsTableModel(); - tableModel->AddColumn("Status", AzQtComponents::StyledDetailsTableModel::StatusIcon); - tableModel->AddColumn("Platform"); - tableModel->AddColumn("Message"); - tableModel->AddColumnAlias("message", "Message"); - - tableModel->AddPrioritizedKey("Data3"); - tableModel->AddDeprioritizedKey("Data1"); - - auto table = new AzQtComponents::StyledDetailsTableView(); - table->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - table->setModel(tableModel); - - { - AzQtComponents::StyledDetailsTableModel::TableEntry entry; - entry.Add("Message", "A very very long first message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus et maximus tortor, ac commodo ante. Maecenas porta posuere mauris, vel consectetur arcu ornare interdum. Praesent rhoncus consequat neque, non volutpat mauris cursus a. Proin a nisl quis dui consectetur malesuada a et diam. Integer finibus luctus nibh nec cursus."); - entry.Add("Platform", "PC"); - entry.Add("Status", AzQtComponents::StyledDetailsTableModel::StatusSuccess); - tableModel->AddEntry(entry); - } - - { - AzQtComponents::StyledDetailsTableModel::TableEntry entry; - entry.Add("Message", "Second message. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus et maximus tortor, ac commodo ante. Maecenas porta posuere mauris, vel consectetur arcu ornare interdum. Praesent rhoncus consequat neque, non volutpat mauris cursus a. Proin a nisl quis dui consectetur malesuada a et diam. Integer finibus luctus nibh nec cursus."); - entry.Add("Platform", "PC"); - entry.Add("Status", AzQtComponents::StyledDetailsTableModel::StatusError); - entry.Add("Data1", "Deprioritized item."); - entry.Add("Data3", "Prioritized item."); - tableModel->AddEntry(entry); - } - - for (int i = 0; i < 4; i++) - { - AzQtComponents::StyledDetailsTableModel::TableEntry entry; - entry.Add("message", "Third message"); - entry.Add("Status", AzQtComponents::StyledDetailsTableModel::StatusWarning); - entry.Add("Platform", "PC"); - entry.Add("Index1", "A smaller detail."); - entry.Add("Index2", "Another small detail."); - entry.Add("Index3", "A final small detail."); - tableModel->AddEntry(entry); - } - - layout->addWidget(table); - - temp.exec(); - }); - - QAction* refreshAction = fileMenu->addAction("Refresh Stylesheet"); - QObject::connect(refreshAction, &QAction::triggered, refreshAction, [&stylesheet]() { - stylesheet.Refresh(); - }); - - - addMenu(w, "Menu 2"); - addMenu(w, "Menu 3"); - addMenu(w, "Menu 4"); - - w->addToolBar(toolBar()); - - QObject::connect(widget, &MainWidget::reloadCSS, widget, [] { - qDebug() << "Reloading CSS"; - qApp->setStyleSheet(QString()); - qApp->setStyleSheet("file:///style.qss"); - }); - - return app.exec(); -} diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp deleted file mode 100644 index 49faac1e19..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 "mainwidget.h" -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace AzQtComponents; - -MainWidget::MainWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::MainWidget) -{ - ui->setupUi(this); - - QStringList stripeButtonsNames = QStringList(); - stripeButtonsNames << "Controls" << "ItemViews" << "Styles" << "Layouts"; - ui->buttonStripe->addButtons(stripeButtonsNames, ui->stackedWidget->currentIndex()); - connect(ui->buttonStripe, &AzQtComponents::ButtonStripe::buttonClicked, - ui->stackedWidget, &QStackedWidget::setCurrentIndex); - - initializeControls(); - initializeItemViews(); - - connect(ui->button1, &QPushButton::clicked, this, []{ - auto mainwindow = new QMainWindow(); - auto menu = new QMenu("File"); - auto mb = new QMenuBar(); - menu->addAction("Action1"); - menu->addAction("Action2"); - menu->addAction("Action3"); - mb->addMenu(menu); - mb->addAction("Edit"); - mb->addMenu("Create"); - mb->addMenu("Select"); - mb->addMenu("Modify"); - mb->addMenu("Display"); - mainwindow->setMenuBar(mb); - mainwindow->resize(400, 400); - mainwindow->show(); - mainwindow->raise(); - }); -} - -MainWidget::~MainWidget() -{ - delete ui; - qDebug() << "Deleted main widget"; -} - -void MainWidget::mouseReleaseEvent(QMouseEvent *event) -{ - if (event->button() == Qt::MiddleButton) { - emit reloadCSS(); - } -} - -void MainWidget::initializeControls() -{ - auto menu = new QMenu(); - menu->addAction("Test 1"); - menu->addAction("Test 2"); - ui->button3->setMenu(menu); - - auto menu2 = new QMenu(); - menu2->addAction("Test 1"); - menu2->addAction("Test 2"); - ui->disabledButton3->setMenu(menu2); - - ui->selectedCheckBox->setCheckState(Qt::Checked); - ui->enabledCheckBox->setCheckState(Qt::Unchecked); - ui->tristateCheckBox->setCheckState(Qt::PartiallyChecked); - - // TODO: Move these into subclass, can't be done from .css - // Nicolas: or do it in the proxy style - // Sergio: css doesn't work well with proxy style , says Qt's docs. - ui->progressBar->setFormat(QString()); - ui->progressBar->setMaximumHeight(8); - ui->progressBarFull->setFormat(QString()); - ui->progressBarFull->setMaximumHeight(8); - - ui->button2->setProperty("class", "Primary"); - ui->disabledButton1->setProperty("class", "Primary"); - - ui->invalidLineEdit->setFlavor(AzQtComponents::StyledLineEdit::Invalid); - ui->validLineEdit->setFlavor(AzQtComponents::StyledLineEdit::Valid); - ui->questionLineEdit->setFlavor(AzQtComponents::StyledLineEdit::Question); - ui->infoLineEdit->setFlavor(AzQtComponents::StyledLineEdit::Information); - - // In order to try out validator impact on flavor - ui->invalidLineEdit->setPlaceholderText("Enter 4 digits"); - ui->invalidLineEdit->setValidator(new QRegExpValidator(QRegExp("[1-9]\\d{3,3}"))); - - ui->disabledVectorEdit->setColors(qRgb(84, 190, 93), qRgb(226, 82, 67), qRgb(66, 133, 244)); - ui->vectorEdit->setColors(qRgb(84, 190, 93), qRgb(226, 82, 67), qRgb(66, 133, 244)); - ui->unknownVectorEdit->setColors(qRgb(84, 190, 93), qRgb(226, 82, 67), qRgb(66, 133, 244)); - ui->warningVectorEdit->setColors(qRgb(84, 190, 93), qRgb(226, 82, 67), qRgb(66, 133, 244)); - ui->warningVectorEdit->setFlavor(AzQtComponents::VectorEditElement::Invalid); - - QStringList rpy = {tr("R"), tr("P"), tr("Y")}; - ui->disabledRPYVectorEdit->setLabels(rpy); - ui->rPYVectorEdit->setLabels(rpy); - ui->unknownRPYVectorEdit->setLabels(rpy); - ui->warningRPYVectorEdit->setLabels(rpy); - - ui->filterNameLineEdit->setClearButtonEnabled(true); - - ui->comboBox_4->setEnabled(false); - for (int i = 0; i < 10; ++i) { - ui->comboBox->addItem(QStringLiteral("combo 0: Item %1").arg(i)); - ui->comboBox_2->addItem(QStringLiteral("combo 2: Item %1").arg(i)); - ui->comboBox_3->addItem(QStringLiteral("combo 3: Item %1").arg(i)); - ui->comboBox_4->addItem(QStringLiteral("combo 4: Item %1").arg(i)); - ui->comboBox_5->addItem(QStringLiteral("combo 5: Item %1").arg(i)); - ui->comboBox_6->addItem(QStringLiteral("combo 6: Item %1").arg(i)); - } - - ui->allCombo->setProperty("class", "condition"); - ui->allCombo->setFixedWidth(37); - ui->allCombo->setFixedHeight(21); - ui->allCombo->addItem("all"); - ui->allCombo->addItem("any"); - - - // Construct the available tag list. - const int numAvailableTags = 128; - QVector availableTags; - availableTags.reserve(numAvailableTags+8); - - availableTags.push_back("Healthy"); - availableTags.push_back("Tired"); - availableTags.push_back("Laughing"); - availableTags.push_back("Happy"); - availableTags.push_back("Smiling"); - availableTags.push_back("Weapon Left"); - availableTags.push_back("Weapon Right"); - availableTags.push_back("Loooooooooooooooooong Tag"); - - for (const QString& tag : availableTags) - { - ui->searchWidget->AddTypeFilter("Foo", tag); - } - - for (int i = 0; i < numAvailableTags; ++i) - { - QString tagName = "tag" + QString::number(i + 1); - availableTags.push_back(tagName); - if (i < 10) - { - ui->searchWidget->AddTypeFilter("Bar", tagName); - } - } - - ui->tagSelector->Reinit(availableTags); - - // Pre-select some of the tags. - ui->tagSelector->SelectTag("Healthy"); - ui->tagSelector->SelectTag("Laughing"); - ui->tagSelector->SelectTag("Smiling"); - ui->tagSelector->SelectTag("Happy"); - ui->tagSelector->SelectTag("Weapon Left"); - - - ui->toolButton->setProperty("class", "QToolBar"); - ui->toolButton_2->setProperty("class", "QToolBar"); - ui->toolButton_3->setProperty("class", "QToolBar"); - ui->toolButton_4->setProperty("class", "QToolBar"); - ui->toolButton_5->setProperty("class", "QToolBar"); - ui->toolButton_6->setProperty("class", "QToolBar"); - ui->toolButton_7->setProperty("class", "QToolBar"); - ui->toolButton_8->setProperty("class", "QToolBar"); - ui->toolButton_9->setProperty("class", "QToolBar"); - ui->toolButton_10->setProperty("class", "QToolBar"); - ui->toolButton_11->setProperty("class", "QToolBar"); - ui->toolButton_12->setProperty("class", "QToolBar"); - - ui->conditionGroup->appendCondition(); - - // place the viewportTitle menu into the place holder we prepared in the ui file - /*ViewportTitleDlg* viewPortTitleDlg = new ViewportTitleDlg(ui->ViewportTitle); - auto viewPortTitleLayout = new QHBoxLayout(); - viewPortTitleLayout->addWidget(viewPortTitleDlg); - ui->ViewportTitle->setLayout(viewPortTitleLayout);*/ - - QStringList fontSizeMockup = {"8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "16pt", "18pt", "24pt", "30pt",}; - QStringList viewZoomMockup = {"20", "32", "40", "80", "160", "240"}; - const auto tbcbList = ui->toolButtonsComboBoxWidget->findChildren(); - foreach (auto tbcb, tbcbList) { - if (tbcb->objectName().contains("1")) { - tbcb->setIcon(QIcon(QStringLiteral(":/stylesheet/img/16x16/Font_text.png"))); - tbcb->comboBox()->addItems(fontSizeMockup); - } else if (tbcb->objectName().contains("2")) { - tbcb->setIcon(QIcon(QStringLiteral(":/stylesheet/img/16x16/Picture_view.png"))); - tbcb->comboBox()->addItems(viewZoomMockup); - } else if (tbcb->objectName().contains("3")) { - tbcb->setIcon(QIcon(QStringLiteral(":/stylesheet/img/16x16/List_view.png"))); - tbcb->comboBox()->addItems(fontSizeMockup); - } - } - - ui->WidgetHeader1->setForceInactive(true); - ui->WidgetHeader1->setButtons({ AzQtComponents::DockBarButton::DividerButton, AzQtComponents::DockBarButton::MaximizeButton, - AzQtComponents::DockBarButton::DividerButton, AzQtComponents::DockBarButton::CloseButton }); - ui->WidgetHeader1->setWindowTitleOverride("Widget Header"); - ui->WidgetHeader2->setButtons({AzQtComponents::DockBarButton::DividerButton, AzQtComponents::DockBarButton::MaximizeButton, - AzQtComponents::DockBarButton::DividerButton, AzQtComponents::DockBarButton::CloseButton}); - ui->WidgetHeader2->setWindowTitleOverride("Widget Header"); - - ui->NonDockableWidget1->setForceInactive(true); - ui->NonDockableWidget1->setWindowTitleOverride("Non-Dockable Widget"); - ui->NonDockableWidget1->setButtons({ AzQtComponents::DockBarButton::CloseButton }); - ui->NonDockableWidget1->setTearEnabled(false); - ui->NonDockableWidget1->setDragEnabled(false); - ui->NonDockableWidget2->setWindowTitleOverride("Non-Dockable Widget"); - ui->NonDockableWidget2->setButtons({ AzQtComponents::DockBarButton::CloseButton }); - ui->NonDockableWidget2->setTearEnabled(false); - ui->NonDockableWidget2->setDragEnabled(false); - - const auto rpbList = ui->RoundedButtonWidget->findChildren(); - foreach (auto rpb, rpbList) { - if (rpb->objectName().contains("Small")) - rpb->setProperty("class", "smallRounded"); - else - rpb->setProperty("class", "rounded"); - } - - ui->buttonOrange1->setProperty("class", "Primary"); - ui->buttonOrange2->setProperty("class", "Primary"); - - ui->tabWidget->tabBar()->setTabsClosable(true); - connect(ui->tabWidget->tabBar(), &QTabBar::tabCloseRequested, this, [this](int index) { - ui->tabWidget->removeTab(index); - }); -} - -void MainWidget::initializeItemViews() -{ - auto model = new QStandardItemModel(this); - model->setHorizontalHeaderLabels({QString(), tr("Priority"), tr("State"), tr("ID"), tr("Completed"), tr("Platform")}); - - for (int i = 0; i < 20; ++i) { - auto col0Item = new QStandardItem(); - col0Item->setCheckState(Qt::Checked); - col0Item->setData(QVariant(QSize(10, 20)), Qt::SizeHintRole); - col0Item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable); - auto col1Item = new QStandardItem((i < 10) ? tr("Top"): ""); - model->appendRow({ - col0Item, - col1Item, - new QStandardItem(i == 0 ? tr("Running") : (i < 10 ? tr("Failed") : tr("Waiting"))), - new QStandardItem("Environnment/Sky/Cloud/Cloudy-cloud"), - new QStandardItem(QString::number(i)), - new QStandardItem(i % 2 ? tr("Android") : tr("iPhone")) - }); - } - - ui->treeView->setModel(model); - ui->treeView->setSortingEnabled(true); - ui->treeView->setColumnWidth(0, 50); -} - -#include "StyleGallery/moc_mainwidget.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.h deleted file mode 100644 index 05fd4e327b..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef MAINWIDGET_H -#define MAINWIDGET_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui { -class MainWidget; -} - -class MainWidget : public QWidget -{ - Q_OBJECT - -public: - explicit MainWidget(QWidget *parent = 0); - ~MainWidget(); - -protected: - void mouseReleaseEvent(QMouseEvent *event) override; - -private: - void initializeControls(); - void initializeItemViews(); - -signals: - void reloadCSS(); - -private: - Ui::MainWidget *ui; -}; - -#endif // MAINWIDGET_H diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.ui b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.ui deleted file mode 100644 index 0330857418..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.ui +++ /dev/null @@ -1,2042 +0,0 @@ - - - MainWidget - - - - 0 - 0 - 592 - 781 - - - - Form - - - - - - - - Qt::Horizontal - - - - 40 - 10 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 10 - - - - - - - - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - 16 - - - - - 6 - - - - - true - - - - - - - - - place holder text - - - - - - - - - - false - - - disabled - - - - - - - simple and enabled - - - true - - - - - - - invalid (need 4 digits) - - - - - - - valid - - - - - - - question - - - - - - - information - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - 2 - - - 6 - - - - - Vector3 - - - - - - - true - - - - - - - Vector3 - - - - - - - - - - Vector3 - - - - - - - false - - - - - - - Vector3 - - - - - - - - - - Vector3 - - - - - - - true - - - - - - - Vector3 - - - - - - - - - - Vector3 - - - - - - - false - - - - - - - Vector3 - - - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</span></p></body></html> - - - - - - - 6 - - - - - false - - - Button 1 - - - - - - - false - - - Button 2 - - - - - - - false - - - Button 1 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Button 1 - - - - - - - Button 2 - - - - - - - Button 1 - - - - - - - - - 6 - - - - - true - - - - - - - - - - true - - - - - - - true - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - - - - Selected - - - true - - - - - - - Enabled - - - - - - - false - - - Disabled - - - - - - - - - - - 0 - 0 - - - - - - - Tristate checkbox - - - false - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - - - Selected - - - true - - - - - - - Enabled - - - - - - - false - - - Disabled - - - - - - - - - - - - 7 - - - - - 24 - - - - - - - 100 - - - - - - - - - - - - -45.500000000000000 - - - 100.519999999999996 - - - 48.700000000000003 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - -50 - - - 100 - - - 50 - - - - - - - - - - - - - - - 100 - - - 24 - - - Qt::Horizontal - - - false - - - - - - - - - 6 - - - - - - Dropdown Default - - - - - New Selection - - - - - - - - - Selection 1 - - - - - Selection 2 - - - - - Selection 3 - - - - - Selection 4 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 10 - - - 50 - - - 50 - - - 50 - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 98 - 512 - - - - - 15 - - - - - - 0 - 0 - - - - - 0 - 320 - - - - - 16777215 - 320 - - - - true - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</span></p></body></html> - - - - - - - - 0 - 0 - - - - - item1 - - - - - item2 - - - - - item3 - - - - - - - - - - - - - - 0 - - - - - - 140 - 160 - - - - - 2 - - - - - false - - - ... - - - - :/stylesheet/img/16x16/Select_right.png:/stylesheet/img/16x16/Select_right.png - - - - - - - false - - - ... - - - - :/stylesheet/img/16x16/Move.png:/stylesheet/img/16x16/Move.png - - - - - - - ... - - - - :/stylesheet/img/16x16/Select_right.png:/stylesheet/img/16x16/Select_right.png - - - true - - - true - - - - - - - ... - - - - :/stylesheet/img/16x16/Move.png:/stylesheet/img/16x16/Move.png - - - true - - - true - - - - - - - false - - - ... - - - - :/stylesheet/img/16x16/Translate.png:/stylesheet/img/16x16/Translate.png - - - - - - - ... - - - - :/stylesheet/img/16x16/Translate.png:/stylesheet/img/16x16/Translate.png - - - true - - - true - - - - - - - ... - - - - :/stylesheet/img/16x16/Move.png:/stylesheet/img/16x16/Move.png - - - true - - - - - - - ... - - - - :/stylesheet/img/16x16/Select_right.png:/stylesheet/img/16x16/Select_right.png - - - true - - - - - - - ... - - - - :/stylesheet/img/16x16/Translate.png:/stylesheet/img/16x16/Translate.png - - - true - - - - - - - false - - - ... - - - - :/stylesheet/img/16x16/Scale.png:/stylesheet/img/16x16/Scale.png - - - - - - - ... - - - - :/stylesheet/img/16x16/Scale.png:/stylesheet/img/16x16/Scale.png - - - true - - - true - - - - - - - ... - - - - :/stylesheet/img/16x16/Scale.png:/stylesheet/img/16x16/Scale.png - - - true - - - - - - - - - - - 16777215 - 180 - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - Sample - - - - :/stylesheet/img/16x16/Audio.png:/stylesheet/img/16x16/Audio.png - - - - - - - - - - - 250 - 50 - - - - - - - Text - - - false - - - - Text - - - - - - - - - Text - - - - - - - - - Text - - - - - - - - - Text - - - - - Item 1 - - - - - Item 2 - - - - - Longer Item 3 - - - - - Longer Item 4 - - - - - Item 5 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 25 - 20 - - - - - - - - - - - - 260 - 400 - - - - - 6 - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 230 - - - - - - - - 2 - - - - Tab 1 - - - - - Tab 2 - - - - - Tab 3 - - - - - - - - - - - - 250 - 60 - - - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 300 - 20 - - - - - - - - - 250 - 100 - - - - - 300 - 100 - - - - - 8 - - - - - 8 - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - Support - - - Qt::AlignCenter - - - - - - - - - - - - - - :/stylesheet/img/question_small.png:/stylesheet/img/question_small.png - - - - - - - Support - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 8 - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - Support - - - Qt::AlignCenter - - - - - - - - - - - - - - :/stylesheet/img/question_small.png:/stylesheet/img/question_small.png - - - - - - - Support - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 8 - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - - - - :/stylesheet/img/question.png:/stylesheet/img/question.png - - - - - - - Support - - - Qt::AlignCenter - - - - - - - - - - - - - - :/stylesheet/img/question_small.png:/stylesheet/img/question_small.png - - - - - - - Support - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - false - - - Cancel - - - - - - - Cancel - - - - - - - Button - - - - - - - Button - - - - - - - - - - - - - - - 0 - 0 - - - - - 10 - - - - - - - Filter Name: - - - - - - - - 200 - 0 - - - - - 200 - 23 - - - - character - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 10 - - - - - Show assets which match - - - - - - - - - - of the following conditions: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 25 - - - - - - - - - 300 - 0 - - - - - 300 - 16777215 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - AzQtComponents::StyledLineEdit - QLineEdit -
AzQtComponents/Components/StyledLineEdit.h
-
- - AzQtComponents::VectorEdit - QWidget -
AzQtComponents/Components/VectorEdit.h
- 1 -
- - AzQtComponents::StyledDoubleSpinBox - QDoubleSpinBox -
AzQtComponents/Components/StyledSpinBox.h
-
- - AzQtComponents::StyledSpinBox - AzQtComponents::StyledDoubleSpinBox -
AzQtComponents/Components/StyledSpinBox.h
-
- - AzQtComponents::ButtonStripe - QWidget -
AzQtComponents/Components/ButtonStripe.h
- 1 -
- - ConditionGroupWidget - QWidget -
AzQtComponents/StyleGallery/ConditionGroupWidget.h
- 1 -
- - AzQtComponents::TagSelector - QWidget -
AzQtComponents/Components/TagSelector.h
- 1 -
- - DeploymentsWidget - QWidget -
AzQtComponents/StyleGallery/DeploymentsWidget.h
- 1 -
- - AzQtComponents::TabWidget - QTabWidget -
AzQtComponents/Components/Widgets/TabWidget.h
- 1 -
- - AzQtComponents::ToolButtonComboBox - QWidget -
AzQtComponents/Components/ToolButtonComboBox.h
- 1 -
- - AzQtComponents::TitleBar - QWidget -
AzQtComponents/Components/Titlebar.h
- 1 -
- - AzQtComponents::ButtonDivider - QWidget -
AzQtComponents/Components/ButtonDivider.h
- 1 -
- - AzQtComponents::FilteredSearchWidget - QWidget -
AzQtComponents/Components/FilteredSearchWidget.h
- 1 -
-
- - - - horizontalSlider - valueChanged(int) - progressBar - setValue(int) - - - 535 - 403 - - - 535 - 375 - - - - -
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/triangles.svg b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/triangles.svg deleted file mode 100644 index 445aa2a462..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/triangles.svg +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_style_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_style_files.cmake deleted file mode 100644 index 5d33f6d8f0..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_style_files.cmake +++ /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 -# -# - -set(FILES - StyleGallery/ConditionGroupWidget.cpp - StyleGallery/ConditionGroupWidget.h - StyleGallery/ConditionWidget.cpp - StyleGallery/ConditionWidget.h - StyleGallery/DeploymentsWidget.cpp - StyleGallery/DeploymentsWidget.h - StyleGallery/deploymentswidget.ui - StyleGallery/main.cpp - StyleGallery/mainwidget.cpp - StyleGallery/mainwidget.h - StyleGallery/mainwidget.ui - StyleGallery/MyCombo.cpp - StyleGallery/MyCombo.h - StyleGallery/ViewportTitleDlg.cpp - StyleGallery/ViewportTitleDlg.h - StyleGallery/ViewportTitleDlg.ui -) diff --git a/Code/Framework/AzQtComponents/CMakeLists.txt b/Code/Framework/AzQtComponents/CMakeLists.txt index 8514df2616..135781140e 100644 --- a/Code/Framework/AzQtComponents/CMakeLists.txt +++ b/Code/Framework/AzQtComponents/CMakeLists.txt @@ -40,24 +40,6 @@ ly_add_target( AZ::AzCore ) -# DEPRECATED: this target was marked as deprecated in the VS filter -ly_add_target( - NAME AmazonStyle APPLICATION - NAMESPACE AZ - AUTOMOC - AUTOUIC - FILES_CMAKE - AzQtComponents/azqtcomponents_style_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - AzQtComponents - BUILD_DEPENDENCIES - PRIVATE - 3rdParty::Qt::Widgets - AZ::AzQtComponents -) - ly_add_target( NAME AmazonQtControlGallery APPLICATION NAMESPACE AZ From 16f9eece76872be37b236367b93dafd5927eb9d0 Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 14:12:12 -0700 Subject: [PATCH 27/75] 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 adb3b9366c9a4d9a6cbc83a4ec3069bccfdfb5e1 Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 12:28:21 -0700 Subject: [PATCH 28/75] Update icons and launcher images to the O3DE logo Signed-off-by: pconroy --- Code/Editor/res/LegacyLogo.bmp | 3 --- Templates/DefaultProject/Template/Resources/GameSDK.ico | 4 ++-- .../DefaultProject/Template/Resources/LegacyLogoLauncher.bmp | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage1024x768.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage1536x2048.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage2048x1536.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage768x1024.png | 4 ++-- .../LaunchImage.launchimage/iPhoneLaunchImage640x1136.png | 4 ++-- .../LaunchImage.launchimage/iPhoneLaunchImage640x960.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadAppIcon152x152.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadAppIcon76x76.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadProAppIcon167x167.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png | 4 ++-- Templates/MinimalProject/Template/Resources/GameSDK.ico | 4 ++-- .../MinimalProject/Template/Resources/LegacyLogoLauncher.bmp | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_128 _2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_256 _2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png | 4 ++-- .../Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png | 4 ++-- .../Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage1024x768.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage1536x2048.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage2048x1536.png | 4 ++-- .../LaunchImage.launchimage/iPadLaunchImage768x1024.png | 4 ++-- .../LaunchImage.launchimage/iPhoneLaunchImage640x1136.png | 4 ++-- .../LaunchImage.launchimage/iPhoneLaunchImage640x960.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadAppIcon152x152.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadAppIcon76x76.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadProAppIcon167x167.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png | 4 ++-- .../TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png | 4 ++-- .../TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png | 4 ++-- 63 files changed, 124 insertions(+), 127 deletions(-) delete mode 100644 Code/Editor/res/LegacyLogo.bmp diff --git a/Code/Editor/res/LegacyLogo.bmp b/Code/Editor/res/LegacyLogo.bmp deleted file mode 100644 index dd2ea18ecc..0000000000 --- a/Code/Editor/res/LegacyLogo.bmp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97f4004da6ec1bf07d522d6675f814e53e36923a45084ff5d7e4113e293d4fec -size 117656 diff --git a/Templates/DefaultProject/Template/Resources/GameSDK.ico b/Templates/DefaultProject/Template/Resources/GameSDK.ico index cb935cd926..0be1f28b6c 100644 --- a/Templates/DefaultProject/Template/Resources/GameSDK.ico +++ b/Templates/DefaultProject/Template/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/Templates/DefaultProject/Template/Resources/LegacyLogoLauncher.bmp b/Templates/DefaultProject/Template/Resources/LegacyLogoLauncher.bmp index fe0adc54a4..7a35cddd49 100644 --- a/Templates/DefaultProject/Template/Resources/LegacyLogoLauncher.bmp +++ b/Templates/DefaultProject/Template/Resources/LegacyLogoLauncher.bmp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf6d56fe4c367d39bd78500dd34332fcad57ad41241768b52781dbdb60ddd972 -size 347568 +oid sha256:7c8433178baebafe984ca23d9325d3c71b5a177fc3b3b869afbb01a583542fbe +size 462842 diff --git a/Templates/DefaultProject/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 index 5970ea34ba..d30f2d3686 100644 --- a/Templates/DefaultProject/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 @@ -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_128.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png index 9e30e09547..5a73a4a54d 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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_16.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png index aeb29abd0a..a7ec66841f 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png index 445a389d61..474378c926 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/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 index 0904cf7ce8..f9ff1c15e3 100644 --- a/Templates/DefaultProject/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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07631f41b8dea80713d2463f81a713a9a93798975b6fb50afbeeb13d26c57fa2 -size 48899 +oid sha256:934502e242ff7a2e34e21eed1424b5e0953e701761d158520b3297944132328e +size 18716 diff --git a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png index 5970ea34ba..d30f2d3686 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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_32.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png index 445a389d61..474378c926 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png index 1fad9bda96..3359e99cd4 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png index e1517dddb6..f9ff1c15e3 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png index b425cb685f..a736c7f6b8 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png +++ b/Templates/DefaultProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png index 1249ef3703..9f586d6af3 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png index cdb6d5a82a..c978631c22 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png index 954d3084c8..a52e832a42 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png index 021319fbc3..3e441fab3b 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png index a15fd777fa..e662e9675c 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png index 2855f4069d..2753529fc2 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png index b0dd493c11..ad18894411 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png index 21aa62e96b..888d8cf785 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png index 6b696a84b2..86aa72016a 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png index f3dfa05839..79331c29b1 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png index 5325b805fd..27c4aaef2e 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png index 98d8455838..df1630a95a 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png index 7482f6c892..4b7f5d6318 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png index da987b86f9..674c6da124 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png index 205e025c36..c0c10c2390 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png index 0deb4f4f35..27c4aaef2e 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png index 78591751d7..9093e13867 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png index 034dcb9fed..674c6da124 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png index f0fa89149c..4b7f5d6318 100644 --- a/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ b/Templates/DefaultProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/GameSDK.ico b/Templates/MinimalProject/Template/Resources/GameSDK.ico index cb935cd926..0be1f28b6c 100644 --- a/Templates/MinimalProject/Template/Resources/GameSDK.ico +++ b/Templates/MinimalProject/Template/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/Templates/MinimalProject/Template/Resources/LegacyLogoLauncher.bmp b/Templates/MinimalProject/Template/Resources/LegacyLogoLauncher.bmp index fe0adc54a4..7a35cddd49 100644 --- a/Templates/MinimalProject/Template/Resources/LegacyLogoLauncher.bmp +++ b/Templates/MinimalProject/Template/Resources/LegacyLogoLauncher.bmp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf6d56fe4c367d39bd78500dd34332fcad57ad41241768b52781dbdb60ddd972 -size 347568 +oid sha256:7c8433178baebafe984ca23d9325d3c71b5a177fc3b3b869afbb01a583542fbe +size 462842 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 index 5970ea34ba..d30f2d3686 100644 --- 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 @@ -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/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png index 9e30e09547..5a73a4a54d 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png index aeb29abd0a..a7ec66841f 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png index 445a389d61..474378c926 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/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 index 0904cf7ce8..f9ff1c15e3 100644 --- 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 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07631f41b8dea80713d2463f81a713a9a93798975b6fb50afbeeb13d26c57fa2 -size 48899 +oid sha256:934502e242ff7a2e34e21eed1424b5e0953e701761d158520b3297944132328e +size 18716 diff --git a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png index 5970ea34ba..d30f2d3686 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png index 445a389d61..474378c926 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png index 1fad9bda96..3359e99cd4 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png index e1517dddb6..f9ff1c15e3 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png index b425cb685f..a736c7f6b8 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png +++ b/Templates/MinimalProject/Template/Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png index 1249ef3703..9f586d6af3 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png index cdb6d5a82a..c978631c22 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png index 954d3084c8..a52e832a42 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png index 021319fbc3..3e441fab3b 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png index a15fd777fa..e662e9675c 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png index 2855f4069d..2753529fc2 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png index b0dd493c11..ad18894411 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png index 21aa62e96b..888d8cf785 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png index 6b696a84b2..86aa72016a 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png index f3dfa05839..79331c29b1 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png index 5325b805fd..27c4aaef2e 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png index 98d8455838..df1630a95a 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png index 7482f6c892..4b7f5d6318 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png index da987b86f9..674c6da124 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png index 205e025c36..c0c10c2390 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png index 0deb4f4f35..27c4aaef2e 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png index 78591751d7..9093e13867 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png index 034dcb9fed..674c6da124 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png index f0fa89149c..4b7f5d6318 100644 --- a/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png +++ b/Templates/MinimalProject/Template/Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.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 From 622139b3d51100827517e842b402c8763c0e075f Mon Sep 17 00:00:00 2001 From: pconroy Date: Thu, 1 Jul 2021 14:26:08 -0700 Subject: [PATCH 29/75] Removed missed reference to deleted file. Signed-off-by: pconroy --- Code/Editor/editor_lib_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index dcb169f783..5988d9385b 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -229,7 +229,6 @@ set(FILES res/warning16x16.ico res/water.bmp res/work_in_progress_icon.ico - res/LegacyLogo.bmp res/MannFileManagerImageList.bmp res/infobar/CameraCollision-default.svg res/infobar/GotoLocation-default.svg From 02f340abbd8c7b39ba5012c9b18320a2c9799f57 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Thu, 1 Jul 2021 18:37:44 -0700 Subject: [PATCH 30/75] Fix resource registration for the EntityOutlinerWidget class in AzToolsFramework. Also moves icons to a more appropriate location. (#1731) Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../ComponentEntityEditorOutlinerWindow.qrc | 21 --------------- .../UI/Outliner/EntityOutliner.qss | 24 ++++++++--------- .../Outliner/OutlinerDisplayOptionsMenu.cpp | 6 ++--- .../componententityeditorplugin_files.cmake | 1 - .../Images/Outliner}/lock_default.svg | 0 .../Images/Outliner}/lock_default_hover.svg | 0 .../Outliner}/lock_default_transparent.svg | 0 .../Images/Outliner}/lock_on.svg | 0 .../Images/Outliner}/lock_on_hover.svg | 0 .../Images/Outliner}/lock_on_transparent.svg | 0 .../Images/Outliner}/sort_a_to_z.svg | 0 .../Images/Outliner}/sort_manually.svg | 0 .../Images/Outliner}/sort_z_to_a.svg | 0 .../Images/Outliner}/visibility_default.svg | 0 .../Outliner}/visibility_default_hover.svg | 0 .../visibility_default_transparent.svg | 0 .../Images/Outliner}/visibility_on.svg | 0 .../Images/Outliner}/visibility_on_hover.svg | 0 .../Outliner}/visibility_on_transparent.svg | 0 .../AzQtComponents/Images/resources.qrc | 27 +++++++++++++++---- .../UI/Outliner/EntityOutliner.qss | 24 ++++++++--------- .../EntityOutlinerDisplayOptionsMenu.cpp | 6 ++--- .../UI/Outliner/EntityOutlinerWidget.cpp | 8 ++++++ 23 files changed, 60 insertions(+), 57 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentEntityEditorOutlinerWindow.qrc rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_default.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_default_hover.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_default_transparent.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_on.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_on_hover.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/lock_on_transparent.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/sort_a_to_z.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/sort_manually.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/sort_z_to_a.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_default.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_default_hover.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_default_transparent.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_on.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_on_hover.svg (100%) rename Code/{Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons => Framework/AzQtComponents/AzQtComponents/Images/Outliner}/visibility_on_transparent.svg (100%) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentEntityEditorOutlinerWindow.qrc b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentEntityEditorOutlinerWindow.qrc deleted file mode 100644 index 07f79dcb5c..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentEntityEditorOutlinerWindow.qrc +++ /dev/null @@ -1,21 +0,0 @@ - - - Icons/sort_a_to_z.svg - Icons/sort_manually.svg - Icons/sort_z_to_a.svg - - Icons/visibility_default.svg - Icons/visibility_default_hover.svg - Icons/visibility_default_transparent.svg - Icons/visibility_on.svg - Icons/visibility_on_hover.svg - Icons/visibility_on_transparent.svg - - Icons/lock_default.svg - Icons/lock_default_hover.svg - Icons/lock_default_transparent.svg - Icons/lock_on.svg - Icons/lock_on_hover.svg - Icons/lock_on_transparent.svg - - diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/EntityOutliner.qss b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/EntityOutliner.qss index e3dadf6f22..624c89aad7 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/EntityOutliner.qss +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/EntityOutliner.qss @@ -93,37 +93,37 @@ OutlinerCheckBox#VisibilityMixed::indicator:checked OutlinerCheckBox#Visibility::indicator:checked , OutlinerCheckBox#VisibilityMixed::indicator:checked { - image: url(:/visibility_default.svg); + image: url(:/Outliner/visibility_default.svg); } OutlinerCheckBox#Visibility::indicator:unchecked , OutlinerCheckBox#VisibilityMixed::indicator:unchecked { - image: url(:/visibility_on.svg); + image: url(:/Outliner/visibility_on.svg); } OutlinerCheckBox#VisibilityLayerOverride::indicator:checked { - image: url(:/visibility_default_transparent.svg); + image: url(:/Outliner/visibility_default_transparent.svg); } OutlinerCheckBox#VisibilityLayerOverride::indicator:unchecked { - image: url(:/visibility_on_transparent.svg); + image: url(:/Outliner/visibility_on_transparent.svg); } OutlinerCheckBox#VisibilityHover::indicator:checked , OutlinerCheckBox#VisibilityMixedHover::indicator:checked , OutlinerCheckBox#VisibilityLayerOverrideHover::indicator:checked { - image: url(:/visibility_default_hover.svg); + image: url(:/Outliner/visibility_default_hover.svg); } OutlinerCheckBox#VisibilityHover::indicator:unchecked , OutlinerCheckBox#VisibilityMixedHover::indicator:unchecked , OutlinerCheckBox#VisibilityLayerOverrideHover::indicator:unchecked { - image: url(:/visibility_on_hover.svg); + image: url(:/Outliner/visibility_on_hover.svg); } @@ -132,35 +132,35 @@ OutlinerCheckBox#VisibilityHover::indicator:unchecked OutlinerCheckBox#Lock::indicator:checked , OutlinerCheckBox#LockMixed::indicator:checked { - image: url(:/lock_on.svg); + image: url(:/Outliner/lock_on.svg); } OutlinerCheckBox#Lock::indicator:unchecked , OutlinerCheckBox#LockMixed::indicator:unchecked { - image: url(:/lock_default.svg); + image: url(:/Outliner/lock_default.svg); } OutlinerCheckBox#LockLayerOverride::indicator:checked { - image: url(:/lock_on_transparent.svg); + image: url(:/Outliner/lock_on_transparent.svg); } OutlinerCheckBox#LockLayerOverride::indicator:unchecked { - image: url(:/lock_default_transparent.svg); + image: url(:/Outliner/lock_default_transparent.svg); } OutlinerCheckBox#LockHover::indicator:checked , OutlinerCheckBox#LockMixedHover::indicator:checked , OutlinerCheckBox#LockLayerOverrideHover::indicator:checked { - image: url(:/lock_on_hover.svg); + image: url(:/Outliner/lock_on_hover.svg); } OutlinerCheckBox#LockHover::indicator:unchecked , OutlinerCheckBox#LockMixedHover::indicator:unchecked , OutlinerCheckBox#LockLayerOverrideHover::indicator:unchecked { - image: url(:/lock_default_hover.svg); + image: url(:/Outliner/lock_default_hover.svg); } diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp index edc3950336..c1af8d76d7 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerDisplayOptionsMenu.cpp @@ -16,15 +16,15 @@ namespace EntityOutliner DisplayOptionsMenu::DisplayOptionsMenu(QWidget* parent) : QMenu(parent) { - auto sortManually = addAction(QIcon(QStringLiteral(":/sort_manually.svg")), tr("Sort: Manually")); + auto sortManually = addAction(QIcon(QStringLiteral(":/Outliner/sort_manually.svg")), tr("Sort: Manually")); sortManually->setData(static_cast(DisplaySortMode::Manually)); sortManually->setCheckable(true); - auto sortAtoZ = addAction(QIcon(QStringLiteral(":/sort_a_to_z.svg")), tr("Sort: A to Z")); + auto sortAtoZ = addAction(QIcon(QStringLiteral(":/Outliner/sort_a_to_z.svg")), tr("Sort: A to Z")); sortAtoZ->setData(static_cast(DisplaySortMode::AtoZ)); sortAtoZ->setCheckable(true); - auto sortZtoA = addAction(QIcon(QStringLiteral(":/sort_z_to_a.svg")), tr("Sort: Z to A")); + auto sortZtoA = addAction(QIcon(QStringLiteral(":/Outliner/sort_z_to_a.svg")), tr("Sort: Z to A")); sortZtoA->setData(static_cast(DisplaySortMode::ZtoA)); sortZtoA->setCheckable(true); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index c22385dd80..1f7c3c0388 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -12,7 +12,6 @@ set(FILES SandboxIntegration.h SandboxIntegration.cpp ComponentEntityEditorPlugin_precompiled.h - UI/ComponentEntityEditorOutlinerWindow.qrc UI/QComponentEntityEditorMainWindow.h UI/QComponentEntityEditorMainWindow.cpp UI/QComponentLevelEntityEditorMainWindow.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default_hover.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default_hover.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default_hover.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default_hover.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default_transparent.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default_transparent.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_default_transparent.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_default_transparent.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on_hover.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on_hover.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on_hover.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on_hover.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on_transparent.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on_transparent.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/lock_on_transparent.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/lock_on_transparent.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_a_to_z.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_a_to_z.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_a_to_z.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_a_to_z.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_manually.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_manually.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_manually.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_manually.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_z_to_a.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_z_to_a.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/sort_z_to_a.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/sort_z_to_a.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default_hover.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default_hover.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default_hover.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default_hover.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default_transparent.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default_transparent.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_default_transparent.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_default_transparent.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on_hover.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on_hover.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on_hover.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on_hover.svg diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on_transparent.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on_transparent.svg similarity index 100% rename from Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Icons/visibility_on_transparent.svg rename to Code/Framework/AzQtComponents/AzQtComponents/Images/Outliner/visibility_on_transparent.svg diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc index 74610dca90..c72687359b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc +++ b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc @@ -10,11 +10,6 @@ Level/level.svg - - Notifications/checkmark.svg - Notifications/download.svg - Notifications/link.svg - Menu/resolution.svg Menu/debug.svg @@ -31,4 +26,26 @@ Menu/menu.svg Menu/helpers.svg + + Notifications/checkmark.svg + Notifications/download.svg + Notifications/link.svg + + + Outliner/sort_a_to_z.svg + Outliner/sort_manually.svg + Outliner/sort_z_to_a.svg + Outliner/visibility_default.svg + Outliner/visibility_default_hover.svg + Outliner/visibility_default_transparent.svg + Outliner/visibility_on.svg + Outliner/visibility_on_hover.svg + Outliner/visibility_on_transparent.svg + Outliner/lock_default.svg + Outliner/lock_default_hover.svg + Outliner/lock_default_transparent.svg + Outliner/lock_on.svg + Outliner/lock_on_hover.svg + Outliner/lock_on_transparent.svg + diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutliner.qss b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutliner.qss index ce2171d748..a8447ffc00 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutliner.qss +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutliner.qss @@ -87,24 +87,24 @@ AzToolsFramework--EntityOutlinerCheckBox#VisibilityMixed::indicator:checked AzToolsFramework--EntityOutlinerCheckBox#Visibility::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityMixed::indicator:checked { - image: url(:/visibility_default.svg); + image: url(:/Outliner/visibility_default.svg); } AzToolsFramework--EntityOutlinerCheckBox#Visibility::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityMixed::indicator:unchecked { - image: url(:/visibility_on.svg); + image: url(:/Outliner/visibility_on.svg); margin-top: 3px; } AzToolsFramework--EntityOutlinerCheckBox#VisibilityOverridden::indicator:checked { - image: url(:/visibility_default_transparent.svg); + image: url(:/Outliner/visibility_default_transparent.svg); } AzToolsFramework--EntityOutlinerCheckBox#VisibilityOverridden::indicator:unchecked { - image: url(:/visibility_on_transparent.svg); + image: url(:/Outliner/visibility_on_transparent.svg); margin-top: 3px; } @@ -112,7 +112,7 @@ AzToolsFramework--EntityOutlinerCheckBox#VisibilityHover::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityMixedHover::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityOverriddenHover::indicator:checked { - image: url(:/visibility_default_hover.svg); + image: url(:/Outliner/visibility_default_hover.svg); margin-top: 3px; } @@ -120,7 +120,7 @@ AzToolsFramework--EntityOutlinerCheckBox#VisibilityHover::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityMixedHover::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#VisibilityOverriddenHover::indicator:unchecked { - image: url(:/visibility_on_hover.svg); + image: url(:/Outliner/visibility_on_hover.svg); margin-top: 3px; } @@ -130,24 +130,24 @@ AzToolsFramework--EntityOutlinerCheckBox#VisibilityHover::indicator:unchecked AzToolsFramework--EntityOutlinerCheckBox#Lock::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#LockMixed::indicator:checked { - image: url(:/lock_on.svg); + image: url(:/Outliner/lock_on.svg); margin-top: 1px; } AzToolsFramework--EntityOutlinerCheckBox#Lock::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#LockMixed::indicator:unchecked { - image: url(:/lock_default.svg); + image: url(:/Outliner/lock_default.svg); } AzToolsFramework--EntityOutlinerCheckBox#LockOverridden::indicator:checked { - image: url(:/lock_on_transparent.svg); + image: url(:/Outliner/lock_on_transparent.svg); } AzToolsFramework--EntityOutlinerCheckBox#LockOverridden::indicator:unchecked { - image: url(:/lock_default_transparent.svg); + image: url(:/Outliner/lock_default_transparent.svg); margin-top: 1px; } @@ -155,7 +155,7 @@ AzToolsFramework--EntityOutlinerCheckBox#LockHover::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#LockMixedHover::indicator:checked , AzToolsFramework--EntityOutlinerCheckBox#LockOverriddenHover::indicator:checked { - image: url(:/lock_on_hover.svg); + image: url(:/Outliner/lock_on_hover.svg); margin-top: 1px; } @@ -163,6 +163,6 @@ AzToolsFramework--EntityOutlinerCheckBox#LockHover::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#LockMixedHover::indicator:unchecked , AzToolsFramework--EntityOutlinerCheckBox#LockOverriddenHover::indicator:unchecked { - image: url(:/lock_default_hover.svg); + image: url(:/Outliner/lock_default_hover.svg); margin-top: 1px; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.cpp index 73d5c5cbc4..d33be96b98 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerDisplayOptionsMenu.cpp @@ -17,15 +17,15 @@ namespace AzToolsFramework DisplayOptionsMenu::DisplayOptionsMenu(QWidget* parent) : QMenu(parent) { - auto sortManually = addAction(QIcon(QStringLiteral(":/sort_manually.svg")), tr("Sort: Manually")); + auto sortManually = addAction(QIcon(QStringLiteral(":/Outliner/sort_manually.svg")), tr("Sort: Manually")); sortManually->setData(static_cast(DisplaySortMode::Manually)); sortManually->setCheckable(true); - auto sortAtoZ = addAction(QIcon(QStringLiteral(":/sort_a_to_z.svg")), tr("Sort: A to Z")); + auto sortAtoZ = addAction(QIcon(QStringLiteral(":/Outliner/sort_a_to_z.svg")), tr("Sort: A to Z")); sortAtoZ->setData(static_cast(DisplaySortMode::AtoZ)); sortAtoZ->setCheckable(true); - auto sortZtoA = addAction(QIcon(QStringLiteral(":/sort_z_to_a.svg")), tr("Sort: Z to A")); + auto sortZtoA = addAction(QIcon(QStringLiteral(":/Outliner/sort_z_to_a.svg")), tr("Sort: Z to A")); sortZtoA->setData(static_cast(DisplaySortMode::ZtoA)); sortZtoA->setCheckable(true); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index 8324877d95..96479bb54c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -48,6 +48,12 @@ #include +// This has to live outside of any namespaces due to issues on Linux with calls to Q_INIT_RESOURCE if they are inside a namespace +void initEntityOutlinerWidgetResources() +{ + Q_INIT_RESOURCE(resources); +} + namespace { const int queuedChangeDelay = 16; // milliseconds @@ -143,6 +149,8 @@ namespace AzToolsFramework , m_sortContentQueued(false) , m_dropOperationInProgress(false) { + initEntityOutlinerWidgetResources(); + m_gui = new Ui::EntityOutlinerWidgetUI(); m_gui->setupUi(this); From e13b9ca8295dbae208ce1a1f819fc5a195910542 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 1 Jul 2021 21:49:32 -0500 Subject: [PATCH 31/75] [ATOM-15926] Fixing light delegates which were always calculating the attenuation radius automatically for their debug display instead of respecting the user-set attenuation radius. (#1732) Signed-off-by: Ken Pruiksma --- .../Code/Source/CoreLights/CapsuleLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/PolygonLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/QuadLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/SimplePointLightDelegate.cpp | 4 ++-- .../Code/Source/CoreLights/SphereLightDelegate.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp index 4b9a9b0223..e8257acef0 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp @@ -69,7 +69,7 @@ namespace AZ if (isSelected) { // Attenuation radius shape is just a capsule with the same internal height, but a radius of the attenuation radius. - float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); + float radius = GetConfig()->m_attenuationRadius; // Add on the caps for the attenuation radius float scale = GetTransform().GetUniformScale(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp index 1db22b4ad8..0a712dda47 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp @@ -79,7 +79,7 @@ namespace AZ debugDisplay.SetColor(color); // Draw a Polygon for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); debugDisplay.DrawArrow(transform.GetTranslation(), transform.GetTranslation() + transform.GetBasisZ()); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp index b69df642c9..1818088d2d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp @@ -65,7 +65,7 @@ namespace AZ debugDisplay.SetColor(color); // Draw a quad for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp index b2835c7dd9..ce198eb8e2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp @@ -48,9 +48,9 @@ namespace AZ if (isSelected) { debugDisplay.SetColor(color); - + // Draw a sphere for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } } } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp index 6ade4347f3..5d5ed4c11d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp @@ -53,9 +53,9 @@ namespace AZ if (isSelected) { debugDisplay.SetColor(color); - + // Draw a sphere for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } } From 6a0b8ae6b6ed98012d0a68c9903c7d0c58b64ca8 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 1 Jul 2021 21:50:01 -0500 Subject: [PATCH 32/75] [ATOM-15854] Adjusting alpha on grazing angles so it doesn't affect the diffuse response. (#1708) Signed-off-by: Ken Pruiksma --- .../Types/EnhancedPBR_ForwardPass.azsl | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index 87afd1936d..4150d213a0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -324,16 +324,21 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Finalize Lighting lightingData.FinalizeLighting(surface.transmission.tint); - if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) - { - float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; // Increase opacity at grazing angles. - alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); - } - PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); // ------- Opacity ------- + if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) + { + // Increase opacity at grazing angles for surfaces with a low m_opacityAffectsSpecularFactor. + // For m_opacityAffectsSpecularFactor values close to 0, that indicates a transparent surface + // like glass, so it becomes less transparent at grazing angles. For m_opacityAffectsSpecularFactor + // values close to 1.0, that indicates the absence of a surface entirely, so this effect should + // not apply. + float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; + alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); + } + // Note: lightingOutput rendertargets are not always used as named, particularly m_diffuseColor (target 0) and // m_specularColor (target 1). Comments below describe the differences when appropriate. @@ -347,11 +352,13 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // It's done this way because surface transparency doesn't really change specular response (eg, glass). lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse - + // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. float3 specular = lightingOutput.m_specularColor.rgb; specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); lightingOutput.m_diffuseColor.rgb += specular; + + lightingOutput.m_diffuseColor.w = alpha; } else if (o_opacity_mode == OpacityMode::TintedTransparent) { @@ -374,7 +381,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); lightingOutput.m_diffuseColor.rgb += specular; - lightingOutput.m_specularColor.rgb = baseColor * (1.0 - lightingOutput.m_diffuseColor.w); + lightingOutput.m_specularColor.rgb = baseColor * (1.0 - alpha); } else { From e0c3d15d5a62f402f6582406f71c37aabd9bd15c Mon Sep 17 00:00:00 2001 From: pconroy Date: Fri, 25 Jun 2021 17:39:27 -0700 Subject: [PATCH 33/75] 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,26 +404,27 @@ 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 34/75] 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 35/75] 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 a0a36b867fbd8cfac6c2a44f40be1d6fc541f0db Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Thu, 1 Jul 2021 20:55:29 -0700 Subject: [PATCH 36/75] LYN-4920 | The project image on the welcome page is disconnected from the Project manager (#1738) * Display the correct project preview image in the Editor's Welcome Dialog. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Minor fixes to variable naming for clarity. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../Editor/WelcomeScreen/DefaultActiveProject.png | 3 --- Code/Editor/WelcomeScreen/DefaultProjectImage.png | 3 +++ Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp | 15 +++++++++++++++ Code/Editor/WelcomeScreen/WelcomeScreenDialog.qrc | 2 +- Code/Editor/WelcomeScreen/WelcomeScreenDialog.ui | 5 +---- 5 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 Code/Editor/WelcomeScreen/DefaultActiveProject.png create mode 100644 Code/Editor/WelcomeScreen/DefaultProjectImage.png diff --git a/Code/Editor/WelcomeScreen/DefaultActiveProject.png b/Code/Editor/WelcomeScreen/DefaultActiveProject.png deleted file mode 100644 index 89c3a7cd47..0000000000 --- a/Code/Editor/WelcomeScreen/DefaultActiveProject.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:263e95489560dac6e5944ef3caba13e598f83ddead324b943ad7735ba015e1a9 -size 70727 diff --git a/Code/Editor/WelcomeScreen/DefaultProjectImage.png b/Code/Editor/WelcomeScreen/DefaultProjectImage.png new file mode 100644 index 0000000000..82234dbf6b --- /dev/null +++ b/Code/Editor/WelcomeScreen/DefaultProjectImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cf8339fb51f82a68d2ab475c0476960e75a79d96d239c5b7cd272fbe4990ffe +size 2770 diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp index a444b95132..f9560aef55 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.cpp @@ -75,6 +75,21 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent) { ui->setupUi(this); + // Set the project preview image + QString projectPreviewPath = QDir(AZ::Utils::GetProjectPath().c_str()).filePath("preview.png"); + QFileInfo projectPreviewPathInfo(projectPreviewPath); + if (!projectPreviewPathInfo.exists() || !projectPreviewPathInfo.isFile()) + { + projectPreviewPath = ":/WelcomeScreenDialog/DefaultProjectImage.png"; + } + ui->activeProjectIcon->setPixmap( + QPixmap(projectPreviewPath).scaled( + ui->activeProjectIcon->size(), + Qt::KeepAspectRatioByExpanding, + Qt::SmoothTransformation + ) + ); + ui->recentLevelTable->setColumnCount(3); ui->recentLevelTable->setMouseTracking(true); ui->recentLevelTable->setContextMenuPolicy(Qt::CustomContextMenu); diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.qrc b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.qrc index 9e8ff62f48..131fde4e2b 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.qrc +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.qrc @@ -1,5 +1,5 @@ - DefaultActiveProject.png + DefaultProjectImage.png diff --git a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.ui b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.ui index 680b411121..c8f5a4d67c 100644 --- a/Code/Editor/WelcomeScreen/WelcomeScreenDialog.ui +++ b/Code/Editor/WelcomeScreen/WelcomeScreenDialog.ui @@ -158,11 +158,8 @@ - - :/WelcomeScreenDialog/DefaultActiveProject.png - - Qt::AlignCenter + Qt::AlignHCenter | Qt::AlignVCenter
From 097f99dcc6696747965860bfdb1df910bd812b6f Mon Sep 17 00:00:00 2001 From: antonmic Date: Thu, 1 Jul 2021 21:14:04 -0700 Subject: [PATCH 37/75] [ATOM-15864] Added diffuseResponse to lambertian diffuse calculation --- .../Atom/Features/PBR/Lighting/EnhancedLighting.azsli | 2 +- .../ShaderLib/Atom/Features/PBR/Lighting/SkinLighting.azsli | 2 +- .../Atom/Features/PBR/Lighting/StandardLighting.azsli | 2 +- .../Assets/ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli index 1b8d2c3001..58e589e9d8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli @@ -28,7 +28,7 @@ float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lig } else { - diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight); + diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight, lightingData.diffuseResponse); } if(o_clearCoat_feature_enabled) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/SkinLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/SkinLighting.azsli index a3c13459f4..ef256139c0 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/SkinLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/SkinLighting.azsli @@ -28,7 +28,7 @@ float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lig } else { - diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight); + diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight, lightingData.diffuseResponse); } if(o_clearCoat_feature_enabled) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli index fa754479a0..201aeca321 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli @@ -20,7 +20,7 @@ // Then define the Diffuse and Specular lighting functions float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight) { - float3 diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight); + float3 diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight, lightingData.diffuseResponse); if(o_clearCoat_feature_enabled) { diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli index 31626b60b3..81ab4de1d4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli @@ -21,10 +21,10 @@ // ------- Diffuse Lighting ------- //! Simple Lambertian BRDF. -float3 DiffuseLambertian(float3 albedo, float3 normal, float3 dirToLight) +float3 DiffuseLambertian(float3 albedo, float3 normal, float3 dirToLight, float diffuseResponse) { float NdotL = saturate(dot(normal, dirToLight)); - return albedo * NdotL * INV_PI; + return albedo * NdotL * INV_PI * diffuseResponse; } // Normalized Disney diffuse function taken from Frostbite's PBR course notes (page 10): From e6cb13f14f70633f698017b6c8fbdc160a056fa6 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Thu, 1 Jul 2021 21:41:39 -0700 Subject: [PATCH 38/75] Made intial startup screen text more exciting! (#1743) --- Code/Tools/ProjectManager/Source/ProjectsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index b1db77ea83..3639f786b4 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -86,7 +86,7 @@ namespace O3DE::ProjectManager layout->setAlignment(Qt::AlignTop); frame->setLayout(layout); - QLabel* titleLabel = new QLabel(tr("Ready. Set. Create."), this); + QLabel* titleLabel = new QLabel(tr("Ready? Set. Create!"), this); titleLabel->setObjectName("titleLabel"); layout->addWidget(titleLabel); From 9758aea3d60ae2a0e0afceff36adbe29f7d67fa8 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Thu, 1 Jul 2021 21:53:54 -0700 Subject: [PATCH 39/75] Project Manager Can Cancel Project Builds (#1694) * Fixed misc building and project screen bugs, added ability to cancel active builds and queued builds * Cancelling in-progress cmake build working Signed-off-by: nggieber --- .../Platform/Linux/PAL_linux_files.cmake | 1 + .../Linux/ProjectBuilderWorker_linux.cpp | 19 ++ .../Platform/Mac/PAL_mac_files.cmake | 1 + .../Platform/Mac/ProjectBuilderWorker_mac.cpp | 19 ++ .../Platform/Windows/PAL_windows_files.cmake | 1 + .../Windows/ProjectBuilderWorker_windows.cpp | 175 +++++++++++++ .../ProjectManager/Source/ProjectBuilder.cpp | 244 ------------------ .../Source/ProjectBuilderController.cpp | 113 ++++++++ ...ctBuilder.h => ProjectBuilderController.h} | 33 +-- .../Source/ProjectBuilderWorker.cpp | 71 +++++ .../Source/ProjectBuilderWorker.h | 52 ++++ .../Source/ProjectButtonWidget.cpp | 54 ++-- .../Source/ProjectButtonWidget.h | 17 +- .../Source/ProjectManagerDefs.h | 3 +- .../ProjectManager/Source/ProjectsScreen.cpp | 117 +++++---- .../ProjectManager/Source/ProjectsScreen.h | 7 +- .../project_manager_files.cmake | 6 +- 17 files changed, 591 insertions(+), 342 deletions(-) create mode 100644 Code/Tools/ProjectManager/Platform/Linux/ProjectBuilderWorker_linux.cpp create mode 100644 Code/Tools/ProjectManager/Platform/Mac/ProjectBuilderWorker_mac.cpp create mode 100644 Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp delete mode 100644 Code/Tools/ProjectManager/Source/ProjectBuilder.cpp create mode 100644 Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp rename Code/Tools/ProjectManager/Source/{ProjectBuilder.h => ProjectBuilderController.h} (66%) create mode 100644 Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp create mode 100644 Code/Tools/ProjectManager/Source/ProjectBuilderWorker.h diff --git a/Code/Tools/ProjectManager/Platform/Linux/PAL_linux_files.cmake b/Code/Tools/ProjectManager/Platform/Linux/PAL_linux_files.cmake index 4c94567793..e8085de555 100644 --- a/Code/Tools/ProjectManager/Platform/Linux/PAL_linux_files.cmake +++ b/Code/Tools/ProjectManager/Platform/Linux/PAL_linux_files.cmake @@ -7,4 +7,5 @@ set(FILES Python_linux.cpp + ProjectBuilderWorker_linux.cpp ) diff --git a/Code/Tools/ProjectManager/Platform/Linux/ProjectBuilderWorker_linux.cpp b/Code/Tools/ProjectManager/Platform/Linux/ProjectBuilderWorker_linux.cpp new file mode 100644 index 0000000000..71ade6a009 --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Linux/ProjectBuilderWorker_linux.cpp @@ -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 + * + */ + +#include + +namespace O3DE::ProjectManager +{ + AZ::Outcome ProjectBuilderWorker::BuildProjectForPlatform() + { + QString error = tr("Automatic building on Linux not currently supported!"); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Platform/Mac/PAL_mac_files.cmake b/Code/Tools/ProjectManager/Platform/Mac/PAL_mac_files.cmake index f3ecbd9678..01d6b5f112 100644 --- a/Code/Tools/ProjectManager/Platform/Mac/PAL_mac_files.cmake +++ b/Code/Tools/ProjectManager/Platform/Mac/PAL_mac_files.cmake @@ -7,4 +7,5 @@ set(FILES Python_mac.cpp + ProjectBuilderWorker_mac.cpp ) diff --git a/Code/Tools/ProjectManager/Platform/Mac/ProjectBuilderWorker_mac.cpp b/Code/Tools/ProjectManager/Platform/Mac/ProjectBuilderWorker_mac.cpp new file mode 100644 index 0000000000..bb14bfea6b --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Mac/ProjectBuilderWorker_mac.cpp @@ -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 + * + */ + +#include + +namespace O3DE::ProjectManager +{ + AZ::Outcome ProjectBuilderWorker::BuildProjectForPlatform() + { + QString error = tr("Automatic building on MacOS not currently supported!"); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Platform/Windows/PAL_windows_files.cmake b/Code/Tools/ProjectManager/Platform/Windows/PAL_windows_files.cmake index 44023b791b..eb45c61807 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/PAL_windows_files.cmake +++ b/Code/Tools/ProjectManager/Platform/Windows/PAL_windows_files.cmake @@ -7,4 +7,5 @@ set(FILES Python_windows.cpp + ProjectBuilderWorker_windows.cpp ) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp new file mode 100644 index 0000000000..87a8a6c0ec --- /dev/null +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp @@ -0,0 +1,175 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + AZ::Outcome ProjectBuilderWorker::BuildProjectForPlatform() + { + // Check if we are trying to cancel task + if (QThread::currentThread()->isInterruptionRequested()) + { + QStringToAZTracePrint(BuildCancelled); + return AZ::Failure(BuildCancelled); + } + + QFile logFile(GetLogFilePath()); + if (!logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) + { + QString error = tr("Failed to open log file."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + + EngineInfo engineInfo; + + AZ::Outcome engineInfoResult = PythonBindingsInterface::Get()->GetEngineInfo(); + if (engineInfoResult.IsSuccess()) + { + engineInfo = engineInfoResult.GetValue(); + } + else + { + QString error = tr("Failed to get engine info."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + + QTextStream logStream(&logFile); + if (QThread::currentThread()->isInterruptionRequested()) + { + logFile.close(); + QStringToAZTracePrint(BuildCancelled); + return AZ::Failure(BuildCancelled); + } + + // Show some kind of progress with very approximate estimates + UpdateProgress(++m_progressEstimate); + + QProcessEnvironment currentEnvironment(QProcessEnvironment::systemEnvironment()); + // Append cmake path to PATH incase it is missing + QDir cmakePath(engineInfo.m_path); + cmakePath.cd("cmake/runtime/bin"); + QString pathValue = currentEnvironment.value("PATH"); + pathValue += ";" + cmakePath.path(); + currentEnvironment.insert("PATH", pathValue); + + m_configProjectProcess = new QProcess(this); + m_configProjectProcess->setProcessChannelMode(QProcess::MergedChannels); + m_configProjectProcess->setWorkingDirectory(m_projectInfo.m_path); + m_configProjectProcess->setProcessEnvironment(currentEnvironment); + + m_configProjectProcess->start( + "cmake", + QStringList{ "-B", QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix), "-S", m_projectInfo.m_path, "-G", + "Visual Studio 16", "-DLY_3RDPARTY_PATH=" + engineInfo.m_thirdPartyPath }); + + if (!m_configProjectProcess->waitForStarted()) + { + QString error = tr("Configuring project failed to start."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + bool containsGeneratingDone = false; + while (m_configProjectProcess->waitForReadyRead(MaxBuildTimeMSecs)) + { + QString configOutput = m_configProjectProcess->readAllStandardOutput(); + + if (configOutput.contains("Generating done")) + { + containsGeneratingDone = true; + } + + logStream << configOutput; + logStream.flush(); + + UpdateProgress(qMin(++m_progressEstimate, 19)); + + if (QThread::currentThread()->isInterruptionRequested()) + { + logFile.close(); + m_configProjectProcess->close(); + QStringToAZTracePrint(BuildCancelled); + return AZ::Failure(BuildCancelled); + } + } + + if (m_configProjectProcess->exitCode() != 0 || !containsGeneratingDone) + { + QString error = tr("Configuring project failed. See log for details."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + + UpdateProgress(++m_progressEstimate); + + m_buildProjectProcess = new QProcess(this); + m_buildProjectProcess->setProcessChannelMode(QProcess::MergedChannels); + m_buildProjectProcess->setWorkingDirectory(m_projectInfo.m_path); + m_buildProjectProcess->setProcessEnvironment(currentEnvironment); + + m_buildProjectProcess->start( + "cmake", + QStringList{ "--build", QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix), "--target", + m_projectInfo.m_projectName + ".GameLauncher", "Editor", "--config", "profile" }); + + if (!m_buildProjectProcess->waitForStarted()) + { + QString error = tr("Building project failed to start."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + + // There are a lot of steps when building so estimate around 800 more steps ((100 - 20) * 10) remaining + m_progressEstimate = 200; + while (m_buildProjectProcess->waitForReadyRead(MaxBuildTimeMSecs)) + { + logStream << m_buildProjectProcess->readAllStandardOutput(); + logStream.flush(); + + // Show 1% progress for every 10 steps completed + UpdateProgress(qMin(++m_progressEstimate / 10, 99)); + + if (QThread::currentThread()->isInterruptionRequested()) + { + // QProcess is unable to kill its child processes so we need to ask the operating system to do that for us + QProcess killBuildProcess; + killBuildProcess.setProcessChannelMode(QProcess::MergedChannels); + killBuildProcess.start( + "cmd.exe", QStringList{ "/C", "taskkill", "/pid", QString::number(m_buildProjectProcess->processId()), "/f", "/t" }); + killBuildProcess.waitForFinished(); + + logStream << "Killing Project Build."; + logStream << killBuildProcess.readAllStandardOutput(); + m_buildProjectProcess->kill(); + logFile.close(); + QStringToAZTracePrint(BuildCancelled); + return AZ::Failure(BuildCancelled); + } + } + + if (m_configProjectProcess->exitCode() != 0) + { + QString error = tr("Building project failed. See log for details."); + QStringToAZTracePrint(error); + return AZ::Failure(error); + } + + return AZ::Success(); + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilder.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilder.cpp deleted file mode 100644 index a1dddf818c..0000000000 --- a/Code/Tools/ProjectManager/Source/ProjectBuilder.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. 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 - - -//#define MOCK_BUILD_PROJECT true - -namespace O3DE::ProjectManager -{ - // QProcess::waitForFinished uses -1 to indicate that the process should not timeout - constexpr int MaxBuildTimeMSecs = -1; - - ProjectBuilderWorker::ProjectBuilderWorker(const ProjectInfo& projectInfo) - : QObject() - , m_projectInfo(projectInfo) - { - } - - void ProjectBuilderWorker::BuildProject() - { -#ifdef MOCK_BUILD_PROJECT - for (int i = 0; i < 10; ++i) - { - QThread::sleep(1); - UpdateProgress(i * 10); - } - Done(m_projectPath); -#else - EngineInfo engineInfo; - - AZ::Outcome engineInfoResult = PythonBindingsInterface::Get()->GetEngineInfo(); - if (engineInfoResult.IsSuccess()) - { - engineInfo = engineInfoResult.GetValue(); - } - else - { - emit Done(tr("Failed to get engine info.")); - return; - } - - // Show some kind of progress with very approximate estimates - UpdateProgress(1); - - QProcessEnvironment currentEnvironment(QProcessEnvironment::systemEnvironment()); - // Append cmake path to PATH incase it is missing - QDir cmakePath(engineInfo.m_path); - cmakePath.cd("cmake/runtime/bin"); - QString pathValue = currentEnvironment.value("PATH"); - pathValue += ";" + cmakePath.path(); - currentEnvironment.insert("PATH", pathValue); - - QProcess configProjectProcess; - configProjectProcess.setProcessChannelMode(QProcess::MergedChannels); - configProjectProcess.setWorkingDirectory(m_projectInfo.m_path); - configProjectProcess.setProcessEnvironment(currentEnvironment); - - configProjectProcess.start( - "cmake", - QStringList - { - "-B", - QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix), - "-S", - m_projectInfo.m_path, - "-G", - "Visual Studio 16", - "-DLY_3RDPARTY_PATH=" + engineInfo.m_thirdPartyPath - }); - - if (!configProjectProcess.waitForStarted()) - { - emit Done(tr("Configuring project failed to start.")); - return; - } - if (!configProjectProcess.waitForFinished(MaxBuildTimeMSecs)) - { - WriteErrorLog(configProjectProcess.readAllStandardOutput()); - emit Done(tr("Configuring project timed out. See log for details")); - return; - } - - QString configProjectOutput(configProjectProcess.readAllStandardOutput()); - if (configProjectProcess.exitCode() != 0 || !configProjectOutput.contains("Generating done")) - { - WriteErrorLog(configProjectOutput); - emit Done(tr("Configuring project failed. See log for details.")); - return; - } - - UpdateProgress(20); - - QProcess buildProjectProcess; - buildProjectProcess.setProcessChannelMode(QProcess::MergedChannels); - buildProjectProcess.setWorkingDirectory(m_projectInfo.m_path); - buildProjectProcess.setProcessEnvironment(currentEnvironment); - - buildProjectProcess.start( - "cmake", - QStringList - { - "--build", - QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix), - "--target", - m_projectInfo.m_projectName + ".GameLauncher", - "Editor", - "--config", - "profile" - }); - - if (!buildProjectProcess.waitForStarted()) - { - emit Done(tr("Building project failed to start.")); - return; - } - if (!buildProjectProcess.waitForFinished(MaxBuildTimeMSecs)) - { - WriteErrorLog(configProjectProcess.readAllStandardOutput()); - emit Done(tr("Building project timed out. See log for details")); - return; - } - - QString buildProjectOutput(buildProjectProcess.readAllStandardOutput()); - if (configProjectProcess.exitCode() != 0) - { - WriteErrorLog(buildProjectOutput); - emit Done(tr("Building project failed. See log for details.")); - } - else - { - emit Done(""); - } -#endif - } - - QString ProjectBuilderWorker::LogFilePath() const - { - QDir logFilePath(m_projectInfo.m_path); - logFilePath.cd(ProjectBuildPathPostfix); - return logFilePath.filePath(ProjectBuildErrorLogPathPostfix); - } - - void ProjectBuilderWorker::WriteErrorLog(const QString& log) - { - QFile logFile(LogFilePath()); - // Overwrite file with truncate - if (logFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) - { - QTextStream output(&logFile); - output << log; - logFile.close(); - } - } - - ProjectBuilderController::ProjectBuilderController(const ProjectInfo& projectInfo, ProjectButton* projectButton, QWidget* parent) - : QObject() - , m_projectInfo(projectInfo) - , m_projectButton(projectButton) - , m_parent(parent) - { - m_worker = new ProjectBuilderWorker(m_projectInfo); - m_worker->moveToThread(&m_workerThread); - - connect(&m_workerThread, &QThread::finished, m_worker, &ProjectBuilderWorker::deleteLater); - connect(&m_workerThread, &QThread::started, m_worker, &ProjectBuilderWorker::BuildProject); - connect(m_worker, &ProjectBuilderWorker::Done, this, &ProjectBuilderController::HandleResults); - connect(m_worker, &ProjectBuilderWorker::UpdateProgress, this, &ProjectBuilderController::UpdateUIProgress); - } - - ProjectBuilderController::~ProjectBuilderController() - { - m_workerThread.quit(); - m_workerThread.wait(); - } - - void ProjectBuilderController::Start() - { - m_workerThread.start(); - UpdateUIProgress(0); - } - - void ProjectBuilderController::SetProjectButton(ProjectButton* projectButton) - { - m_projectButton = projectButton; - } - - QString ProjectBuilderController::GetProjectPath() const - { - return m_projectInfo.m_path; - } - - void ProjectBuilderController::UpdateUIProgress(int progress) - { - if (m_projectButton) - { - m_projectButton->SetButtonOverlayText(QString("%1 (%2%)\n\n").arg(tr("Building Project..."), QString::number(progress))); - m_projectButton->SetProgressBarValue(progress); - } - } - - void ProjectBuilderController::HandleResults(const QString& result) - { - if (!result.isEmpty()) - { - if (result.contains(tr("log"))) - { - QMessageBox::StandardButton openLog = QMessageBox::critical( - m_parent, - tr("Project Failed to Build!"), - result + tr("\n\nWould you like to view log?"), - QMessageBox::No | QMessageBox::Yes); - - if (openLog == QMessageBox::Yes) - { - // Open application assigned to this file type - QDesktopServices::openUrl(QUrl("file:///" + m_worker->LogFilePath())); - } - } - else - { - QMessageBox::critical(m_parent, tr("Project Failed to Build!"), result); - } - } - - emit Done(); - } -} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp new file mode 100644 index 0000000000..00e2e5d68d --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.cpp @@ -0,0 +1,113 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. 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 +{ + ProjectBuilderController::ProjectBuilderController(const ProjectInfo& projectInfo, ProjectButton* projectButton, QWidget* parent) + : QObject() + , m_projectInfo(projectInfo) + , m_projectButton(projectButton) + , m_lastProgress(0) + , m_parent(parent) + { + m_worker = new ProjectBuilderWorker(m_projectInfo); + m_worker->moveToThread(&m_workerThread); + + connect(&m_workerThread, &QThread::finished, m_worker, &ProjectBuilderWorker::deleteLater); + connect(&m_workerThread, &QThread::started, m_worker, &ProjectBuilderWorker::BuildProject); + connect(m_worker, &ProjectBuilderWorker::Done, this, &ProjectBuilderController::HandleResults); + connect(m_worker, &ProjectBuilderWorker::UpdateProgress, this, &ProjectBuilderController::UpdateUIProgress); + } + + ProjectBuilderController::~ProjectBuilderController() + { + m_workerThread.requestInterruption(); + m_workerThread.quit(); + m_workerThread.wait(); + } + + void ProjectBuilderController::Start() + { + m_workerThread.start(); + UpdateUIProgress(0); + } + + void ProjectBuilderController::SetProjectButton(ProjectButton* projectButton) + { + m_projectButton = projectButton; + + if (projectButton) + { + projectButton->SetProjectButtonAction(tr("Cancel Build"), [this] { HandleCancel(); }); + + if (m_lastProgress != 0) + { + UpdateUIProgress(m_lastProgress); + } + } + } + + const ProjectInfo& ProjectBuilderController::GetProjectInfo() const + { + return m_projectInfo; + } + + void ProjectBuilderController::UpdateUIProgress(int progress) + { + m_lastProgress = progress; + if (m_projectButton) + { + m_projectButton->SetButtonOverlayText(QString("%1 (%2%)\n\n").arg(tr("Building Project..."), QString::number(progress))); + m_projectButton->SetProgressBarValue(progress); + } + } + + void ProjectBuilderController::HandleResults(const QString& result) + { + if (!result.isEmpty()) + { + if (result.contains(tr("log"))) + { + QMessageBox::StandardButton openLog = QMessageBox::critical( + m_parent, + tr("Project Failed to Build!"), + result + tr("\n\nWould you like to view log?"), + QMessageBox::No | QMessageBox::Yes); + + if (openLog == QMessageBox::Yes) + { + // Open application assigned to this file type + QDesktopServices::openUrl(QUrl("file:///" + m_worker->GetLogFilePath())); + } + } + else + { + QMessageBox::critical(m_parent, tr("Project Failed to Build!"), result); + } + + emit Done(false); + return; + } + + emit Done(true); + } + + void ProjectBuilderController::HandleCancel() + { + m_workerThread.quit(); + emit Done(false); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilder.h b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h similarity index 66% rename from Code/Tools/ProjectManager/Source/ProjectBuilder.h rename to Code/Tools/ProjectManager/Source/ProjectBuilderController.h index e6a539bb36..c3e3026b34 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilder.h +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderController.h @@ -12,32 +12,12 @@ #include #endif +QT_FORWARD_DECLARE_CLASS(QProcess) + namespace O3DE::ProjectManager { QT_FORWARD_DECLARE_CLASS(ProjectButton) - - class ProjectBuilderWorker : public QObject - { - Q_OBJECT - - public: - explicit ProjectBuilderWorker(const ProjectInfo& projectInfo); - ~ProjectBuilderWorker() = default; - - QString LogFilePath() const; - - public slots: - void BuildProject(); - - signals: - void UpdateProgress(int progress); - void Done(QString result); - - private: - void WriteErrorLog(const QString& log); - - ProjectInfo m_projectInfo; - }; + QT_FORWARD_DECLARE_CLASS(ProjectBuilderWorker) class ProjectBuilderController : public QObject { @@ -48,15 +28,16 @@ namespace O3DE::ProjectManager ~ProjectBuilderController(); void SetProjectButton(ProjectButton* projectButton); - QString GetProjectPath() const; + const ProjectInfo& GetProjectInfo() const; public slots: void Start(); void UpdateUIProgress(int progress); void HandleResults(const QString& result); + void HandleCancel(); signals: - void Done(); + void Done(bool success = true); private: ProjectInfo m_projectInfo; @@ -64,5 +45,7 @@ namespace O3DE::ProjectManager QThread m_workerThread; ProjectButton* m_projectButton; QWidget* m_parent; + + int m_lastProgress; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp new file mode 100644 index 0000000000..7b255e1f46 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp @@ -0,0 +1,71 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. 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 + +//#define MOCK_BUILD_PROJECT true + +namespace O3DE::ProjectManager +{ + const QString ProjectBuilderWorker::BuildCancelled = ProjectBuilderWorker::tr("Build Cancelled."); + + ProjectBuilderWorker::ProjectBuilderWorker(const ProjectInfo& projectInfo) + : QObject() + , m_projectInfo(projectInfo) + , m_progressEstimate(0) + { + } + + void ProjectBuilderWorker::BuildProject() + { +#ifdef MOCK_BUILD_PROJECT + for (int i = 0; i < 10; ++i) + { + QThread::sleep(1); + UpdateProgress(i * 10); + } + Done(""); +#else + auto result = BuildProjectForPlatform(); + + if (result.IsSuccess()) + { + emit Done(); + } + else + { + emit Done(result.GetError()); + } +#endif + } + + QString ProjectBuilderWorker::GetLogFilePath() const + { + QDir logFilePath(m_projectInfo.m_path); + // Make directories if they aren't on disk + if (!logFilePath.cd(ProjectBuildPathPostfix)) + { + logFilePath.mkpath(ProjectBuildPathPostfix); + logFilePath.cd(ProjectBuildPathPostfix); + + } + if (!logFilePath.cd(ProjectBuildPathCmakeFiles)) + { + logFilePath.mkpath(ProjectBuildPathCmakeFiles); + logFilePath.cd(ProjectBuildPathCmakeFiles); + } + return logFilePath.filePath(ProjectBuildErrorLogName); + } + + void ProjectBuilderWorker::QStringToAZTracePrint(const QString& error) + { + AZ_TracePrintf("Project Manager", error.toStdString().c_str()); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.h b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.h new file mode 100644 index 0000000000..0557b21831 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include + +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QProcess) + +namespace O3DE::ProjectManager +{ + class ProjectBuilderWorker : public QObject + { + // QProcess::waitForFinished uses -1 to indicate that the process should not timeout + static constexpr int MaxBuildTimeMSecs = -1; + // Build was cancelled + static const QString BuildCancelled; + + Q_OBJECT + + public: + explicit ProjectBuilderWorker(const ProjectInfo& projectInfo); + ~ProjectBuilderWorker() = default; + + QString GetLogFilePath() const; + + public slots: + void BuildProject(); + + signals: + void UpdateProgress(int progress); + void Done(QString result = ""); + + private: + AZ::Outcome BuildProjectForPlatform(); + void QStringToAZTracePrint(const QString& error); + + QProcess* m_configProjectProcess = nullptr; + QProcess* m_buildProjectProcess = nullptr; + ProjectInfo m_projectInfo; + + int m_progressEstimate; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp index fef2639498..68a43b3b52 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp @@ -40,8 +40,8 @@ namespace O3DE::ProjectManager m_overlayLabel->setVisible(false); vLayout->addWidget(m_overlayLabel); - m_buildButton = new QPushButton(tr("Build Project"), this); - m_buildButton->setVisible(false); + m_actionButton = new QPushButton(tr("Project Action"), this); + m_actionButton->setVisible(false); m_progressBar = new QProgressBar(this); m_progressBar->setObjectName("labelButtonProgressBar"); @@ -78,9 +78,9 @@ namespace O3DE::ProjectManager return m_progressBar; } - QPushButton* LabelButton::GetBuildButton() + QPushButton* LabelButton::GetActionButton() { - return m_buildButton; + return m_actionButton; } ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent, bool processing) @@ -135,7 +135,6 @@ namespace O3DE::ProjectManager void ProjectButton::ProcessingSetup() { - m_projectImageLabel->GetOverlayLabel()->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); m_projectImageLabel->SetEnabled(false); m_projectImageLabel->SetOverlayText(tr("Processing...\n\n")); @@ -146,8 +145,6 @@ namespace O3DE::ProjectManager void ProjectButton::ReadySetup() { - connect(m_projectImageLabel->GetBuildButton(), &QPushButton::clicked, [this](){ emit BuildProject(m_projectInfo); }); - 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); }); @@ -168,20 +165,40 @@ namespace O3DE::ProjectManager m_projectFooter->layout()->addWidget(projectMenuButton); } + void ProjectButton::SetProjectButtonAction(const QString& text, AZStd::function lambda) + { + 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 + { + disconnect(m_actionButtonConnection); + } + + projectActionButton->setText(text); + m_actionButtonConnection = connect(projectActionButton, &QPushButton::clicked, lambda); + } + + void ProjectButton::SetProjectBuildButtonAction() + { + SetProjectButtonAction(tr("Build Project"), [this]() { emit BuildProject(m_projectInfo); }); + } + + void ProjectButton::BuildThisProject() + { + emit BuildProject(m_projectInfo); + } + void ProjectButton::SetLaunchButtonEnabled(bool enabled) { m_projectImageLabel->SetEnabled(enabled); } - void ProjectButton::ShowBuildButton(bool show) - { - QSpacerItem* buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); - - m_projectImageLabel->layout()->addItem(buttonSpacer); - m_projectImageLabel->layout()->addWidget(m_projectImageLabel->GetBuildButton()); - m_projectImageLabel->GetBuildButton()->setVisible(show); - } - void ProjectButton::SetButtonOverlayText(const QString& text) { m_projectImageLabel->SetOverlayText(text); @@ -191,4 +208,9 @@ namespace O3DE::ProjectManager { m_projectImageLabel->GetProgressBar()->setValue(progress); } + + LabelButton* ProjectButton::GetLabelButton() + { + return m_projectImageLabel; + } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h index fe2fd73324..b3b4b2bcf6 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h @@ -9,12 +9,15 @@ #if !defined(Q_MOC_RUN) #include +#include #include +#include +#include +#include #endif QT_FORWARD_DECLARE_CLASS(QPixmap) -QT_FORWARD_DECLARE_CLASS(QPushButton) QT_FORWARD_DECLARE_CLASS(QAction) QT_FORWARD_DECLARE_CLASS(QProgressBar) @@ -34,7 +37,7 @@ namespace O3DE::ProjectManager QLabel* GetOverlayLabel(); QProgressBar* GetProgressBar(); - QPushButton* GetBuildButton(); + QPushButton* GetActionButton(); signals: void triggered(); @@ -45,7 +48,7 @@ namespace O3DE::ProjectManager private: QLabel* m_overlayLabel; QProgressBar* m_progressBar; - QPushButton* m_buildButton; + QPushButton* m_actionButton; bool m_enabled = true; }; @@ -58,10 +61,13 @@ namespace O3DE::ProjectManager explicit ProjectButton(const ProjectInfo& m_projectInfo, QWidget* parent = nullptr, bool processing = false); ~ProjectButton() = default; + void SetProjectButtonAction(const QString& text, AZStd::function lambda); + void SetProjectBuildButtonAction(); + void SetLaunchButtonEnabled(bool enabled); - void ShowBuildButton(bool show); void SetButtonOverlayText(const QString& text); void SetProgressBarValue(int progress); + LabelButton* GetLabelButton(); signals: void OpenProject(const QString& projectName); @@ -75,9 +81,12 @@ namespace O3DE::ProjectManager void BaseSetup(); void ProcessingSetup(); void ReadySetup(); + void BuildThisProject(); ProjectInfo m_projectInfo; LabelButton* m_projectImageLabel; QFrame* m_projectFooter; + + QMetaObject::Connection m_actionButtonConnection; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h index 0b1b3fba4e..f74233db51 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h +++ b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h @@ -14,6 +14,7 @@ namespace O3DE::ProjectManager inline constexpr static int ProjectPreviewImageHeight = 280; static const QString ProjectBuildPathPostfix = "build/windows_vs2019"; - static const QString ProjectBuildErrorLogPathPostfix = "CMakeFiles/CMakeProjectBuildError.log"; + static const QString ProjectBuildPathCmakeFiles = "CMakeFiles"; + static const QString ProjectBuildErrorLogName = "CMakeProjectBuildError.log"; static const QString ProjectPreviewImagePath = "preview.png"; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index 3639f786b4..cc3e386118 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -43,8 +43,6 @@ #include #include -//#define DISPLAY_PROJECT_DEV_DATA true - namespace O3DE::ProjectManager { ProjectsScreen::ProjectsScreen(QWidget* parent) @@ -164,43 +162,38 @@ namespace O3DE::ProjectManager projectsScrollArea->setWidget(scrollWidget); projectsScrollArea->setWidgetResizable(true); -#ifndef DISPLAY_PROJECT_DEV_DATA - // Iterate once to insert building project first - if (!buildProjectPath.isEmpty()) + QVector nonProcessingProjects; + buildProjectPath = QDir::fromNativeSeparators(buildProjectPath); + for (auto& project : projectsResult.GetValue()) { - buildProjectPath = QDir::fromNativeSeparators(buildProjectPath); - for (auto project : projectsResult.GetValue()) + if (projectButton && !*projectButton) { if (QDir::fromNativeSeparators(project.m_path) == buildProjectPath) { - ProjectButton* buildingProjectButton = CreateProjectButton(project, flowLayout, true); - - if (projectButton) - { - *projectButton = buildingProjectButton; - } - - break; + *projectButton = CreateProjectButton(project, flowLayout, true); + continue; } } + + nonProcessingProjects.append(project); } - for (auto project : projectsResult.GetValue()) -#else - ProjectInfo project = projectsResult.GetValue().at(0); - for (int i = 0; i < 15; i++) -#endif + for (auto& project : nonProcessingProjects) { - // Add all other projects skipping building project - // Safe if no building project because it is just an empty string - if (project.m_path != buildProjectPath) - { - ProjectButton* projectButtonWidget = CreateProjectButton(project, flowLayout); + ProjectButton* projectButtonWidget = CreateProjectButton(project, flowLayout); - if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end()) - { - projectButtonWidget->ShowBuildButton(true); - } + if (BuildQueueContainsProject(project.m_path)) + { + projectButtonWidget->SetProjectButtonAction(tr("Cancel Queued Build"), + [this, project] + { + UnqueueBuildProject(project); + SuggestBuildProjectMsg(project, false); + }); + } + else if (RequiresBuildProjectIterator(project.m_path) != m_requiresBuild.end()) + { + projectButtonWidget->SetProjectBuildButtonAction(); } } @@ -242,9 +235,9 @@ namespace O3DE::ProjectManager // Make sure to update builder with latest Project Button if (m_currentBuilder) { - ProjectButton* projectButtonPtr; + ProjectButton* projectButtonPtr = nullptr; - m_projectsContent = CreateProjectsContent(m_currentBuilder->GetProjectPath(), &projectButtonPtr); + m_projectsContent = CreateProjectsContent(m_currentBuilder->GetProjectInfo().m_path, &projectButtonPtr); m_currentBuilder->SetProjectButton(projectButtonPtr); } else @@ -412,17 +405,15 @@ namespace O3DE::ProjectManager } } - void ProjectsScreen::SuggestBuildProject(const ProjectInfo& projectInfo) + void ProjectsScreen::SuggestBuildProjectMsg(const ProjectInfo& projectInfo, bool showMessage) { - if (projectInfo.m_needsBuild) + if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end()) { - if (RequiresBuildProjectIterator(projectInfo.m_path) == m_requiresBuild.end()) - { - m_requiresBuild.append(projectInfo); - } - ResetProjectsContent(); + m_requiresBuild.append(projectInfo); } - else + ResetProjectsContent(); + + if (showMessage) { QMessageBox::information(this, tr("Project Should be rebuilt."), @@ -430,6 +421,11 @@ namespace O3DE::ProjectManager } } + void ProjectsScreen::SuggestBuildProject(const ProjectInfo& projectInfo) + { + SuggestBuildProjectMsg(projectInfo, true); + } + void ProjectsScreen::QueueBuildProject(const ProjectInfo& projectInfo) { auto requiredIter = RequiresBuildProjectIterator(projectInfo.m_path); @@ -443,14 +439,22 @@ namespace O3DE::ProjectManager if (m_buildQueue.empty() && !m_currentBuilder) { StartProjectBuild(projectInfo); + // Projects Content is already reset in fuction } else { m_buildQueue.append(projectInfo); + ResetProjectsContent(); } } } + void ProjectsScreen::UnqueueBuildProject(const ProjectInfo& projectInfo) + { + m_buildQueue.removeAll(projectInfo); + ResetProjectsContent(); + } + void ProjectsScreen::NotifyCurrentScreen() { if (ShouldDisplayFirstTimeContent()) @@ -481,7 +485,7 @@ namespace O3DE::ProjectManager return displayFirstTimeContent; } - void ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo) + bool ProjectsScreen::StartProjectBuild(const ProjectInfo& projectInfo) { if (ProjectUtils::IsVS2019Installed()) { @@ -501,25 +505,42 @@ namespace O3DE::ProjectManager } else { - ProjectBuildDone(); + SuggestBuildProjectMsg(projectInfo, false); + return false; } + + return true; } + + return false; } - void ProjectsScreen::ProjectBuildDone() + void ProjectsScreen::ProjectBuildDone(bool success) { + ProjectInfo currentBuilderProject; + if (!success) + { + currentBuilderProject = m_currentBuilder->GetProjectInfo(); + } + delete m_currentBuilder; m_currentBuilder = nullptr; + if (!success) + { + SuggestBuildProjectMsg(currentBuilderProject, false); + } + if (!m_buildQueue.empty()) { - StartProjectBuild(m_buildQueue.front()); + while (!StartProjectBuild(m_buildQueue.front()) && m_buildQueue.size() > 1) + { + m_buildQueue.pop_front(); + } m_buildQueue.pop_front(); } - else - { - ResetProjectsContent(); - } + + ResetProjectsContent(); } QList::iterator ProjectsScreen::RequiresBuildProjectIterator(const QString& projectPath) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.h b/Code/Tools/ProjectManager/Source/ProjectsScreen.h index 12152e908b..1ca8448134 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.h @@ -37,7 +37,7 @@ namespace O3DE::ProjectManager protected: void NotifyCurrentScreen() override; - void ProjectBuildDone(); + void SuggestBuildProjectMsg(const ProjectInfo& projectInfo, bool showMessage); protected slots: void HandleNewProjectButton(); @@ -50,6 +50,9 @@ namespace O3DE::ProjectManager void SuggestBuildProject(const ProjectInfo& projectInfo); void QueueBuildProject(const ProjectInfo& projectInfo); + void UnqueueBuildProject(const ProjectInfo& projectInfo); + + void ProjectBuildDone(bool success = true); void paintEvent(QPaintEvent* event) override; @@ -60,7 +63,7 @@ namespace O3DE::ProjectManager void ResetProjectsContent(); bool ShouldDisplayFirstTimeContent(); - void StartProjectBuild(const ProjectInfo& projectInfo); + bool StartProjectBuild(const ProjectInfo& projectInfo); QList::iterator RequiresBuildProjectIterator(const QString& projectPath); bool BuildQueueContainsProject(const QString& projectPath); bool WarnIfInBuildQueue(const QString& projectPath); diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake index 0aa7a6c86c..a5632f082c 100644 --- a/Code/Tools/ProjectManager/project_manager_files.cmake +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -39,8 +39,10 @@ set(FILES Source/ProjectInfo.cpp Source/ProjectUtils.h Source/ProjectUtils.cpp - Source/ProjectBuilder.h - Source/ProjectBuilder.cpp + Source/ProjectBuilderWorker.h + Source/ProjectBuilderWorker.cpp + Source/ProjectBuilderController.h + Source/ProjectBuilderController.cpp Source/UpdateProjectSettingsScreen.h Source/UpdateProjectSettingsScreen.cpp Source/NewProjectSettingsScreen.h From 2478c60793a09b170ea36d34b1f414e8069f945c Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 2 Jul 2021 00:22:12 -0500 Subject: [PATCH 40/75] Fixed several o3de python package and install layout issues (#1714) * Updated the CrashLog directory path to save to the project user directory instead of the engine-root directory Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing the custom OUTPUT_NAME for the Multiplayer Gem Builder target Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Changed the default value for the LY_3RDPARTY_PATH cache variable to be ~/.o3de/3rdParty This simplifies the first time user experience when running cmake Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed Windows only issue where using creating a VS Solution for an O3DE project on a different drive resulted in an unloaded ":" entry appearing in the solution explorer Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Refactored install layout logic for External Subdirectories Instead of performing a regular expression over the Gems/* directory, now the each external subdirectory including the project (external) directory is recursied over and scanned for any folders that aren't excluded. By default those folders are the [Cc]ache, [Bb]uild and [Uu]ser directories Afterwards the list files to copy over are then split into a directory list and a file list that is filtered by an include regex Next the directory list is iterated over and the directories are copied to the install layout Finally the file list is iterated and the list of files are also copied to the install layout Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed the o3de.bat script changing the working directory before running the o3de.py script Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed exception in engine-template.py script when the create-gem command is invoked with the --template-name parameter that does not correspond to a registered Template Updated the create-project command to register the project with the o3de_manifest.json and the engine with the project as the final step Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed register.py over-registration of non-engine directories when then --this-engine parameter is supplied. All the projects, gems and templates inside of the default o3de_manifest folder locations were being registered with the engine that was being registered Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed register.py register_project_path() method to return 0 when the project path is successfully registered. This issue was that the save_o3de_manifest method "return" value was being checked and that method doesn't actually return a value Added question mark to the engine_template.py to correct text around notifying the user if the project was registered Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added doc comment on the new cmke ly_get_vs_folder_directory function() Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added clarifying comment to the ly_setup_others() command logic to copy over directories and files from any external subdirectories(Gems) that are registered with the engine at the time of install Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed infinite recursion when trying to create a template with the source directory used to seed the template Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Editor/IEditorImpl.cpp | 13 +++- Gems/Multiplayer/Code/CMakeLists.txt | 1 - cmake/3rdParty.cmake | 19 ++++- cmake/LYWrappers.cmake | 39 ++++++++-- cmake/Platform/Common/Install_common.cmake | 89 ++++++++++++++-------- scripts/o3de.bat | 4 +- scripts/o3de/o3de/engine_template.py | 47 +++++------- scripts/o3de/o3de/manifest.py | 6 +- scripts/o3de/o3de/register.py | 6 +- 9 files changed, 142 insertions(+), 82 deletions(-) diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index d9e07f0ec4..f472e12fc9 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -22,7 +22,9 @@ AZ_PUSH_DISABLE_WARNING(4251 4355 4996, "-Wunknown-warning-option") AZ_POP_DISABLE_WARNING // AzCore +#include #include +#include // AzFramework #include @@ -195,8 +197,15 @@ CEditorImpl::CEditorImpl() m_pAssetBrowserRequestHandler = nullptr; m_assetEditorRequestsHandler = nullptr; - AZ::IO::SystemFile::CreateDir("SessionStatus"); - QFile::setPermissions(m_crashLogFileName, QFileDevice::ReadOther | QFileDevice::WriteOther); + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + if (AZ::IO::FixedMaxPath crashLogPath; settingsRegistry->Get(crashLogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectUserPath)) + { + crashLogPath /= m_crashLogFileName; + AZ::IO::SystemFile::CreateDir(crashLogPath.ParentPath().FixedMaxPathString().c_str()); + QFile::setPermissions(crashLogPath.c_str(), QFileDevice::ReadOther | QFileDevice::WriteOther); + } + } } void CEditorImpl::Initialize() diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index 89372025e3..ab6e22225b 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -107,7 +107,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME Multiplayer.Builders GEM_MODULE NAMESPACE Gem - OUTPUT_NAME Gem.Multiplayer.Builders FILES_CMAKE multiplayer_tools_files.cmake INCLUDE_DIRECTORIES diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 204aaedb79..15dde3c3f8 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -8,7 +8,24 @@ # Do not overcomplicate searching for the 3rdParty path, if it is not easy to find, # the user should define it. -set(LY_3RDPARTY_PATH "" CACHE PATH "Path to the 3rdParty folder") +#! get_default_third_party_folder: Stores the default 3rdParty directory into the supplied output variable +# +# \arg:output_third_party_path name of variable to set the default project directory into +# It defaults to the ~/.o3de/3rdParty directory +function(get_default_third_party_folder output_third_party_path) + cmake_path(SET home_directory "$ENV{USERPROFILE}") # Windows + if(NOT EXISTS ${home_directory}) + cmake_path(SET home_directory "$ENV{HOME}") # Unix + if (NOT EXISTS ${home_directory}) + return() + endif() + endif() + + set(${output_third_party_path} ${home_directory}/.o3de/3rdParty PARENT_SCOPE) +endfunction() + +get_default_third_party_folder(o3de_default_third_party_path) +set(LY_3RDPARTY_PATH "${o3de_default_third_party_path}" CACHE PATH "Path to the 3rdParty folder") if(LY_3RDPARTY_PATH) file(TO_CMAKE_PATH ${LY_3RDPARTY_PATH} LY_3RDPARTY_PATH) diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index 89a4ab29f0..b6daf8b6d7 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -257,14 +257,7 @@ function(ly_add_target) # IDE organization ly_source_groups_from_folders("${ALLFILES}") source_group("Generated Files" REGULAR_EXPRESSION "(${CMAKE_BINARY_DIR})") # Any file coming from the output folder - file(RELATIVE_PATH project_path ${LY_ROOT_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}) - # Visual Studio cannot load a project with a FOLDER that starts with a "../" relative path - # Strip away any leading ../ and then add a prefix of ExternalTargets/ as that in this scenario - # A relative directory with ../ would be outside of the Lumberyard Engine Root therefore it is external - set(ide_path ${project_path}) - if (${project_path} MATCHES [[^(\.\./)+(.*)]]) - set(ide_path "${CMAKE_MATCH_2}") - endif() + ly_get_vs_folder_directory(${CMAKE_CURRENT_SOURCE_DIR} ide_path) set_property(TARGET ${project_NAME} PROPERTY FOLDER ${ide_path}) @@ -639,3 +632,33 @@ function(ly_de_alias_target target_name output_variable_name) endif() set(${output_variable_name} ${de_aliased_target_name} PARENT_SCOPE) endfunction() + +#! ly_get_vs_folder_directory: Sets the Visual Studio folder name used for organizing vcxproj +# in the IDE +# +# Visual Studio cannot load projects that with a ".." relative path or contain a colon ":" as part of its FOLDER +# Therefore if the .vcxproj is absolute, the drive letter must be removed from the folder name +# +# What this method does is first check if the target being added to the Visual Studio solution is within +# the LY_ROOT_FOLDER(i.e is the LY_ROOT_FOLDER a prefix of the target source directory) +# If it is a relative path to the target is used as the folder name +# Otherwise the target directory would either +# 1. Be a path outside of the LY_ROOT_FOLDER on the same drive. +# In that case forming a relative path would cause it to start with ".." which will not work +# 2. Be an path outside of the LY_ROOT_FOLDER on a different drive +# Here a relative path cannot be formed and therefore the path would start with ":/Path/To/Project" +# Which shows up as unloaded due to containing a colon +# In this scenario the relative part of the path from the drive letter is used as the FOLDER name +# to make sure the projects show up in the loaded .sln +function(ly_get_vs_folder_directory absolute_target_source_dir output_source_dir) + # Get a relative directory to the LY_ROOT_FOLDER if possible for the Visual Studio solution hierarchy + # If a relative path cannot be formed, then retrieve a path with the drive letter stripped from it + cmake_path(IS_PREFIX LY_ROOT_FOLDER ${absolute_target_source_dir} is_target_prefix_of_engine_root) + if(is_target_prefix_of_engine_root) + cmake_path(RELATIVE_PATH absolute_target_source_dir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE relative_target_source_dir) + else() + cmake_path(GET absolute_target_source_dir RELATIVE_PART relative_target_source_dir) + endif() + + set(${output_source_dir} ${relative_target_source_dir} PARENT_SCOPE) +endfunction() diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 4c94aa7fc5..7ab6006220 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -163,6 +163,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar unset(RUNTIME_DEPENDENCIES_PLACEHOLDER) endif() + get_target_property(inteface_build_dependencies_props ${TARGET_NAME} INTERFACE_LINK_LIBRARIES) unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER) if(inteface_build_dependencies_props) @@ -522,47 +523,75 @@ function(ly_setup_others) DESTINATION . ) - # Gem Source Assets and Registry + # Gem Source Assets and configuration files # Find all gem directories relative to the CMake Source Dir - file(GLOB_RECURSE - gems_assets_path - LIST_DIRECTORIES TRUE - RELATIVE "${LY_ROOT_FOLDER}/" - "Gems/*" - ) - list(FILTER gems_assets_path INCLUDE REGEX "/(Assets|Registry)$") - foreach (gem_assets_path ${gems_assets_path}) - set(gem_abs_assets_path ${LY_ROOT_FOLDER}/${gem_assets_path}/) - if (EXISTS ${gem_abs_assets_path}) + # This first loop is to filter out transient and .gitignore'd folders that should be added to + # the install layout from the root directory. Such as /Cache. + # This is also done to avoid globbing thousands of files in subdirectories that shouldn't + # be processed. + foreach(gem_candidate_dir IN LISTS LY_EXTERNAL_SUBDIRS LY_PROJECTS) + file(REAL_PATH ${gem_candidate_dir} gem_candidate_dir BASE_DIRECTORY ${LY_ROOT_FOLDER}) + # Don't recurse immediately in order to exclude transient source artifacts + file(GLOB + external_subdir_files + LIST_DIRECTORIES TRUE + "${gem_candidate_dir}/*" + ) + # Exclude transient artifacts that shouldn't be copied to the install layout + list(FILTER external_subdir_files EXCLUDE REGEX "/([Bb]uild|[Cc]ache|[Uu]ser)$") + list(APPEND filtered_asset_paths ${external_subdir_files}) + endforeach() + + # At this point the filtered_assets_paths contains the list of all directories and files + # that are non-excluded candidates that can be scanned for target directories and files + # to copy over to the install layout + foreach(filtered_asset_path IN LISTS filtered_asset_paths) + if(IS_DIRECTORY ${filtered_asset_path}) + file(GLOB_RECURSE + recurse_assets_paths + LIST_DIRECTORIES TRUE + "${filtered_asset_path}/*" + ) + set(gem_file_paths ${recurse_assets_paths}) + # Make sure to prepend the current path iteration to the gem_dirs_path to filter + set(gem_dir_paths ${filtered_asset_path} ${recurse_assets_paths}) + + # Gather directories to copy over + # Currently only the Assets, Registry and Config directories are copied over + list(FILTER gem_dir_paths INCLUDE REGEX "/(Assets|Registry|Config)$") + list(APPEND gems_assets_dir_path ${gem_dir_paths}) + else() + set(gem_file_paths ${filtered_asset_path}) + endif() + + # Gather files to copy over + # Currently only the gem.json file is copied over + list(FILTER gem_file_paths INCLUDE REGEX "/(gem.json)$") + list(APPEND gems_assets_file_path "${gem_file_paths}") + endforeach() + + # gem directories to install + foreach(gem_absolute_dir_path ${gems_assets_dir_path}) + cmake_path(RELATIVE_PATH gem_absolute_dir_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_relative_dir_path) + if (EXISTS ${gem_absolute_dir_path}) # The trailing slash is IMPORTANT here as that is needed to prevent # the "Assets" folder from being copied underneath the /Assets folder - install(DIRECTORY ${gem_abs_assets_path} - DESTINATION ${gem_assets_path} + install(DIRECTORY "${gem_absolute_dir_path}/" + DESTINATION ${gem_relative_dir_path} ) endif() endforeach() - # gem.json files - file(GLOB_RECURSE - gems_json_path - LIST_DIRECTORIES FALSE - RELATIVE "${LY_ROOT_FOLDER}" - "Gems/*/gem.json" - ) - foreach(gem_json_path ${gems_json_path}) - get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY) - install(FILES ${gem_json_path} - DESTINATION ${gem_relative_path} + # gem files to install + foreach(gem_absolute_file_path ${gems_assets_file_path}) + cmake_path(RELATIVE_PATH gem_absolute_file_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_relative_file_path) + cmake_path(GET gem_relative_file_path PARENT_PATH gem_relative_parent_dir) + install(FILES ${gem_absolute_file_path} + DESTINATION ${gem_relative_parent_dir} ) endforeach() - # Additional files needed by gems - install(DIRECTORY - ${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config - DESTINATION Gems/Atom/Asset/ImageProcessingAtom - ) - # Templates install(DIRECTORY ${LY_ROOT_FOLDER}/Templates diff --git a/scripts/o3de.bat b/scripts/o3de.bat index 98603bbeb2..b7e3a67261 100644 --- a/scripts/o3de.bat +++ b/scripts/o3de.bat @@ -9,7 +9,7 @@ REM pushd %~dp0% CD %~dp0.. SET "BASE_PATH=%CD%" -CD %~dp0 +popd SET "PYTHON_DIRECTORY=%BASE_PATH%\python" IF EXIST "%PYTHON_DIRECTORY%" GOTO pythonPathAvailable GOTO pythonDirNotFound @@ -25,10 +25,8 @@ GOTO fail ECHO Python executable not found: %PYTHON_EXECUTABLE% GOTO fail :fail -popd EXIT /b 1 :end -popd EXIT /b %ERRORLEVEL% diff --git a/scripts/o3de/o3de/engine_template.py b/scripts/o3de/o3de/engine_template.py index e424288eb5..1bc2cfc9fc 100755 --- a/scripts/o3de/o3de/engine_template.py +++ b/scripts/o3de/o3de/engine_template.py @@ -17,7 +17,7 @@ import uuid import re -from o3de import manifest, validation, utils +from o3de import manifest, register, validation, utils logger = logging.getLogger() logging.basicConfig() @@ -388,10 +388,11 @@ def create_template(source_path: pathlib.Path, if not source_path: logger.error('Src path cannot be empty.') return 1 - if not os.path.isdir(source_path): + if not source_path.is_dir(): logger.error(f'Src path {source_path} is not a folder.') return 1 + source_path = source_path.resolve() # source_name is now the last component of the source_path if not source_name: source_name = os.path.basename(source_path) @@ -401,11 +402,11 @@ def create_template(source_path: pathlib.Path, if not template_path: logger.info(f'Template path empty. Using source name {source_name}') template_path = source_name - if not os.path.isabs(template_path): + if not template_path.is_absolute(): default_templates_folder = manifest.get_registered(default_folder='templates') - template_path = default_templates_folder/ template_path + template_path = default_templates_folder / template_path logger.info(f'Template path not a full path. Using default templates folder {template_path}') - if not force and os.path.isdir(template_path): + if not force and template_path.is_dir(): logger.error(f'Template path {template_path} already exists.') return 1 @@ -415,8 +416,7 @@ def create_template(source_path: pathlib.Path, except ValueError: pass else: - logger.error(f'Template output path {template_path} cannot be a subdirectory of the source_path {source_path}:\n' - f'{err}') + logger.error(f'Template output path {template_path} cannot be a subdirectory of the source_path {source_path}\n') return 1 # template name is now the last component of the template_path @@ -1200,7 +1200,7 @@ def create_from_template(destination_path: pathlib.Path, if not destination_name: # destination name is now the last component of the destination_path - destination_name = os.path.basename(destination_path) + destination_name = destination_path.name # destination name cannot be the same as a restricted platform name if destination_name in restricted_platforms: @@ -1654,28 +1654,10 @@ def create_project(project_path: pathlib.Path, d.write('# SPDX-License-Identifier: Apache-2.0 OR MIT\n') d.write('# {END_LICENSE}\n') - # set the "engine" element of the project.json - engine_json_data = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) - try: - engine_name = engine_json_data['engine_name'] - except KeyError as e: - logger.error(f"engine_name for this engine not found in engine.json.") - return 1 - project_json_data = manifest.get_project_json_data(project_path=project_path) - if not project_json_data: - # get_project_json_data already logs an error if the project.json is mising - return 1 - - project_json_data.update({"engine": engine_name}) - with open(project_json, 'w') as s: - try: - s.write(json.dumps(project_json_data, indent=4) + '\n') - except OSError as e: - logger.error(f'Failed to write project json at {project_path}.') - return 1 - - return 0 + # Register the project with the global o3de_manifest.json and set the project.json "engine" field to match the + # engine.json "engine_name" field + return register.register(project_path=project_path) def create_gem(gem_path: pathlib.Path, @@ -1745,6 +1727,11 @@ def create_gem(gem_path: pathlib.Path, if template_name and not template_path: template_path = manifest.get_registered(template_name=template_name) + if not template_path: + logger.error(f'Could not find the template path using name {template_name}.\n' + 'Has the template been registered yet? It can be registered via the ' + '"o3de.py register --tp " command') + return 1 if not os.path.isdir(template_path): logger.error(f'Could not find the template {template_name}=>{template_path}') return 1 @@ -2068,7 +2055,7 @@ def _run_create_from_template(args: argparse) -> int: return create_from_template(args.destination_path, args.template_path, args.template_name, - args.destination_path, + args.destination_name, args.destination_restricted_path, args.destination_restricted_name, args.template_restricted_path, diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index 832987be3c..c4a7cf8f36 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -194,9 +194,9 @@ def load_o3de_manifest(manifest_path: pathlib.Path = None) -> dict: return json_data -def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> None: +def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> bool: """ - Save the json dictionary to the supplied manifest file or ~/.o3de/o3de_manifest.json if None + Save the json dictionary to the supplied manifest file or ~/.o3de/o3de_manifest.json if manifest_path is None :param json_data: dictionary to save in json format at the file path :param manifest_path: optional path to manifest file to save @@ -206,8 +206,10 @@ def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> N with manifest_path.open('w') as s: try: s.write(json.dumps(json_data, indent=4) + '\n') + return True except OSError as e: logger.error(f'Manifest json failed to save: {str(e)}') + return False # Data query methods diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index 7ad341784e..40556205de 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -341,7 +341,7 @@ def register_o3de_object_path(json_data: dict, try: paths_to_remove.append(o3de_object_path.relative_to(save_path.parent)) except ValueError: - pass # It is OK relative path cannot be formed + pass # It is OK relative path cannot be formed manifest_data[o3de_object_key] = list(filter(lambda p: pathlib.Path(p) not in paths_to_remove, manifest_data.setdefault(o3de_object_key, []))) @@ -425,7 +425,6 @@ def register_project_path(json_data: dict, if not manifest.save_o3de_manifest(project_json_data, project_json_path): return 1 - return 0 @@ -754,9 +753,6 @@ def _run_register(args: argparse) -> int: return repo.refresh_repos() elif args.this_engine: ret_val = register(engine_path=manifest.get_this_engine_path(), force=args.force) - error_code = register_shipped_engine_o3de_objects(force=args.force) - if error_code: - ret_val = error_code return ret_val elif args.all_engines_path: return register_all_engines_in_folder(args.all_engines_path, args.remove, args.force) From 4a3772d96af7e469a050f32d2a1a3ec5acd7140d Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Fri, 2 Jul 2021 12:52:56 +0200 Subject: [PATCH 41/75] [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 f93c2f5b60ea70b87a77fb02850119f11a49bbe9 Mon Sep 17 00:00:00 2001 From: Terry Michaels Date: Fri, 2 Jul 2021 07:08:12 -0500 Subject: [PATCH 42/75] signoff (#1748) Signed-off-by: Terry Michaels --- Code/Framework/AzQtComponents/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzQtComponents/CMakeLists.txt b/Code/Framework/AzQtComponents/CMakeLists.txt index 135781140e..d97ad4c59f 100644 --- a/Code/Framework/AzQtComponents/CMakeLists.txt +++ b/Code/Framework/AzQtComponents/CMakeLists.txt @@ -41,7 +41,7 @@ ly_add_target( ) ly_add_target( - NAME AmazonQtControlGallery APPLICATION + NAME O3DEQtControlGallery APPLICATION NAMESPACE AZ AUTOMOC AUTOUIC From 6459375b4e804bc77ee43151a1a8536b58e07988 Mon Sep 17 00:00:00 2001 From: Aaron Ruiz Mora Date: Fri, 2 Jul 2021 13:16:10 +0100 Subject: [PATCH 43/75] Fixed compilation error in release configuration (#1757) Signed-off-by: moraaar --- .../Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp | 5 ++++- Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index 8c39c37439..2b80a3acbf 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -84,7 +84,10 @@ namespace AssetProcessor AssetProcessorTest::TearDown(); } - void OnError([[maybe_unused]] const AZ::IO::SystemFile* file, const char* fileName, int errorCode) override + void OnError( + [[maybe_unused]] const AZ::IO::SystemFile* file, + [[maybe_unused]] const char* fileName, + [[maybe_unused]] int errorCode) override { AZ_Error("LegacyTestAdapter", false, "File error detected with %s with code %d", fileName, errorCode); } diff --git a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp index 7b255e1f46..45034686c3 100644 --- a/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectBuilderWorker.cpp @@ -64,7 +64,7 @@ namespace O3DE::ProjectManager return logFilePath.filePath(ProjectBuildErrorLogName); } - void ProjectBuilderWorker::QStringToAZTracePrint(const QString& error) + void ProjectBuilderWorker::QStringToAZTracePrint([[maybe_unused]] const QString& error) { AZ_TracePrintf("Project Manager", error.toStdString().c_str()); } From 5f9c066626d5e23db324986f70160e7cc80b6c83 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Fri, 2 Jul 2021 14:52:56 +0200 Subject: [PATCH 44/75] [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 0c43493e29187f16907b76d8c278d563941a3bd7 Mon Sep 17 00:00:00 2001 From: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Date: Fri, 2 Jul 2021 07:56:54 -0700 Subject: [PATCH 45/75] FBX to Scene part 3, tangent generation rule FBX -> SourceScene (#1747) * Tangent space FromFBX -> FromSourceScene Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- .../Importers/AssImpBitangentStreamImporter.cpp | 2 +- .../Importers/AssImpTangentStreamImporter.cpp | 2 +- .../DataTypes/GraphData/IMeshVertexTangentData.h | 6 +++--- .../SceneData/GraphData/MeshVertexBitangentData.cpp | 4 ++-- .../SceneData/GraphData/MeshVertexBitangentData.h | 2 +- .../SceneData/GraphData/MeshVertexTangentData.cpp | 4 ++-- .../SceneData/GraphData/MeshVertexTangentData.h | 2 +- Code/Tools/SceneAPI/SceneData/Rules/TangentsRule.cpp | 4 ++-- .../Tests/GraphData/GraphDataBehaviorTests.cpp | 4 ++-- .../SceneAPIExt/Rules/MotionSamplingRule.cpp | 6 +++--- .../Pipeline/SceneAPIExt/Rules/MotionSamplingRule.h | 4 ++-- .../TangentGenerator/TangentGenerateComponent.cpp | 12 ++++++------ 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp index d822ee148e..3acbaba9cc 100644 --- a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpBitangentStreamImporter.cpp @@ -86,7 +86,7 @@ namespace AZ // AssImp only has one bitangentStream per mesh. bitangentStream->SetBitangentSetIndex(0); - bitangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); + bitangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); bitangentStream->ReserveContainerSpace(vertexCount); for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { diff --git a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp index 97c9c6c004..074ca79281 100644 --- a/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/SceneBuilder/Importers/AssImpTangentStreamImporter.cpp @@ -88,7 +88,7 @@ namespace AZ // AssImp only has one tangentStream per mesh. tangentStream->SetTangentSetIndex(0); - tangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); + tangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); tangentStream->ReserveContainerSpace(vertexCount); for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { diff --git a/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshVertexTangentData.h b/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshVertexTangentData.h index 908c1a2420..7f3895e5cb 100644 --- a/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshVertexTangentData.h +++ b/Code/Tools/SceneAPI/SceneCore/DataTypes/GraphData/IMeshVertexTangentData.h @@ -23,9 +23,9 @@ namespace AZ { enum class TangentSpace { - FromFbx = 0, - MikkT = 1, - EMotionFX = 2 + FromSourceScene = 0, + MikkT = 1, + EMotionFX = 2 }; enum class BitangentMethod diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.cpp b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.cpp index 9ed9d41824..0dca36763e 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.cpp +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.cpp @@ -20,7 +20,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1); + serializeContext->Class()->Version(2); } BehaviorContext* behaviorContext = azrtti_cast(context); @@ -34,7 +34,7 @@ namespace AZ ->Method("GetBitangentSetIndex", &MeshVertexBitangentData::GetBitangentSetIndex) ->Method("GetTangentSpace", &MeshVertexBitangentData::GetTangentSpace) ->Enum<(int)SceneAPI::DataTypes::TangentSpace::EMotionFX>("EMotionFX") - ->Enum<(int)SceneAPI::DataTypes::TangentSpace::FromFbx>("FromFbx") + ->Enum<(int)SceneAPI::DataTypes::TangentSpace::FromSourceScene>("FromSourceScene") ->Enum<(int)SceneAPI::DataTypes::TangentSpace::MikkT>("MikkT"); } } diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.h b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.h index 8ef10f3e2a..edf4184e94 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.h +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexBitangentData.h @@ -50,7 +50,7 @@ namespace AZ SCENE_DATA_API void GetDebugOutput(AZ::SceneAPI::Utilities::DebugOutput& output) const override; protected: AZStd::vector m_bitangents; - AZ::SceneAPI::DataTypes::TangentSpace m_tangentSpace = AZ::SceneAPI::DataTypes::TangentSpace::FromFbx; + AZ::SceneAPI::DataTypes::TangentSpace m_tangentSpace = AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene; size_t m_setIndex = 0; }; diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.cpp b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.cpp index 58d59c04cb..cc9b9c8445 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.cpp +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.cpp @@ -20,7 +20,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1); + serializeContext->Class()->Version(2); } BehaviorContext* behaviorContext = azrtti_cast(context); @@ -34,7 +34,7 @@ namespace AZ ->Method("GetTangentSetIndex", &MeshVertexTangentData::GetTangentSetIndex) ->Method("GetTangentSpace", &MeshVertexTangentData::GetTangentSpace) ->Enum<(int)SceneAPI::DataTypes::TangentSpace::EMotionFX>("EMotionFX") - ->Enum<(int)SceneAPI::DataTypes::TangentSpace::FromFbx>("FromFbx") + ->Enum<(int)SceneAPI::DataTypes::TangentSpace::FromSourceScene>("FromSourceScene") ->Enum<(int)SceneAPI::DataTypes::TangentSpace::MikkT>("MikkT"); } } diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.h b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.h index 333ab68f7e..7936a16307 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.h +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshVertexTangentData.h @@ -49,7 +49,7 @@ namespace AZ SCENE_DATA_API void GetDebugOutput(AZ::SceneAPI::Utilities::DebugOutput& output) const override; protected: AZStd::vector m_tangents; - AZ::SceneAPI::DataTypes::TangentSpace m_tangentSpace = AZ::SceneAPI::DataTypes::TangentSpace::FromFbx; + AZ::SceneAPI::DataTypes::TangentSpace m_tangentSpace = AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene; size_t m_setIndex = 0; }; diff --git a/Code/Tools/SceneAPI/SceneData/Rules/TangentsRule.cpp b/Code/Tools/SceneAPI/SceneData/Rules/TangentsRule.cpp index 9387d833cc..4b4fc04985 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/TangentsRule.cpp +++ b/Code/Tools/SceneAPI/SceneData/Rules/TangentsRule.cpp @@ -142,7 +142,7 @@ namespace AZ return; } - serializeContext->Class()->Version(1) + serializeContext->Class()->Version(2) ->Field("tangentSpace", &TangentsRule::m_tangentSpace) ->Field("bitangentMethod", &TangentsRule::m_bitangentMethod) ->Field("normalize", &TangentsRule::m_normalize) @@ -156,7 +156,7 @@ namespace AZ ->Attribute("AutoExpand", true) ->Attribute(AZ::Edit::Attributes::NameLabelOverride, "") ->DataElement(AZ::Edit::UIHandlers::ComboBox, &AZ::SceneAPI::SceneData::TangentsRule::m_tangentSpace, "Tangent space", "Specify the tangent space used for normal map baking. Choose 'From Fbx' to extract the tangents and bitangents directly from the Fbx file. When there is no tangents rule or the Fbx has no tangents stored inside it, the 'MikkT' option will be used with orthogonal tangents of unit length, so with the normalize option enabled, using the first UV set.") - ->EnumAttribute(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx, "From Fbx") + ->EnumAttribute(AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene, "From Source Scene") ->EnumAttribute(AZ::SceneAPI::DataTypes::TangentSpace::MikkT, "MikkT") ->EnumAttribute(AZ::SceneAPI::DataTypes::TangentSpace::EMotionFX, "EMotion FX") ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) diff --git a/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp b/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp index d9827e738a..f5b296aa5f 100644 --- a/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp +++ b/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp @@ -83,7 +83,7 @@ namespace AZ auto* bitangentData = AZStd::any_cast(&data); bitangentData->AppendBitangent(AZ::Vector3{0.12f, 0.34f, 0.56f}); bitangentData->AppendBitangent(AZ::Vector3{0.77f, 0.88f, 0.99f}); - bitangentData->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); + bitangentData->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); bitangentData->SetBitangentSetIndex(1); return true; } @@ -317,7 +317,7 @@ namespace AZ ExpectExecute("TestExpectFloatEquals(bitangentData.y, 0.88)"); ExpectExecute("TestExpectFloatEquals(bitangentData.z, 0.99)"); ExpectExecute("TestExpectIntegerEquals(meshVertexBitangentData:GetBitangentSetIndex(), 1)"); - ExpectExecute("TestExpectTrue(meshVertexBitangentData:GetTangentSpace(), MeshVertexBitangentData.FromFbx)"); + ExpectExecute("TestExpectTrue(meshVertexBitangentData:GetTangentSpace(), MeshVertexBitangentData.FromSourceScene)"); } TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_MeshVertexTangentData_AccessWorks) diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.cpp index 84a951eeed..d9f1a51ffb 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.cpp @@ -129,7 +129,7 @@ namespace EMotionFX return; } - serializeContext->Class()->Version(3) + serializeContext->Class()->Version(4) ->Field("motionDataType", &MotionSamplingRule::m_motionDataType) ->Field("sampleRateMethod", &MotionSamplingRule::m_sampleRateMethod) ->Field("customSampleRate", &MotionSamplingRule::m_customSampleRate) @@ -151,7 +151,7 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MotionSamplingRule::m_sampleRateMethod, "Sample rate", "Either use the Fbx sample rate or use a custom sample rate. The sample rate is automatically limited to the rate from Fbx.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) - ->EnumAttribute(SampleRateMethod::FromFbx, "From Fbx") + ->EnumAttribute(SampleRateMethod::FromSourceScene, "From Source Scene") ->EnumAttribute(SampleRateMethod::Custom, "Custom sample rate") ->DataElement(AZ::Edit::UIHandlers::Default, &MotionSamplingRule::m_keepDuration, "Keep duration", "When enabled this keep the duration the same as the Fbx motion duration, even if no joints are animated. " "When this option is disabled and the motion doesn't animate any joints then the resulting motion will have a duration of zero seconds.") @@ -199,7 +199,7 @@ namespace EMotionFX AZ::Crc32 MotionSamplingRule::GetVisibilityCustomSampleRate() const { - return m_sampleRateMethod == SampleRateMethod::FromFbx ? AZ::Edit::PropertyVisibility::Hide : AZ::Edit::PropertyVisibility::Show; + return m_sampleRateMethod == SampleRateMethod::FromSourceScene ? AZ::Edit::PropertyVisibility::Hide : AZ::Edit::PropertyVisibility::Show; } AZ::Crc32 MotionSamplingRule::GetVisibilityAllowedSizePercentage() const diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.h b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.h index f7464bf80c..95cee690d8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.h +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/MotionSamplingRule.h @@ -30,7 +30,7 @@ namespace EMotionFX enum class SampleRateMethod : AZ::u8 { - FromFbx = 0, + FromSourceScene = 0, Custom = 1 }; @@ -71,7 +71,7 @@ namespace EMotionFX AZ::Crc32 GetVisibilityAllowedSizePercentage() const; float m_customSampleRate = 60.0f; - SampleRateMethod m_sampleRateMethod = SampleRateMethod::FromFbx; + SampleRateMethod m_sampleRateMethod = SampleRateMethod::FromSourceScene; AZ::TypeId m_motionDataType = AZ::TypeId::CreateNull(); bool m_keepDuration = true; diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp index e8798de0b6..67a032f737 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp @@ -123,8 +123,8 @@ namespace AZ::SceneGenerationComponents while (uvData) { // Get the tangents and bitangents from the source scene. - AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); - AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); + AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); + AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); if (fbxTangentData && fbxBitangentData) { @@ -198,8 +198,8 @@ namespace AZ::SceneGenerationComponents } // Check if we had tangents inside the source scene file. - AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); - AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); + AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); + AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene); // Check what tangent spaces we need. AZStd::vector requiredSpaces = CollectRequiredTangentSpaces(scene); @@ -212,7 +212,7 @@ namespace AZ::SceneGenerationComponents } // If all we need is import from the source scene, and we have tangent data from the source scene already, then skip generating. - if ((requiredSpaces.size() == 1 && requiredSpaces[0] == AZ::SceneAPI::DataTypes::TangentSpace::FromFbx) && fbxTangentData && fbxBitangentData) + if ((requiredSpaces.size() == 1 && requiredSpaces[0] == AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene) && fbxTangentData && fbxBitangentData) { return true; } @@ -232,7 +232,7 @@ namespace AZ::SceneGenerationComponents switch (space) { // If we want Fbx tangents, we don't need to do anything for that. - case AZ::SceneAPI::DataTypes::TangentSpace::FromFbx: + case AZ::SceneAPI::DataTypes::TangentSpace::FromSourceScene: { allSuccess &= true; } From d17390befbb463fa371ed1874e39ec89635172df Mon Sep 17 00:00:00 2001 From: pereslav Date: Fri, 2 Jul 2021 16:01:30 +0100 Subject: [PATCH 46/75] 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 47/75] [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 48/75] 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 49/75] [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 50/75] 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 51/75] 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 52/75] 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 53/75] 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 54/75] [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 | 7543 ++++++++--------- .../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, 3943 insertions(+), 3999 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,2707 +16,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3192,7 +492,531 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4650,7 +2474,2553 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4923,105 +5293,144 @@ - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + @@ -5029,7 +5438,7 @@ - + @@ -5133,537 +5542,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -5673,7 +5556,7 @@ - + @@ -5681,7 +5564,7 @@ - + @@ -5694,7 +5577,7 @@ - + @@ -5704,7 +5587,7 @@ - + @@ -5712,7 +5595,7 @@ - + @@ -5725,7 +5608,7 @@ - + @@ -5735,7 +5618,7 @@ - + @@ -5743,7 +5626,7 @@ - + @@ -5756,7 +5639,7 @@ - + @@ -5766,7 +5649,7 @@ - + @@ -5774,7 +5657,7 @@ - + @@ -5787,7 +5670,7 @@ - + @@ -5797,7 +5680,7 @@ - + @@ -5805,7 +5688,7 @@ - + @@ -5818,7 +5701,7 @@ - + @@ -5828,7 +5711,7 @@ - + @@ -5836,7 +5719,7 @@ - + @@ -5849,7 +5732,7 @@ - + @@ -5859,7 +5742,7 @@ - + @@ -5867,7 +5750,7 @@ - + @@ -5878,6 +5761,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5886,7 +5831,7 @@ - + @@ -5894,402 +5839,10 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6308,32 +5861,87 @@ - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6344,10 +5952,22 @@ - - + + - + + + + + + + + + + + + + @@ -6355,7 +5975,7 @@ - + @@ -6363,7 +5983,91 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6389,7 +6093,7 @@ - + @@ -6397,7 +6101,7 @@ - + @@ -6418,7 +6122,7 @@ - + @@ -6428,7 +6132,7 @@ - + @@ -6436,7 +6140,7 @@ - + @@ -6444,7 +6148,7 @@ - + @@ -6454,6 +6158,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6461,24 +6316,9 @@ - - - - - - - - - - - - - - - - - - + + + @@ -6486,14 +6326,14 @@ - + - + @@ -6506,21 +6346,126 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -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 55/75] [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 56/75] 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 57/75] 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 58/75] 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 59/75] 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 60/75] {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 61/75] 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 62/75] 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 63/75] 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 64/75] 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 65/75] 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 66/75] 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 67/75] 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 68/75] 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 69/75] 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 70/75] 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 71/75] 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 72/75] 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 73/75] [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 74/75] 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 75/75] 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